> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.promo.ly/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Connect a bot or script with an API token

Some tools can't open a browser to sign in, like a bot running on a server, a scheduled script or an always-on agent. For those, create an API token in the dashboard and give it to the tool.

Connected agents are in an invite-only beta. See [Connect an AI coding agent](https://support.promo.ly/en/article/connect-an-ai-coding-agent-1udge2h/) for what an agent can and can't do.

## Create a token

1. Go to **Profile** in the dashboard and click **Manage connected apps**.
2. Under **API tokens**, name the token after the tool that will use it, then choose the account, the access and when it expires.
3. Click **Create token** and copy it. Promoly shows it only once.

A token can read campaigns. If you allow it, it can also save inactive drafts and read subscriber status. It can't send or schedule campaigns, and it can't change subscribers.

## Give the token to your tool

Point the tool at the Promoly server and send the token as a bearer token:

```text
https://api.promo.ly/mcp
Authorization: Bearer YOUR_TOKEN
```

Many agents take this as an MCP server entry with a `headers` section, for example:

```json
{
  "mcpServers": {
    "promoly": {
      "type": "http",
      "url": "https://api.promo.ly/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}
```

Keep the token in your tool's secret store or an environment variable, not in a file you share.

## When a token stops working

A token ends on the date you picked, when you revoke it, when you lose access to the account, or once nothing has used it for 30 days. Create a new one under **Manage connected apps**.

If you own the account, the list also shows the tokens your team members created, and you can revoke any of them.