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

# API overview

> Query your organization's CRM and automation data through the Bevits API.

The Bevits public API allows integrations and AI agents to query an
organization's data. The first version is **read-only** and uses an API key
linked to the organization.

<Info>
  **Base URL:** `https://api.bevits.com/v1`
</Info>

## Make your first request

<Steps>
  <Step title="Create an API key">
    Go to [Settings → Advanced → API Keys](https://app.bevits.com/settings/api-keys),
    create a key with read access, and copy the secret. It is displayed only
    once.
  </Step>

  <Step title="Store the key in an environment variable">
    ```bash theme={null}
    export BEVITS_API_KEY="bvt_live_..."
    ```
  </Step>

  <Step title="Query the connection identity">
    ```bash theme={null}
    curl --request GET \
      --url https://api.bevits.com/v1/me \
      --header "Authorization: Bearer $BEVITS_API_KEY"
    ```

    ```json theme={null}
    {
      "object": "identity",
      "organization": {
        "id": "org_ckxyz123",
        "name": "My store"
      },
      "api_key": {
        "id": "bak_ckkey123",
        "name": "Integration",
        "scopes": ["read"]
      },
      "livemode": true
    }
    ```
  </Step>
</Steps>

## Available resources

<CardGroup cols={2}>
  <Card title="Customers" icon="users" href="/en/api-reference/overview#customers-and-purchases">
    Search customers, contact data, tags, attributes, metrics, and purchases.
  </Card>

  <Card title="Segments" icon="filter" href="/en/api-reference/overview#customers-and-purchases">
    List segments and query their customers.
  </Card>

  <Card title="Automations" icon="diagram-project" href="/en/api-reference/overview#marketing-and-automation">
    Query flows and their execution summaries.
  </Card>

  <Card title="Campaigns" icon="envelope" href="/en/api-reference/overview#marketing-and-automation">
    Query email campaigns and aggregate metrics.
  </Card>
</CardGroup>

### Customers and purchases

| Resource            | Main endpoints                                          |
| ------------------- | ------------------------------------------------------- |
| Customers           | `GET /customers`, `GET /customers/{customer_id}`        |
| Customer purchases  | `GET /customers/{customer_id}/purchases`                |
| Segments            | `GET /segments`, `GET /segments/{segment_id}/customers` |
| Purchases           | `GET /purchases`, `GET /purchases/{purchase_id}`        |
| Tags and attributes | `GET /tags`, `GET /attributes`                          |

### Marketing and automation

| Resource        | Main endpoints                                                     |
| --------------- | ------------------------------------------------------------------ |
| Flows           | `GET /flows`, `GET /flows/{flow_id}`                               |
| Email campaigns | `GET /email-campaigns`, `GET /email-campaigns/{email_campaign_id}` |

<Note>
  The API key automatically determines the organization. Do not send an
  organization ID in this version's routes.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/en/api-reference/authentication">
    Create, store, and revoke credentials securely.
  </Card>

  <Card title="Pagination and errors" icon="code" href="/en/api-reference/fundamentals">
    Understand cursors, IDs, limits, and error responses.
  </Card>

  <Card title="AI agents" icon="sparkles" href="/en/api-reference/ai-agents">
    Use the API with Leme, Claude Code, Codex, and other agents.
  </Card>
</CardGroup>
