/v1/communication-templates/{template_id}Authentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request PATCH \
--url 'https://api.staging.facily.ai/v1/communication-templates/<TEMPLATE_ID>' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"body": "string",
"default_key": "string",
"document_type": "string",
"is_active": false,
"layout_id": "00000000-0000-4000-8000-000000000001",
"merge_fields": [
"string"
],
"name": "string",
"subject": "string",
"trigger_key": "string"
}'Parameters
template_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
bodystring | nullMin length: 1
Show body schema
string | nullVariant 1: string
stringVariant 2: null
nulldefault_keystring | nullShow default_key schema
string | nullVariant 1: string
stringVariant 2: null
nulldocument_typestring | nullMax length: 50
Show document_type schema
string | nullVariant 1: string
stringVariant 2: null
nullis_activeboolean | nullShow is_active schema
boolean | nullVariant 1: boolean
booleanVariant 2: null
nulllayout_idstring | nullFormat: uuid
Show layout_id schema
string | nullVariant 1: string
stringVariant 2: null
nullmerge_fieldsstring[] | nullShow merge_fields schema
string[] | nullVariant 1: string[]
string[]Variant 2: null
nullnamestring | nullMin length: 1 · Max length: 100
Show name schema
string | nullVariant 1: string
stringVariant 2: null
nullsubjectstring | nullMax length: 255
Show subject schema
string | nullVariant 1: string
stringVariant 2: null
nulltrigger_keystring | nullShow trigger_key schema
string | nullVariant 1: string
stringVariant 2: null
nullResponses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"body": "string",
"created_at": "2026-10-29T12:00:00Z",
"id": "00000000-0000-4000-8000-000000000001",
"is_active": false,
"kind": "string",
"name": "string",
"source": "facility",
"updated_at": "2026-10-29T12:00:00Z",
"version": 0,
"default_key": "string",
"document_type": "string",
"facility_id": "00000000-0000-4000-8000-000000000001"
},
"meta": {
"request_id": "string"
}
}application/json
dataTemplateResponserequiredOne saved template row, full detail including its body. Returned by the create/get/update/delete routes -- never by the list routes, which return `TemplateListItemResponse` instead.
Show data schema
bodystringrequiredcreated_atstringrequiredFormat: date-time
default_keystring | nullShow default_key schema
string | nullVariant 1: string
stringVariant 2: null
nulldocument_typestring | nullShow document_type schema
string | nullVariant 1: string
stringVariant 2: null
nullfacility_idstring | nullFormat: uuid
Show facility_id schema
string | nullVariant 1: string
stringVariant 2: null
nullidstringrequiredFormat: uuid
is_activebooleanrequiredkindstringrequiredlayout_idstring | nullFormat: uuid
Show layout_id schema
string | nullVariant 1: string
stringVariant 2: null
nullmerge_fieldsstring[]Show merge_fields schema
stringnamestringrequiredsourcestringrequiredValues: "facility", "org"
subjectstring | nullShow subject schema
string | nullVariant 1: string
stringVariant 2: null
nulltrigger_keystring | nullShow trigger_key schema
string | nullVariant 1: string
stringVariant 2: null
nullupdated_atstringrequiredFormat: date-time
versionintegerrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired