> ## 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 ID

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

#### Recipes

<AccordionGroup>
  <Accordion title="Delete user by 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/36.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/36.json
        ```
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

#### Path Parameters

<ParamField path="user_id" type="integer" required> ID of the user. Generated automatically by the server after user creation.</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="400">
    An error response

    <ResponseField name="code" type="string" />

    <ResponseField name="message" type="string" />
  </Accordion>

  <Accordion title="403">
    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

    <ResponseField name="code" type="string" />

    <ResponseField name="message" type="string" />
  </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/36.json
  ```
</RequestExample>

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

  ```json 400 theme={null}
  {
    "code": null,
    "message": "No data was provided"
  }
  ```

  ```json 403 theme={null}
  {
    "errors": {
      "base": [
        "You are not owner of this object"
      ]
    }
  }
  ```

  ```json 404 theme={null}
  {
    "code": null,
    "message": "Couldn't find user"
  }
  ```

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