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

# Logout platform user

> Revoke API tokens for a platform user

This endpoint allows white label admins to revoke API tokens for one of their platform users, effectively logging them out.

<Note>
  This endpoint requires authentication as a **white label admin**. You can only logout users belonging to your platform.
</Note>

### Request Body

<ParamField body="user_id" type="integer">
  The ID of the user to logout. Required if `email` is not provided.
</ParamField>

<ParamField body="email" type="string">
  The email of the user to logout. Required if `user_id` is not provided.
</ParamField>

<ParamField body="token_id" type="integer">
  Optional. The specific token ID to revoke. If not provided, all tokens for the user will be revoked.
</ParamField>

### Response

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

<ResponseExample>
  ```json 200 Response theme={null}
  {
    "message": "User logged out successfully."
  }
  ```

  ```json 403 Not White Label Admin theme={null}
  {
    "error": "You are not a white label admin."
  }
  ```

  ```json 404 User Not Found theme={null}
  {
    "error": "User not found."
  }
  ```

  ```json 422 Validation Error theme={null}
  {
    "message": "Either user_id or email is required.",
    "errors": {
      "user_id": ["Either user_id or email is required."]
    }
  }
  ```
</ResponseExample>

### Example: Logout by Email (All Tokens)

```bash theme={null}
curl -X POST https://app.autocalls.ai/api/white-label/logout \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "platformuser@example.com"
  }'
```

### Example: Logout Specific Token

```bash theme={null}
curl -X POST https://app.autocalls.ai/api/white-label/logout \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123,
    "token_id": 45
  }'
```
