OrgEmail templates

Add an email template

Create a new example email for the org's template library. `org_id` and `created_by` are always taken from the session, never the request body.

POST
/org/email-templates

Create a new example email for the org's template library. org_id and created_by are always taken from the session, never the request body.

AuthorizationBearer <token>

API key (sk_live_... prefix). Generate keys in the UI under Settings > API Keys, then send it as Authorization: Bearer sk_live_...

In: header

Request Body

application/json

name*string

Template display name

Length1 <= length <= 255
when_to_use*string

Guidance for when to auto-pick this template

Length1 <= length
example_subject*string

Example email subject the AI mimics

Length1 <= length
example_body*string

Example email body the AI mimics

Length1 <= length
instructions?|

Optional additional instruction rules

is_active?boolean

Whether this template is available for use (defaults to true)

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/org/email-templates" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "when_to_use": "string",    "example_subject": "string",    "example_body": "string"  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "org_id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "string",
    "when_to_use": "string",
    "example_subject": "string",
    "example_body": "string",
    "instructions": "string",
    "is_active": true,
    "created_by": "550e8400-e29b-41d4-a716-446655440000",
    "created_at": "string",
    "updated_at": "string",
    "usage_count": 0
  }
}
{
  "error": "string",
  "message": "string",
  "statusCode": -9007199254740991
}
{
  "error": "string",
  "message": "string",
  "statusCode": -9007199254740991
}
{
  "error": "module_required",
  "module": "string",
  "message": "string",
  "contact": "string"
}