POST /users – Creates a new user.


Headers:

  • Authorization: Bearer <access_token> (required)
  • Content-Type: application/json or application/x-www-form-urlencoded (required)

Body:

Path Parameters:

  • None

Query Parameters:

  • None

  • 201 Created – Returns a JSON-stringified User object.

Status Code Meaning When it Happens
400 Bad Request Missing or invalid fields in request body
401 Unauthorized Missing or invalid authentication token
409 Conflict Email address is already in use
500 Internal Server Error Unexpected error during user creation
{
"error": "Detailed error message here"
}

POST /users
{
"provider": "auth0-user", // Optional, defaults to "auth0-user" if omitted
"user": {
"email": "user@district123.com",
"password": "SecurePassword123!",
"givenName": "John",
"familyName": "Doe",
"appMetadata": { "createdBy": "SCRIPT" }
}
}
POST /users
{
"provider": "cognito-user",
"user": {
"userPoolId": "us-east-1_1234test",
"email": "user@district123.com",
"password": "SecurePassword123!",
"firstName": "John",
"lastName": "Doe",
"appMetadata": { "createdBy": "SCRIPT" }
}
}
{
"id": "user_123",
"email": "user@district123.com",
"name": "John Doe",
"blocked": false,
"emailVerified": true,
"createdAt": "2025-09-12T12:00:00Z",
"updatedAt": "2025-09-12T12:00:00Z",
"appMetadata": {
// ...app metadata fields...
},
"userMetadata": {
// ...user metadata fields...
}
// Additional user fields
}

  • Parameters

    • event: APIGatewayProxyEvent

      The API Gateway event containing the request.

    • context: Context
    • callback: Callback<APIGatewayProxyResult>

    Returns void | Promise<APIGatewayProxyResult>

    A Promise resolving to an API Gateway-compatible response.