# Getting Started (/api/getting-started)

The trumpet API lets you programmatically create Pods from a template, with an optional link to a CRM record. This guide walks you through creating an account, generating an API key, and making your first request.

<Callout type="info" title="Before you start">
You need an active brand with an **admin** role, an API key with the **CreatePod** scope, and a `template_id` from your trumpet dashboard (in the template URL).
</Callout>

<Steps>
<Step>
### Create a trumpet account [#create-a-trumpet-account]

If you don't already have one, sign up for an account at [trumpet.app](https://trumpet.app).
</Step>

<Step>
### Generate an API key [#generate-an-api-key]

Navigate to **Settings → API Keys** in your trumpet dashboard. Click **Create Key**, give it a descriptive name, and select the scopes you need.

<Callout type="error" title="Store your key securely">
Your API key is only shown once at creation. Copy it immediately and store it in a secrets manager or environment variable. You will not be able to retrieve it again.
</Callout>
</Step>

<Step>
### Create a Pod [#create-a-pod]

Send **POST** `/v1/pods/new` with your API key. The request body must include `template_id`. The CRM fields (`crm_type`, `crm_object`, `crm_id`) are optional — omit them to create a Pod from the template alone, as in the examples below.

<CodeBlockTabs defaultValue="curl">
<CodeBlockTabsList>
<CodeBlockTabsTrigger value="curl">
cURL
</CodeBlockTabsTrigger>

<CodeBlockTabsTrigger value="javascript">
JavaScript
</CodeBlockTabsTrigger>

<CodeBlockTabsTrigger value="python">
Python
</CodeBlockTabsTrigger>
</CodeBlockTabsList>

<CodeBlockTab value="curl">
```bash
curl -X POST https://trumpet.app/api/v1/pods/new \
  -H "Authorization: Bearer trpt_a1b2c3_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "69f0bafc4cc54b506b0355d8"
  }'
```
</CodeBlockTab>

<CodeBlockTab value="javascript">
```javascript
const response = await fetch("https://trumpet.app/api/v1/pods/new", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRUMPET_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    template_id: "69f0bafc4cc54b506b0355d8",
  }),
});

const data = await response.json();
```
</CodeBlockTab>

<CodeBlockTab value="python">
```python
import os
import requests

response = requests.post(
    "https://trumpet.app/api/v1/pods/new",
    headers={
        "Authorization": f"Bearer {os.environ['TRUMPET_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "template_id": "69f0bafc4cc54b506b0355d8",
    },
)

data = response.json()
```
</CodeBlockTab>
</CodeBlockTabs>

<Callout type="idea" title="Optional: link a CRM record">
If you want the Pod tied to a CRM record, include all three CRM fields in the same request. Your brand must have that CRM connected under **Settings → Integrations**. See [Create Pod](/api/create-pod) for valid combinations, or [Update Pod](/api/update-pod) to link a record after creation.
</Callout>
</Step>
</Steps>

## Base URL [#base-url]

All API requests are made to the following base URL:

```
https://trumpet.app/api/v1
```

## Rate Limits [#rate-limits]

The API is rate limited on a per-endpoint basis. If you exceed the limit, you'll receive a `429 Too Many Requests` response. The response headers include `X-RateLimit-Remaining` and `X-RateLimit-Reset` so you can pace your requests.

## Error Format [#error-format]

All errors return a consistent JSON shape:

```json
{
  "success": false,
  "error": "A human-readable description of what went wrong"
}
```

## Next steps [#next-steps]

Once you can create Pods via the API, explore authentication details, the full create endpoint, and real-time events.

<Cards>
<Card title="Authentication" href="/api/authentication">
Bearer tokens, scopes, and key management.
</Card>

<Card title="Create Pod" href="/api/create-pod">
Full request parameters and CRM object matrix.
</Card>

<Card title="Webhooks" href="/webhooks">
Real-time engagement events without polling.
</Card>

<Card title="Run workflow" href="/api/run-workflow">
Trigger automation beyond single Pod API calls.
</Card>
</Cards>