Skip to content

Write per-contact campaign variables (`{{ vars.nombre }}`), up to 500 contacts and 5,000 values per call

POST
/v1/campaigns/{campaign}/personalization
curl --request POST \
--url https://api.replifier.com/v1/campaigns/cmp_01hx0000000000000000000000/personalization \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "entries": [ { "contactId": "example", "email": "example", "vars": { "additionalProperty": "example" } } ] }'

Each entry has contactId or email and vars: name (lowercase letters, digits and _, up to 40) → text of up to 2,000 characters, or null to remove it. Draft campaigns only. The text is PLAIN: it is escaped at compile time (never HTML) and does not allow {{ or }}. A contact that does not belong to the brand is rejected as contact_not_found. In the email use {{ vars.nombre | respaldo: "texto" }}: when there is no value, the fallback is rendered. Each value stores its source and the write is recorded in the audit log.

campaign
required
string
/^cmp_[a-z0-9]{26}$/

Example

cmp_01hx0000000000000000000000
Media typeapplication/json
object
entries
required
Array<object>
>= 1 items <= 500 items
object
contactId
string
/^con_[a-z0-9]{26}$/
email
string
<= 254 characters
vars
required
object
key
additional properties
string
nullable <= 2000 characters /^[^\x00-\x08\x0b\x0c\x0e-\x1f\x7f]*$/

Example generated

{
"entries": [
{
"contactId": "example",
"email": "example",
"vars": {
"additionalProperty": "example"
}
}
]
}

Result

Media typeapplication/json
object
contacts
required
number
written
required
number
removed
required
number
names
required
Array<string>
rejected
required
Array<object>
object
index
required
integer
reason
required
string
Allowed values: contact_not_found
batchId
required
string

Example

{
"rejected": [
{
"reason": "contact_not_found"
}
]
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

No session, expired session, or invalid, expired or revoked API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Does not exist or is not visible to you

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Conflict

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}