Partner Workflows
Default templates
Create a default published template for a customer team.
Approved partner onboarding flows can create a default published template for a customer team after provisioning that team.
POST https://platform.scribeless.co/api/templates
Use the customer-team API key returned by POST /api/partner/teams, not the partner account API key.
If you omit pages, Scribeless creates a default published template for the selected product.
Headers
Content-Type: application/json
X-API-Key: CUSTOMER_TEAM_API_KEY
Request body
| Field | Type | Description |
|---|---|---|
name | string | Optional template name. Defaults to Untitled Template. |
product_id | string | Product ID for the mail format. |
pages | array | Optional advanced template page data. Omit this for a default published template. |
Example request
curl --request POST 'https://platform.scribeless.co/api/templates' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: CUSTOMER_TEAM_API_KEY' \
--data '{
"name": "API postcard template",
"product_id": "PRODUCT_ID"
}'
Response
Successful requests return the created active template and its published version.
{
"id": "TEMPLATE_ID",
"name": "API postcard template",
"status": "active",
"team_id": "TEAM_ID",
"version": {
"id": "TEMPLATE_VERSION_ID",
"version_number": 1,
"status": "published",
"product": {
"id": "PRODUCT_ID",
"name": "A6 postcard",
"category": "postcard",
"subcategory": "postcard"
},
"pages": [
{
"count": 1
}
]
}
}
Notes
- This workflow is intended for approved partner onboarding flows.
- Use
GET /api/templatesto list templates that are available to the customer-team API key. - Use the returned template and product IDs when creating a campaign.
Status codes
| Status | Meaning |
|---|---|
200 | Template created. |
400 | Missing or invalid product/template data. |
401 | Missing, malformed, invalid, or unauthorized API key. |
500 | Template could not be created. Retry or contact support if it persists. |