Skip to content

func-api-users-patch

Description

Updates a user's super user status.

  • is_super — adds or removes the user from the Cognito super_users group. The last super user cannot be demoted.

Super user access is required.

Invocation

Invoked by API Gateway on an HTTP PATCH /users/{email} request.

API Endpoints

MethodPathAuthDescription
PATCH/users/{email}Super userUpdate super user status

Request Body

json
{
  "is_super": true
}
FieldTypeRequiredDescription
is_superbooleanYestrue to grant super status; false to revoke it

Response Codes

CodeReason
200 OKUser updated
400 Bad RequestMissing or invalid is_super field
403 ForbiddenCaller is not a super user
404 Not FoundUser not found in Cognito (user may not have signed in yet)
409 ConflictCannot demote the last super user

See the API Reference for full schema documentation.

Deployment

See the deployment workflow documentation for workflow steps, infrastructure dependencies, and failure scenarios.