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

# Getting started

> Quick start guide for integrating with the FirstQuadrant API

The FirstQuadrant API provides programmatic access to all the features of the FirstQuadrant CRM platform. This guide will help you get started with making your first API call.

## Base URL

All API requests should be made to:

```
https://api.us.firstquadrant.ai/v5
```

## Authentication

Before making any API requests, you'll need to authenticate. FirstQuadrant supports two authentication methods:

1. **API Keys** - Best for server-to-server integrations
2. **Access Tokens** - For user-specific actions

See the [Authentication](/api-reference/authentication) guide for detailed instructions on obtaining and using credentials.

## Making your first request

Here's a simple example to test your authentication and get your user profile:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.us.firstquadrant.ai/v5/me \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "FirstQuadrant-Organization-ID: org_YOUR_ORG_ID"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.us.firstquadrant.ai/v5/me", {
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "FirstQuadrant-Organization-ID": "org_YOUR_ORG_ID",
    },
  });

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

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

  response = requests.get(
      'https://api.us.firstquadrant.ai/v5/me',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'FirstQuadrant-Organization-ID': 'org_YOUR_ORG_ID'
      }
  )

  user = response.json()
  print(user)
  ```

  ```typescript TypeScript theme={null}
  interface User {
    id: string;
    email: string;
    name: string;
    organizations: Array<{
      id: string;
      name: string;
      role: string;
    }>;
  }

  const response = await fetch("https://api.us.firstquadrant.ai/v5/me", {
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "FirstQuadrant-Organization-ID": "org_YOUR_ORG_ID",
    },
  });

  const user: User = await response.json();
  ```
</CodeGroup>

## Response format

All successful API responses return JSON data. The response will vary based on the endpoint, but typically follows these patterns:

### Single resource

```json theme={null}
{
  "id": "con_abc123",
  "email": "john@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
```

### Resource collection

```json theme={null}
[
  {
    "id": "con_abc123",
    "email": "john@example.com",
    "firstName": "John",
    "lastName": "Doe"
  },
  {
    "id": "con_def456",
    "email": "jane@example.com",
    "firstName": "Jane",
    "lastName": "Smith"
  }
]
```

## Common headers

### Request headers

| Header                          | Required | Description                                    |
| ------------------------------- | -------- | ---------------------------------------------- |
| `Authorization`                 | Yes      | Bearer token or API key                        |
| `FirstQuadrant-Organization-ID` | Yes\*    | Organization context (required for API keys)   |
| `Content-Type`                  | Yes\*\*  | `application/json` for POST/PUT/PATCH requests |

\*Required when using API keys, optional for access tokens
\*\*Required when sending request body

### Response headers

| Header         | Description                       |
| -------------- | --------------------------------- |
| `X-Request-Id` | Unique identifier for the request |
| `Version`      | API version information           |
| `ETag`         | Entity tag for caching            |

## Next steps

Now that you've made your first API call, explore these topics:

* [Error Handling](/api-reference/errors) - Learn how to handle API errors
* [Pagination](/api-reference/pagination) - Work with large datasets
* [Filtering](/api-reference/filtering) - Query and filter resources
* [Best Practices](/api-reference/best-practices) - Tips for efficient API usage

## API explorer

You can explore all available endpoints and test them interactively using our API documentation:

* **OpenAPI Specification**: [https://api.us.firstquadrant.ai/v5/docs](https://api.us.firstquadrant.ai/v5/docs)
* **Swagger UI**: [https://api.us.firstquadrant.ai/v5/swagger](https://api.us.firstquadrant.ai/v5/swagger)

## Support

If you have questions or need help with the API:

* Check our [API Reference](/api-reference) for detailed endpoint documentation
* Review [Best Practices](/api-reference/best-practices) for common patterns
* Contact support at [support@firstquadrant.ai](mailto:support@firstquadrant.ai)
