Update organization invitation status

PUT /api/organization-invitations/{id}/status

Update the status of an organization invitation by ID.

Path parameters

  • id string Required

    The unique identifier of the organization invitation.

application/json

Body Required

The organization invitation status to update.

  • acceptedUserId string | null

    The ID of the user who accepted the organization invitation. Required if the status is "Accepted".

    Maximum length is 21.

  • status string Required

    The status of the organization invitation.

    Values are Accepted or Revoked.

Responses

  • 200 application/json

    The organization invitation status was updated successfully.

    Hide response attributes Show response attributes object
    • tenantId string Required

      Maximum length is 21.

    • id string Required

      Minimum length is 1, maximum length is 21.

    • inviterId string | null Required

      Maximum length is 21.

    • invitee string Required

      Minimum length is 1, maximum length is 256.

    • acceptedUserId string | null Required

      Maximum length is 21.

    • organizationId string Required

      Minimum length is 1, maximum length is 21.

    • status string Required

      Values are Pending, Accepted, Expired, or Revoked.

    • createdAt number Required
    • updatedAt number Required
    • expiresAt number Required
    • organizationRoles array[object] Required
      Hide organizationRoles attributes Show organizationRoles attributes object
      • id string Required
      • name string Required
  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 422

    The organization invitation status could not be updated. This can happen if the current status is not "Pending" or if the status is "Accepted" and the accepted user ID is not provided.

PUT /api/organization-invitations/{id}/status
curl \
 --request PUT 'https://[tenant_id].logto.app/api/organization-invitations/{id}/status' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"acceptedUserId":"string","status":"Accepted"}'
Request examples
{
  "acceptedUserId": "string",
  "status": "Accepted"
}
Response examples (200)
{
  "tenantId": "string",
  "id": "string",
  "inviterId": "string",
  "invitee": "string",
  "acceptedUserId": "string",
  "organizationId": "string",
  "status": "Pending",
  "createdAt": 42.0,
  "updatedAt": 42.0,
  "expiresAt": 42.0,
  "organizationRoles": [
    {
      "id": "string",
      "name": "string"
    }
  ]
}