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

# Get API Clients

> Retrieve all API clients in your organization

# Get API Clients

Retrieve a list of all API clients configured in your organization.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.weir.ai/org/clients' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'x-source: console'
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "data": {
      "clients": [
        {
          "clientId": "cli_123456789",
          "name": "Production API Client",
          "environment": "production",
          "credentials": {
            "clientId": "V2ndYYV7PMQVjqyTsk2QkokCv"
          },
          "createdAt": "2024-01-15T10:30:00Z",
          "lastUsed": "2024-01-22T14:20:00Z",
          "status": "active"
        }
      ]
    },
    "message": "Clients retrieved successfully",
    "status": "success"
  }
  ```
</ResponseExample>

## Response Fields

<ResponseField name="data.clients" type="array" required>
  Array of client objects.

  <Expandable title="Client Properties">
    <ResponseField name="clientId" type="string" required>
      Unique client identifier.
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Client name.
    </ResponseField>

    <ResponseField name="environment" type="string" required>
      Environment type.
    </ResponseField>

    <ResponseField name="credentials.clientId" type="string" required>
      Public client ID for authentication.
    </ResponseField>

    <ResponseField name="createdAt" type="timestamp" required>
      Creation timestamp.
    </ResponseField>

    <ResponseField name="lastUsed" type="timestamp">
      Last usage timestamp.
    </ResponseField>

    <ResponseField name="status" type="string" required>
      Client status (active, inactive, revoked).
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Secret keys are never returned in list responses for security. They are only shown once during creation.
</Note>

## Usage Examples

<CodeGroup>
  ```javascript JavaScript theme={null}
  const getClients = async (accessToken) => {
    const response = await fetch('https://api.weir.ai/org/clients', {
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'x-source': 'console'
      }
    });
    if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
    return await response.json();
  };
  ```

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

  def get_clients(access_token):
      response = requests.get(
          'https://api.weir.ai/org/clients',
          headers={
              'Authorization': f'Bearer {access_token}',
              'x-source': 'console'
          }
      )
      response.raise_for_status()
      return response.json()
  ```
</CodeGroup>
