---
openapi: 3.0.3
info:
  title: Braze REST API – Remove dashboard user account
  description: |
    ## Prerequisites

    To use this endpoint, you'll need a SCIM token. You'll use your service origin as the `X-Request-Origin` header. For more information, refer to [Automated user provisioning]({{site.baseurl}}/scim/automated_user_provisioning).

    ## Rate limit

    This endpoint has a rate limit of 20,000 requests per day, per company. This rate limit is shared with the `/scim/v2/Users/` PUT, GET, and POST endpoints as documented in [API rate limits]({{site.baseurl}}/api/api_limits).
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
paths:
  /scim/v2/Users/{id}:
    delete:
      summary: Remove dashboard user account
      operationId: delete_scim_v2_users_id_delete_existing_dashboard_user
      parameters:
        - name: id
          in: path
          required: true
          description: The user's resource ID. This parameter is returned by the `POST` `/scim/v2/Users/` or `GET` `/scim/v2/Users?filter=userName eq "user@example.com"` methods.
          schema:
            type: string
          example: dfa245b7-24195aec-887bb3ad-602b3340
        - name: X-Request-Origin
          in: header
          required: true
          description: 'Your service origin, sent as `X-Request-Origin: YOUR-REQUEST-ORIGIN-HERE`. For more information, refer to [Automated user provisioning]({{site.baseurl}}/scim/automated_user_provisioning).'
          schema:
            type: string
          example: YOUR-REQUEST-ORIGIN-HERE
      responses:
        "204":
          description: |
            The request succeeded and the dashboard user account was deleted. No response body is returned. No action needed.

            When the user is permanently deleted, the endpoint returns `HTTP/1.1 204 No Content`.
        "404":
          description: |
            Not found. No user with this `id` exists in Braze. Confirm the user `id`, or find it with the [Search for existing dashboard users endpoint]({{site.baseurl}}/api/endpoints/scim/get_search_existing_dashboard_user/).

            If a developer with this ID doesn't exist in Braze, the endpoint responds with:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                user_not_found:
                  summary: User not found
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 404
                    detail: User resource (Braze Developer) not found
        "401":
          description: |
            Unauthorized. The SCIM bearer token is missing or invalid, the request origin isn't recognized, your IP isn't allowlisted, or SCIM isn't enabled. Send a valid SCIM bearer token from an allowlisted IP, and confirm SCIM provisioning is enabled. To enable SCIM, contact your Braze account manager.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_request_origin:
                  summary: The X-Request-Origin header is missing
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 401
                    detail: 'Unauthorized: X-Request-Origin header is missing.'
                invalid_token:
                  summary: The SCIM token isn't valid
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 401
                    detail: 'Unauthorized: token not valid.'
                ip_not_allowlisted:
                  summary: The request IP isn't allowlisted
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 401
                    detail: 'Unauthorized: Request IP is not in the configured IP allowlist.'
                scim_not_enabled:
                  summary: SCIM API access isn't enabled
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 401
                    detail: 'Unauthorized: SCIM API access is not enabled.'
        "429":
          description: |
            Rate limited. You exceeded the SCIM daily rate limit of 20,000 requests per day. Slow your request rate and retry later. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 429
                    detail: You have exceeded your limit of 20000 requests per day. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).

            If you attempt to delete the last remaining company user, or the user is being modified by another request, the endpoint returns a `500 Internal Server Error` response and doesn't delete the user:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                last_company_user:
                  summary: Last remaining company user
                  value:
                    schemas:
                    - urn:ietf:params:scim:api:messages:2.0:Error
                    status: 500
                    detail: Failed to delete user
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: SCIM token
      description: |
        SCIM endpoints authenticate with a SCIM token, not a REST API key. Generate the token in the
        Braze dashboard at **Settings → Company Settings → Admin Settings → SCIM Provisioning**.
        Pass the token as `Authorization: Bearer YOUR-SCIM-TOKEN-HERE`, and send your service
        origin in the `X-Request-Origin` header.
  schemas:
    ErrorResponse:
      title: Error
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: SCIM error message schema.
          example:
            - urn:ietf:params:scim:api:messages:2.0:Error
        status:
          type: integer
          description: The HTTP status code of the error.
          example: 404
        detail:
          type: string
          description: The error message describing why the request failed.
