Skip to content

Create or update a contact

PUT
/organizations/{organizationId}/contacts
curl --request PUT \
--url https://api.sendwing.app/api/organizations/example/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "email": "example", "externalId": "example", "firstName": "example", "lastName": "example", "status": "subscribed", "language": "example", "timeZone": "example", "country": "example", "birthday": "example", "notes": "example", "properties": { "additionalProperty": "example" }, "tags": [ "example" ], "mailingLists": [ "example" ], "source": "example" }'

Matches the contact by externalId when you send one, else by email, so it can also change a contact’s email. Fields you leave out keep their value, and null clears one. Unknown fields are refused.

tags are added by name: a name that isn’t a tag yet creates one, which needs the tag: create permission too. mailingLists subscribes the contact to lists by ID; lists it’s on stay as they are.

Consent is enforced: a contact who unsubscribed themselves can only be subscribed again by themselves, and asking for it is refused with a 409.

organizationId
required
string

The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.

Media typeapplication/json
object
email
required

Matched ignoring case

string
externalId
Any of:
string
>= 1 characters <= 255 characters
firstName
Any of:
string
<= 255 characters
lastName
Any of:
string
<= 255 characters
status

Whether to email the contact. New contacts start as subscribed. Only subscribe people who agreed to get email.

string
Allowed values: subscribed unsubscribed
language
Any of:
string
<= 35 characters
timeZone
Any of:
string
<= 64 characters
country

An ISO 3166-1 alpha-2 code, like DE

string | null
birthday

YYYY-MM-DD, or --MM-DD when you don’t know the year, like 1990-05-14 or --05-14

string | null
notes
Any of:
string
<= 10000 characters
properties

Custom property values, by property key. Each must match its property’s type, and null removes a value.

object
key
additional properties
Any of:
string
<= 2000 characters
tags

Tags to add, by name, ignoring case. The contact keeps the tags it has. A new name creates a tag, which also needs the tag: create permission.

Array<string>
<= 50 items
mailingLists

Mailing lists to subscribe the contact to, by ID. Lists it’s on stay as they are. The contact must be subscribed.

Array<string>
<= 50 items
source

Where the contact came from, like checkout or zapier. Kept only when the contact is created.

string
>= 1 characters <= 64 characters

Updated

Media typeapplication/json
object
id
required

Like con_…

string
email
required
string
externalId
required

The contact’s ID in your own system

string | null
firstName
required
string | null
lastName
required
string | null
status
required

Whether Sendwing emails the contact. pending waits for double opt-in; bounced and complained are set by delivery feedback and are never emailed again.

string
Allowed values: subscribed pending unsubscribed bounced complained
source
required

Where the contact came from, like api, import, form or zapier

string
language
required

A BCP 47 language tag, like en or pt-BR

string | null
timeZone
required

An IANA time zone, like Europe/Berlin

string | null
country
required

An ISO 3166-1 alpha-2 code, like DE

string | null
birthday
required

YYYY-MM-DD, or --MM-DD when the year isn’t known

string | null
notes
required
string | null
properties
required

Custom property values, by property key

object
key
additional properties
string | number | boolean | null
subscribedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
signupIp
required
string | null
optedInAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
optInIp
required
string | null
statusChangedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastSentAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastOpenedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastClickedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
tags
required
Array<object>
object
id
required
string
name
required
string
mailingLists
required
Array<object>
object
id
required
string
name
required
string
status
required
string
Allowed values: subscribed unsubscribed
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/

Example

{
"status": "subscribed",
"mailingLists": [
{
"status": "subscribed"
}
]
}

Created

Media typeapplication/json
object
id
required

Like con_…

string
email
required
string
externalId
required

The contact’s ID in your own system

string | null
firstName
required
string | null
lastName
required
string | null
status
required

Whether Sendwing emails the contact. pending waits for double opt-in; bounced and complained are set by delivery feedback and are never emailed again.

string
Allowed values: subscribed pending unsubscribed bounced complained
source
required

Where the contact came from, like api, import, form or zapier

string
language
required

A BCP 47 language tag, like en or pt-BR

string | null
timeZone
required

An IANA time zone, like Europe/Berlin

string | null
country
required

An ISO 3166-1 alpha-2 code, like DE

string | null
birthday
required

YYYY-MM-DD, or --MM-DD when the year isn’t known

string | null
notes
required
string | null
properties
required

Custom property values, by property key

object
key
additional properties
string | number | boolean | null
subscribedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
signupIp
required
string | null
optedInAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
optInIp
required
string | null
statusChangedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastSentAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastOpenedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lastClickedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
tags
required
Array<object>
object
id
required
string
name
required
string
mailingLists
required
Array<object>
object
id
required
string
name
required
string
status
required
string
Allowed values: subscribed unsubscribed
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/

Example

{
"status": "subscribed",
"mailingLists": [
{
"status": "subscribed"
}
]
}

The request isn’t valid; issues lists each problem

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The API key or access token is missing, invalid or expired

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The workspace’s plan doesn’t allow this, like more contacts than it includes

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The API key’s permissions, or the app’s scopes and the member’s role, don’t allow this

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Not found in this workspace

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Conflicts with the current state; error says how

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Too many requests; wait for the seconds in Retry-After

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}