Skip to content
campaiDeveloper
campai.com

Connect ยท Team roles

DELETE/connect/organizations/{organizationId}/team-roles/{roleId}

Delete team role

Deletes a team role identified by organizationId and roleId. A role cannot be deleted while it is a team's default member role. A successful request returns no content.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller must have the team.remove permission.

Request

Path parameters

  • organizationIdidrequired
  • roleIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request DELETE 'https://cloud.campai.com/api/connect/organizations/YOUR_ORGANIZATION_ID/team-roles/YOUR_ROLE_ID' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

No response body is specified.

What else happens

  • The role's referenceRevision is incremented during the deletion transaction.
  • The role is deleted from teamRoles.
  • The endpoint triggers triggerUpdatedTeamRole for the deleted role.

Errors

Other errors

StatusErrorWhen
404The team role was not foundIf the role is not found, the endpoint returns HTTP 404 with key routes.connect.teams.roles.notFound.
409This role is the default member role of a team. Assign another member role to that team before deleting it.If the role is a team's default member role, the endpoint returns HTTP 409 with key routes.connect.teams.roles.usedAsMemberRole.

Errors nearly every request can meet are listed under Errors.