# API and MCP for AI agents | GTM and Outreach

Source: https://exntra.in/api

# Cold email your code and AI agents can run

Everything you can do in the app, you can do through the API: connect mailboxes, import contacts, launch campaigns, send single emails and answer replies. Or let your AI agent do it through our MCP server.

[Quick start](/api/quickstart)[Connect an AI agent](/api/mcp)

 

```
curl -X POST https://api.yourdomain.com/v1/emails \
  -H "Authorization: Bearer gtm_..." \
  -H "Idempotency-Key: intro-ana-2026-11-02" \
  -H "content-type: application/json" \
  -d '{
    "to": "ana@startup.io",
    "subject": "Quick question, {{first_name|there}}",
    "body": "Hi Ana,\n\nSaw you are hiring SDRs...",
    "variables": { "first_name": "Ana" }
  }'

# 201 {"id":"...","status":"sent","from":"sam@acme.com","sentToday":12}
```

```
const res = await fetch("https://api.yourdomain.com/v1/emails", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.GTM_KEY,
    "Idempotency-Key": "intro-ana-2026-11-02",
    "content-type": "application/json",
  },
  body: JSON.stringify({
    to: "ana@startup.io",
    subject: "Quick question, {{first_name|there}}",
    body: "Hi Ana,\n\nSaw you are hiring SDRs...",
  }),
});
const email = await res.json(); // { id, status: "sent", from, sentToday }
```

```
import os, requests

r = requests.post(
    "https://api.yourdomain.com/v1/emails",
    headers={
        "Authorization": f"Bearer {os.environ['GTM_KEY']}",
        "Idempotency-Key": "intro-ana-2026-11-02",
    },
    json={
        "to": "ana@startup.io",
        "subject": "Quick question, {{first_name|there}}",
        "body": "Hi Ana,\n\nSaw you are hiring SDRs...",
    },
)
print(r.json())  # {'id': ..., 'status': 'sent', ...}
```

## The whole product, as an API

REST over HTTPS. JSON in, JSON out. Clear error messages a person or an agent can act on.

### Mailboxes

Connect SMTP/IMAP or Microsoft mailboxes, set limits, check DNS, send tests.

-   `GET /mailboxes`
-   `POST /mailboxes/smtp`
-   `PATCH /mailboxes/:id`
-   `POST /mailboxes/:id/check-dns`

### Contacts

Import rows, files or Google Sheets, search, and manage the blocklist.

-   `POST /contacts/import`
-   `GET /contacts`
-   `POST /blocklist`

### Campaigns

Create, check, preview, test, launch, pause and edit sequences.

-   `POST /campaigns`
-   `GET /campaigns/:id/check`
-   `POST /campaigns/:id/test`
-   `POST /campaigns/:id/launch`

### Single emails

Send one email from a mailbox, with tracking and idempotency.

-   `POST /emails`
-   `GET /emails/:id`

### Inbox

Read conversations, reply in the thread, label, snooze and save drafts.

-   `GET /inbox`
-   `POST /inbox/:id/reply`
-   `PATCH /inbox/:id`

### Account

Workspaces, team, limits, webhooks and API keys.

-   `GET /limits`
-   `POST /webhooks`
-   `POST /api-keys`

## Safe for automation by design

-   **Scoped keys**Full access, or only campaigns, contacts, inbox, mailboxes, sending or read-only. One workspace or the whole account.
-   **Rate limits you can see**300 requests a minute per key and 1,200 per account, with headers on every response and `Retry-After` on 429.
-   **Safe retries**Send an `Idempotency-Key` and a repeated request returns the first result instead of sending twice.
-   **Same rules as the app**Blocklist, bounce limits, slow start and daily caps apply to every API call. Check them any time with `GET /limits`.

*[Screenshot: Settings, API and MCP: API keys with scopes, webhooks and the MCP address]*

## Webhooks for everything that happens

Get a signed POST the moment something happens. Verify it with the HMAC-SHA256 signature in `X-GTM-Signature`. Failed deliveries retry with backoff.

-   `email.sent`
-   `email.opened`
-   `email.clicked`
-   `email.replied`
-   `email.bounced`
-   `contact.unsubscribed`
-   `lead.labelled`
-   `campaign.paused`
-   `campaign.completed`
-   `mailbox.disconnected`
-   `mailbox.paused`
-   `account.sending_held`

## Docs for people and for machines

### Quick start

From a key to a running campaign in four requests.

[Open the quick start](/api/quickstart)

### Full reference

Every endpoint, field and limit, served by your API at `/v1/docs`.

### For AI assistants

The same reference as plain text at `/llms.txt` on the API, so any model can read it.

## Get your API key today

Start your free month, open Settings, then API & MCP, and create a key. The API is included in the one plan.

[Start your free month](https://app.example.com/#/signup)[Talk to us](/contact)
