> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quickblox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete User by External ID

> Delete a user by External User ID. A user can be deleted only by themselves or an account owner.

#### Recipes

<AccordionGroup>
  <Accordion title="Delete user by external id with API key">
    <Steps>
      <Step title="1. Use 'Authorization' header to pass API key">
        ```curl {2} theme={null}
        curl -X DELETE \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users/external/697.json
        ```
      </Step>

      <Step title="2. As a result, the API remove a user">
        ```curl theme={null}
        curl -X DELETE \
        -H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
        https://api.quickblox.com/users/external/697.json
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

#### Path Parameters

<ParamField body="external_user_id" type="integer"> ID of the user in the external system (<Tooltip tip="External User ID- a unique identifier of the user in the integrated external system; used for cross- referencing. For example, a user has an internal user ID within the QuickBlox system and external ID, provided by the integrated external (client) system. When an API call with reference to the user has to be submitted, the user can be referenced by either internal or external identifiers.">External User ID</Tooltip>). </ParamField>

#### Headers

<ParamField header="QB-Token" type="string" required> A user session token. See [Authentication](/reference/authentication) page to learn more about the session token. </ParamField>
<ParamField header="Authorization" type="string" required default="ApiKey {your_api_key}"> API key from Dashboard. Expected format: `ApiKey {your_api_key}`. Must be used either QB-Token or Authorization.</ParamField>

#### Responses

<AccordionGroup>
  <Accordion title="200">
    A successful response
  </Accordion>

  <Accordion title="401">
    An error response

    <ResponseField name="errors" type="object">
      <Expandable title="properties">
        <ResponseField name="base" type="array of strings" />
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="404">
    An error response
  </Accordion>

  <Accordion title="422">
    An error response

    <ResponseField name="errors" type="object">
      <Expandable title="properties">
        <ResponseField name="id" type="array of strings" />
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE \
  -H "QB-Token: b284ddf44f5369611fe14e0e588f1cfa855116c8" \
  https://api.quickblox.com/users/external/697.json
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  Empty body
  ```

  ```json 401 theme={null}
  {
    "errors": {
      "base": [
        "You are not allowed to modify this user"
      ]
    }
  }
  ```

  ```json 404 theme={null}
  null
  ```

  ```json 422 theme={null}
  {
    "errors": {
      "id": [
        "should be a positive integer"
      ]
    }
  }
  ```
</ResponseExample>
