Assign roles to organization user members

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://openapi.logto.io/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
"Logto API references MCP server": {
  "url": "https://openapi.logto.io/mcp"
}
Close
POST /api/organizations/{id}/users/roles

Assign roles to user members of the specified organization.

Path parameters

  • id string Required

    The unique identifier of the organization.

application/json

Body Required

  • userIds array[string] Required

    An array of user IDs to assign roles.

    Minimum length of each is 1.

  • organizationRoleIds array[string] Required

    An array of organization role IDs to assign. User existed roles assignment will be ignored.

    Minimum length of each is 1.

Responses

  • 201 application/json

    Roles were assigned to organization users successfully.

  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 422

    At least one of the IDs provided is not valid. For example, the organization ID, user ID, or organization role ID does not exist; the user is not a member of the organization; or the role type is not assignable to the user.

POST /api/organizations/{id}/users/roles
curl \
 --request POST 'https://[tenant_id].logto.app/api/organizations/{id}/users/roles' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"userIds":["string"],"organizationRoleIds":["string"]}'
Request examples
{
  "userIds": [
    "string"
  ],
  "organizationRoleIds": [
    "string"
  ]
}