curl -sS -X DELETE "$BMA_BASE_URL/v1/user_profiles/uprof_agray2nefbytbbjt7cslohtp2q" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"id": "uprof_agray2nefbytbbjt7cslohtp2q",
"type": "user_profile_deleted"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Delete a user profile
Deletes a user profile of the workspace the request acts in, permanently: the record is removed and its ID names nothing afterwards. Deleting it again, or deleting an unknown profile, answers 404 not_found_error without an error.code. Nothing else in the workspace changes.
Authorization: workspace_admin or workspace_developer in the workspace the request acts in (organization owners and admins hold workspace_admin everywhere; a workspace organization API key acts as workspace_developer, an admin key as admin); other roles are refused with 403 permission_denied. Accepted credentials: an organization API key (x-api-key: bma_org_v1_…), or a personal access token (Authorization: Bearer bma_pat_v1_…), signed-in dashboard access token or dashboard session naming the organization with bma-organization-id (org_…). The workspace is the one bma-workspace-id (or anthropic-workspace-id) names, else the credential’s own; a credential that can use several workspaces must name one (400 project_required), and a workspace the caller cannot use answers 404.
Limits:
- No limits specific to this endpoint.
- Rate limit: one request of the organization’s write budget (Rate limits).
Errors (besides the common errors (401 authentication, 429 rate_limited, 500)):
| Status | error.type | error.code | Cause | Fix |
|---|---|---|---|---|
| 400 | invalid_request_error | organization_required | A user credential sent no bma-organization-id header. | Send bma-organization-id with the org_… ID of the organization. |
| 400 | invalid_request_error | project_required | The credential can use several workspaces and the request names none. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | workspace_id_conflict | bma-workspace-id and anthropic-workspace-id name different workspaces. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 403 | permission_error | permission_denied | The caller’s role in the workspace is neither workspace_admin nor workspace_developer, or the credential cannot call this API. | Use a credential with the required role or access; retrying with the same credential will not help. |
curl -sS -X DELETE "$BMA_BASE_URL/v1/user_profiles/uprof_agray2nefbytbbjt7cslohtp2q" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"id": "uprof_agray2nefbytbbjt7cslohtp2q",
"type": "user_profile_deleted"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}