# Create Pod (/api/create-pod)

**POST** `/v1/pods/new`

Creates a new Pod from a specified template, optionally linked to a CRM record.

<Callout type="info" title="Authentication">
Requires the `CreatePod` scope. Pass your API key in the `Authorization` header. See [Authentication](/api/authentication).
</Callout>

## Body parameters [#body-parameters]

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `template_id` | string | **Required** | The ID of the trumpet template to use for the Pod. You can find this in the URL of the Template, e.g. `69f0bafc4cc54b506b0355d8`. |
| `crm_type` | string | Optional | The CRM provider. One of: `hubspot`, `salesforce`, `activecampaign`, `msdynamics`, `sugarcrm`, `brevo`, `pipedrive`. Required if `crm_id` or `crm_object` is provided. |
| `crm_object` | string | Optional | The CRM object type to create the Pod from. Valid values depend on the `crm_type` — see the table below. Required if `crm_id` or `crm_type` is provided. |
| `crm_id` | string | Optional | The unique identifier of the record in your CRM. Required if `crm_type` or `crm_object` is provided. |
| `owner_email` | string | Optional | Email address of the user who should own the Pod. Must be a member of your brand. Defaults to the user who created the API key. |
| `pod_type` | string | Optional | One of: `content` (default sales Pod), `customer` (Customer Success Pod), `enablement` (internal Enablement Pod). Defaults to `content` when omitted. CRM linking and customer account resolution are skipped for `enablement` Pods. |

<Callout type="info" title="CRM fields are optional as a group">
`crm_type`, `crm_object`, and `crm_id` can be omitted entirely to create a Pod from the template alone. If any one of them is provided, all three are required and validated, and the Pod is linked to the CRM record. To link a CRM record later, use [Update Pod](/api/update-pod).
</Callout>

## Valid CRM objects by type [#valid-crm-objects-by-type]

When CRM fields are provided, the `crm_object` value must be valid for the given `crm_type`. Note that Salesforce uses PascalCase object names while other CRMs use lowercase.

| CRM Type | Valid Objects |
|----------|---------------|
| `hubspot` | `contacts`, `deals`, `companies` |
| `salesforce` | `Lead`, `Opportunity`, `Account`, `Contact` |
| `activecampaign` | `contacts`, `deals`, `companies` |
| `msdynamics` | `contacts`, `deals`, `companies` |
| `sugarcrm` | `contacts`, `deals`, `companies` |
| `brevo` | `deals`, `companies` |
| `pipedrive` | `deals`, `contacts` |

## Example requests [#example-requests]

### Template only [#template-only]

<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",
    "owner_email": "alice@yourcompany.com"
  }'
```
</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",
    owner_email: "alice@yourcompany.com",
  }),
});

const { success, 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",
        "owner_email": "alice@yourcompany.com",
    },
)

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

### With CRM record [#with-crm-record]

<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",
    "crm_type": "hubspot",
    "crm_object": "deals",
    "crm_id": "12345",
    "owner_email": "alice@yourcompany.com"
  }'
```
</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",
    crm_type: "hubspot",
    crm_object: "deals",
    crm_id: "12345",
    owner_email: "alice@yourcompany.com",
  }),
});

const { success, 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",
        "crm_type": "hubspot",
        "crm_object": "deals",
        "crm_id": "12345",
        "owner_email": "alice@yourcompany.com",
    },
)

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

## Success response [#success-response]

Returns `200 OK` with the created Pod data:

```json
{
  "success": true,
  "data": {
    "id": "69f0bafc4cc54b506b0355d8",
    "edit_url": "https://trumpet.app/pods/69f0bafc4cc54b506b0355d8/edit",
    "live_url": "https://trumpet.app/p/69f0bafc4cc54b506b0355d8"
  }
}
```

## Error responses [#error-responses]

| Status | Error | Cause |
|--------|-------|-------|
| `400` | Validation error | Missing or invalid field. The error message specifies which field and what's wrong. |
| `400` | No `crm_type` integration found | The specified CRM isn't connected to the brand. Connect it in Settings → Integrations. |
| `401` | Invalid or revoked API key | The API key is missing, malformed, revoked, or deleted. |
| `403` | Insufficient permissions | The API key lacks the CreatePod scope. |
| `404` | Brand not found | The brand associated with the API key has been deleted. |
| `404` | User not found | The `owner_email` doesn't match any user in the brand, or the key creator no longer exists. |
| `404` | Template not found | No template with that `template_id` exists for your brand. |
| `404` | CRM record not found | The `crm_id` doesn't match any record of the specified `crm_object` type in the CRM. |
| `429` | Rate limit exceeded | More than 30 requests per minute for this key. Retry after a short delay. |

<Callout type="idea" title="Finding your template ID">
Open any template in the trumpet dashboard and check the URL — the template ID is the last segment, e.g. `69f0bafc4cc54b506b0355d8`.
</Callout>

## Related [#related]

<Cards>
<Card title="Getting Started" href="/api/getting-started">
Account setup, API keys, and your first request.
</Card>

<Card title="Update Pod" href="/api/update-pod">
Link a CRM record or change status after creation.
</Card>

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