Endpoints
Create Pod
POST
/v1/pods/newCreates a new Pod from a specified template, optionally linked to a CRM record. Requires the CreatePod scope.
Authentication
This endpoint requires a valid API key with the CreatePod scope. Pass it via the Authorization header:
Authorization: Bearer trpt_a1b2c3_your_key_hereParameters
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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. |
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 like 69f0bafc4cc54b506b0355d8. |
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. |
💡
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.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 | contactsdealscompanies |
salesforce | LeadOpportunityAccountContact |
activecampaign | contactsdealscompanies |
msdynamics | contactsdealscompanies |
sugarcrm | contactsdealscompanies |
brevo | dealscompanies |
pipedrive | dealscontacts |
Example Request
cURL (with CRM record)
curl -X POST https://trumpet.app/api/v1/pods/new \
-H "Authorization: Bearer trpt_a1b2c3_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"crm_type": "hubspot",
"crm_object": "deals",
"crm_id": "12345",
"template_id": "tpl_abc123",
"owner_email": "alice@yourcompany.com"
}'cURL (template only, no CRM)
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": "tpl_abc123",
"owner_email": "alice@yourcompany.com"
}'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({
crm_type: "hubspot",
crm_object: "deals",
crm_id: "12345",
template_id: "tpl_abc123",
owner_email: "alice@yourcompany.com",
}),
});
const { success, data } = await response.json();Python
import os, 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={
"crm_type": "hubspot",
"crm_object": "deals",
"crm_id": "12345",
"template_id": "tpl_abc123",
"owner_email": "alice@yourcompany.com",
},
)
data = response.json()Success Response
Returns 200 OK with the created Pod data:
200 OK
{
"success": true,
"data": {
"id": "69f0bafc4cc54b506b0355d8",
"edit_url": "https://trumpet.app/pods/edit/69f0bafc4cc54b506b0355d8",
"live_url": "https://trumpet.app/pods/69f0bafc4cc54b506b0355d8/live"
}
}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 | CRM record not found | The crm_id doesn't match any record of the specified crm_object type in the CRM. |
💡
Finding your template ID
Open any template in the trumpet dashboard and check the URL — the template ID is the last like 69f0bafc4cc54b506b0355d8.