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

# User

> Retrieve authenticated user profile and account information

The User API provides access to the authenticated user's profile data, including personal account details, white-label configuration, and branding assets.

## Get user data

Retrieve the complete profile of the authenticated user.

```bash theme={null}
GET /api/v1/user
```

This endpoint returns comprehensive user information including:

* Personal account details (email, name, permissions)
* White-label configuration (logos, icons, custom domains)
* S3 pre-signed URLs for branding assets
* Account status and subscription information

### Authentication

This endpoint requires [API key authentication](/api/authentication). The API key must have user access management permissions enabled.

### Request

No request body is required. Authentication is provided via the `Authorization` header.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://app.iqra.bot/api/v1/user \
    -H "Authorization: Token YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.iqra.bot/api/v1/user', {
    method: 'GET',
    headers: {
      'Authorization': 'Token YOUR_API_KEY'
    }
  });

  const userData = await response.json();
  console.log(userData);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://app.iqra.bot/api/v1/user',
      headers={
          'Authorization': 'Token YOUR_API_KEY'
      }
  )

  user_data = response.json()
  print(user_data)
  ```
</CodeGroup>

### Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded
</ResponseField>

<ResponseField name="data" type="object">
  User data object

  <Expandable title="User data structure">
    <ResponseField name="id" type="string">
      Unique user identifier
    </ResponseField>

    <ResponseField name="email" type="string">
      User's email address
    </ResponseField>

    <ResponseField name="name" type="string">
      User's display name
    </ResponseField>

    <ResponseField name="isDisabled" type="boolean">
      Whether the account is disabled
    </ResponseField>

    <ResponseField name="permissions" type="object">
      User permission flags
    </ResponseField>

    <ResponseField name="whiteLabel" type="object">
      White-label configuration for branding

      <Expandable title="White-label properties">
        <ResponseField name="customDomain" type="string">
          Custom domain for branded dashboard
        </ResponseField>

        <ResponseField name="logoUrl" type="string">
          Pre-signed URL for the logo image
        </ResponseField>

        <ResponseField name="iconUrl" type="string">
          Pre-signed URL for the favicon
        </ResponseField>

        <ResponseField name="brandColor" type="string">
          Primary brand color (hex format)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="subscription" type="object">
      Subscription and billing information

      <Expandable title="Subscription properties">
        <ResponseField name="plan" type="string">
          Current subscription plan
        </ResponseField>

        <ResponseField name="status" type="string">
          Subscription status: `active`, `trialing`, `past_due`, `canceled`
        </ResponseField>

        <ResponseField name="currentPeriodEnd" type="string">
          End of current billing period (ISO 8601)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Account creation timestamp (ISO 8601)
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Last update timestamp (ISO 8601)
    </ResponseField>
  </Expandable>
</ResponseField>

**Example response:**

```json theme={null}
{
  "success": true,
  "data": {
    "id": "user_abc123",
    "email": "user@example.com",
    "name": "John Doe",
    "isDisabled": false,
    "permissions": {
      "canCreateBusinesses": true,
      "canManageApiKeys": true
    },
    "whiteLabel": {
      "customDomain": "voice.mycompany.com",
      "logoUrl": "https://s3.amazonaws.com/...",
      "iconUrl": "https://s3.amazonaws.com/...",
      "brandColor": "#2563EB"
    },
    "subscription": {
      "plan": "professional",
      "status": "active",
      "currentPeriodEnd": "2026-04-01T00:00:00Z"
    },
    "createdAt": "2025-01-15T10:30:00Z",
    "updatedAt": "2026-03-01T14:20:00Z"
  }
}
```

## Use cases

<CardGroup cols={2}>
  <Card title="Profile display" icon="user">
    Show user profile information in your application
  </Card>

  <Card title="White-label branding" icon="palette">
    Apply custom branding from user's white-label configuration
  </Card>

  <Card title="Permission checks" icon="shield-check">
    Verify user permissions before allowing actions
  </Card>

  <Card title="Account status" icon="circle-info">
    Display subscription status and account health
  </Card>
</CardGroup>

## Error codes

| Code                | Description                                      |
| ------------------- | ------------------------------------------------ |
| `INVALID_API_KEY`   | The API key is invalid or expired                |
| `USER_DISABLED`     | The user account has been disabled               |
| `PERMISSION_DENIED` | API key lacks user access management permissions |

## Notes

<Note>
  All responses return HTTP 200. Check the `success` field in the response body to determine if the operation actually succeeded.
</Note>

<Warning>
  S3 pre-signed URLs for branding assets expire after a set period (typically 1 hour). Cache the URLs but be prepared to refresh them when they expire.
</Warning>

<Tip>
  This endpoint is only available in self-hosted deployments. The Iqra Cloud platform manages user data through the dashboard interface.
</Tip>

## Related endpoints

* [User Usage API](/api/usage) - Retrieve usage metrics and billing history
* [Authentication](/api/authentication) - API key management
* [Businesses API](/api/businesses) - Manage business accounts
