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

# Authentication

> How to authenticate requests to the Pocketflows API

All API endpoints are authenticated using Basic HTTP authentication. Pass your `project_id` as the
username and `secret_key` as the password, and send JSON:

```
Authorization: Basic base64(project_id:secret_key)
Content-Type: application/json
```

The API is served from `https://api.pocketflows.com`. Paths in these docs, such as
`POST /sync/businesses`, are relative to that URL.

Keep your secret key on your servers. Never send it to a browser or a mobile app: to show
Pocketflows to a business, [render an embed](https://docs.pocketflows.com/how-to/render-an-embed.md) instead.

## API keys

Find your `project_id` and `secret_key` in the
[API Keys tab](https://dashboard.pocketflows.com/api_keys) of
[your dashboard](https://dashboard.pocketflows.com). If you don't have credentials yet, reach out to
us at [team@pocketflows.com](mailto:team@pocketflows.com).

If the credentials are missing or wrong, the API returns `401` with an empty body.

## Test and live mode

Your account has two projects, one for test mode and one for live mode, each with its own businesses,
customers and templates. The secret key decides which one a request uses: keys that start with
`sk_test` use test mode, and keys that start with `sk_live` use live mode. Your `project_id` is the
same for both.

To see test-mode data in the dashboard, turn on the "Test Mode" toggle at the top right corner.

> [!WARNING]
>
> Test mode keeps your data separate, but it still delivers real email and SMS messages. Use your
> own addresses and phone numbers when you test.


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