Set the field mappings of a template
Replaces every mapping of the template. Each one names a variable of variables and a contact field; a custom field must be the organization’s.
Scope: templates:write.
bearerAuthAuthorizationBearer <token>An organization API key, rky_live_…, created in Settings → API. Send it only from a server.
template_id*stringTemplate ID.
^[0-9]{1,32}$Idempotency-Key?stringOptional. A value you choose, unique per logical write, 8–200 characters: a UUID or an ID from your system such as order-10482-ready. Retrying with the same key and body replays the first response instead of repeating the write.
8 <= length <= 200application/json- body
The contact fields that fill the template’s variables when Ricky sends it.
mappings*array<>Every mapping of the template; the ones not sent are removed. Send [] to remove all.
items <= 100Success.
application/json- response
data*The contact fields that fill a template’s variables when Ricky sends it to a contact. They apply to the template’s name and language in its business account.
curl -X PUT 'https://getricky.ai/api/v1/templates/string/field-mappings' \ -H 'Idempotency-Key: order-10482-ready' \ -H 'Content-Type: application/json' \ -d '{ "mappings": [ { "component": "body", "key": "1", "source": { "kind": "native", "field": "first_name" } }, { "component": "body", "key": "2", "source": { "kind": "custom", "field_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d" } } ]}'{ "data": { "template_id": "1234567890123456", "variables": [ { "component": "body", "key": "1", "name": "{{1}}" } ], "mappings": [ { "component": "body", "key": "1", "source": { "kind": "native", "field": "first_name" } } ] }}