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

# Authentication

To interact with the Salesbricks API, include the `X-SALESBRICKS-KEY` attribute in your request headers. The value for this attribute should be your unique **Public API Token**.

Obtain your Public API Token conveniently under **Settings** -> **Integrations** -> **Public API**.

<Card title="Take me there" icon="rocket-launch" href="https://app.salesbricks.com/admin/settings/integrations/public-api">
  [https://app.salesbricks.com/admin/settings/integrations/public-api](https://app.salesbricks.com/admin/settings/integrations/public-api)
</Card>

## Example

```bash cURL theme={null}
curl https://api.salesbricks.com/api/v2/customers \
  -H "X-SALESBRICKS-KEY: <your-api-key>"
```

## Endpoint URLs

### REST API Endpoint

The REST API is the recommended endpoint for integrations, and covers customers, subscriptions, invoices, plans, payment methods, and usage.

| Environment | Base URL |
| - | - |
| Production | `https://api.salesbricks.com/api/v2` |
| Staging | `https://api.staging.salesbricks.com/api/v2` |

### Usage API Endpoint

`https://api.salesbricks.com/api/v2/usage`

### GraphQL API Endpoint

`https://api.salesbricks.com/api/v1/graphql`

<Note>
  The [GraphQL API](/api-reference/getting-started/graphql) remains supported for existing
  integrations. New functionality is added to the REST API.
</Note>

The same Public API Token authenticates all three endpoints.


## Related topics

- [REST API Overview](/api-reference/getting-started/overview.md)
- [Custom email domain](/settings/notifications/custom-email-domain.md)
- [Overview](/api-reference/usage/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.