Contacts
Add the people you write to, find them, change them, and keep their subscriptions and custom fields. This page is generated from the OpenAPI document of release main-6976024, the one the API serves, so it lists only what the API has.
How to authenticate, where errors are explained, and the other resources are in the API reference.
The account's custom fields
GET /v1/contact-fields
Its API key needs contacts:read.
Parameters
| Parameter | What it is |
|---|---|
cursor | text, in the query. The previous page’s next_cursor. |
limit | a whole number from 1 to 100, in the query. |
Answers
- 200: A page of fields, oldest first
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
data (required) | a list, each an object. |
data[].id (required) | text. |
data[].key (required) | text. How contacts’ fields and templates (contact.<key>) name it. It never changes. |
data[].label (required) | text. What people see. |
data[].type (required) | one of text, number, date or boolean. What every value is: text, number, date (YYYY-MM-DD), or boolean. It never changes. |
data[].created_at (required) | a date and time (RFC 3339). |
next_cursor (required) | text, or null. Null on the last page. |
Make a custom field
POST /v1/contact-fields
Its key and type are fixed once it's made, since templates and every stored value depend on them; its label can change. A field with this key, type, and label already answers 200, so a retry is safe; one with this key and anything else is 409 field_key_taken.
Its API key needs contacts:write.
Request body
A application/json body.
| Field | What it is |
|---|---|
key (required) | text, up to 64 characters. A lowercase letter, then up to 63 lowercase letters, digits, or underscores; not a built-in field’s name (email, first_name, …). |
label (required) | text, up to 100 characters. |
type (required) | one of text, number, date or boolean. |
Answers
- 200: The account already had it, as asked
- 201: Made
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 409:
- Field key already in use (
field_key_taken)
- Field key already in use (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
key (required) | text. How contacts’ fields and templates (contact.<key>) name it. It never changes. |
label (required) | text. What people see. |
type (required) | one of text, number, date or boolean. What every value is: text, number, date (YYYY-MM-DD), or boolean. It never changes. |
created_at (required) | a date and time (RFC 3339). |
What a 201 answers
| Field | What it is |
|---|---|
id (required) | text. |
key (required) | text. How contacts’ fields and templates (contact.<key>) name it. It never changes. |
label (required) | text. What people see. |
type (required) | one of text, number, date or boolean. What every value is: text, number, date (YYYY-MM-DD), or boolean. It never changes. |
created_at (required) | a date and time (RFC 3339). |
Change a custom field's label
PATCH /v1/contact-fields/{field_id}
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
field_id (required) | text, up to 64 characters, in the path. The field’s id (fld_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
label (required) | text, up to 100 characters. |
Answers
- 200: The field as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Field not found (
field_not_found)
- Field not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
key (required) | text. How contacts’ fields and templates (contact.<key>) name it. It never changes. |
label (required) | text. What people see. |
type (required) | one of text, number, date or boolean. What every value is: text, number, date (YYYY-MM-DD), or boolean. It never changes. |
created_at (required) | a date and time (RFC 3339). |
Search the account's contacts
POST /v1/contacts/search
A page of contacts, newest first, that match every filter given, with how many match in all. The text is in the body, never the address, since it's someone's name or address. At most 50 a page.
Its API key needs contacts:read.
Request body
A application/json body.
| Field | What it is |
|---|---|
query | text, up to 200 characters. Text anywhere in their name or address, ignoring case. |
topic_id | text. Only those subscribed to this topic. |
tag_id | text. Only those with this tag. |
status | one of active, unsubscribed_all or bounced. Only those with this status. |
cursor | text. The previous page’s next_cursor. |
limit | a whole number from 1 to 50. |
Answers
- 200: A page of contacts
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Topic not found (
topic_not_found) - Tag not found (
tag_not_found)
- Topic not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
data (required) | a list, each an object. |
data[].id (required) | text. |
data[].email (required) | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
data[].name (required) | text, or null. What to call them, if known. |
data[].first_name (required) | text, or null. |
data[].last_name (required) | text, or null. |
data[].status (required) | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
data[].locale (required) | text, or null. The language to write to them in (BCP 47). |
data[].time_zone (required) | text, or null. The IANA zone their mail is timed in. |
data[].fields (required) | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
data[].tag_ids (required) | a list, each text. The tags they have (tag_…). |
data[].topics (required) | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
data[].topics[].topic_id (required) | text. |
data[].topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
data[].topics[].since (required) | a date and time (RFC 3339). When it became so. |
data[].created_at (required) | a date and time (RFC 3339). |
next_cursor (required) | text, or null. Null on the last page. |
count (required) | a whole number. How many contacts match, on every page. |
Add a contact
POST /v1/contacts
Adds one person by their address, with what you know of them, and subscribes them to the topics given under how they agreed. An address already in your contacts answers 200 with them as they are, and changes nothing: change them with PATCH /v1/contacts/{contact_id}. So a retry is safe. An address on the account's suppression list (they unsubscribed, bounced, or complained) is refused with 409 contact_suppressed: only they can sign up again. A role mailbox (abuse@, postmaster@) is refused with 422.
Its API key needs contacts:write.
Request body
A application/json body.
| Field | What it is |
|---|---|
email (required) | text, up to 320 characters. |
name | text, up to 200 characters, or null. What to call them, if not their first and last names. Null clears it. |
first_name | text, up to 200 characters, or null. Null clears it. |
last_name | text, up to 200 characters, or null. Null clears it. |
locale | text, up to 35 characters, or null. The language to write to them in, as BCP 47 (fr-CA). |
time_zone | text, up to 64 characters, or null. The IANA zone their mail is timed in (America/Halifax): yours to set, never guessed over. |
country | text, up to 2 characters, or null. Where you know them to be: an ISO 3166-1 alpha-2 code (CA). |
region | text, up to 6 characters, or null. With country: an ISO 3166-2 code (CA-QC). |
fields | an object whose values are each text, a number or true or false, or null. Custom field values by each field’s key (GET /v1/contact-fields), in its type: text, a number, a YYYY-MM-DD date, or a boolean. Null or empty text clears one. |
tag_ids | a list of up to 100, each text. Tags to give them. |
topics | an object. Topics to subscribe them to, and how they agreed. |
topics.topic_ids (required) | a list of up to 100, each text. |
topics.agreed (required) | an object. How they agreed to hear from you, as the app asks it: signed_up (online, on paper, or at an event), asked (they asked you to add them), or customer (a customer or member who hasn't said no, with roughly when). Recorded as their consent's basis with you as its source. |
topics.agreed.choice (required) | one of signed_up or asked. |
topics.agreed.on | a date (YYYY-MM-DD). The day it happened, if known (YYYY-MM-DD); today if not. |
topics.agreed.roughly | text. Roughly when they bought or paid: a month (YYYY-MM) or a day. |
topics.statement | an object. The words behind the consent, kept with it as evidence. Without one, Flyanote records the words of the agreed choice the app shows. |
topics.statement.text (required) | text, up to 10,000 characters. The words they agreed to, or that you used to ask, exactly as shown. No email addresses. |
topics.statement.wording_version (required) | text. Your name for this wording and its version, changed whenever the words do. |
Answers
- 200: Already a contact: nothing in the body was applied, and
topicsis empty. Change them withPATCH /v1/contacts/{contact_id}, and subscribe them withPOST /v1/contacts/{contact_id}/topics. - 201: Added
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Tag not found (
tag_not_found) - Topic not found (
topic_not_found)
- Tag not found (
- 409:
- Address can't be added (
contact_suppressed) - Topic archived (
topic_archived)
- Address can't be added (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
created (required) | true or false. Whether this request added them; false when they were already a contact. |
contact (required) | an object. The contact as it now is. A key without contacts:read gets id alone, and none of the other properties. |
contact.id (required) | text. |
contact.email | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
contact.name | text, or null. What to call them, if known. |
contact.first_name | text, or null. |
contact.last_name | text, or null. |
contact.status | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
contact.locale | text, or null. The language to write to them in (BCP 47). |
contact.time_zone | text, or null. The IANA zone their mail is timed in. |
contact.fields | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
contact.tag_ids | a list, each text. The tags they have (tag_…). |
contact.topics | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
contact.topics[].topic_id (required) | text. |
contact.topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
contact.topics[].since (required) | a date and time (RFC 3339). When it became so. |
contact.created_at | a date and time (RFC 3339). |
topics (required) | a list, each an object. Each topic’s outcome, in the order given. |
topics[].topic_id (required) | text. |
topics[].outcome (required) | one of subscribed, already_subscribed, skipped_unsubscribed or skipped_suppressed, or another value later. subscribed; already_subscribed (what they agreed to already says as much); skipped_unsubscribed (they left this topic or everything: only they can join again, through a sign-up form); or skipped_suppressed (the account's suppression list holds their address). Treat a value you don't know as not subscribed. |
What a 201 answers
| Field | What it is |
|---|---|
created (required) | true or false. Whether this request added them; false when they were already a contact. |
contact (required) | an object. The contact as it now is. A key without contacts:read gets id alone, and none of the other properties. |
contact.id (required) | text. |
contact.email | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
contact.name | text, or null. What to call them, if known. |
contact.first_name | text, or null. |
contact.last_name | text, or null. |
contact.status | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
contact.locale | text, or null. The language to write to them in (BCP 47). |
contact.time_zone | text, or null. The IANA zone their mail is timed in. |
contact.fields | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
contact.tag_ids | a list, each text. The tags they have (tag_…). |
contact.topics | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
contact.topics[].topic_id (required) | text. |
contact.topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
contact.topics[].since (required) | a date and time (RFC 3339). When it became so. |
contact.created_at | a date and time (RFC 3339). |
topics (required) | a list, each an object. Each topic’s outcome, in the order given. |
topics[].topic_id (required) | text. |
topics[].outcome (required) | one of subscribed, already_subscribed, skipped_unsubscribed or skipped_suppressed, or another value later. subscribed; already_subscribed (what they agreed to already says as much); skipped_unsubscribed (they left this topic or everything: only they can join again, through a sign-up form); or skipped_suppressed (the account's suppression list holds their address). Treat a value you don't know as not subscribed. |
A contact
GET /v1/contacts/{contact_id}
Its API key needs contacts:read.
Parameters
| Parameter | What it is |
|---|---|
contact_id (required) | text, up to 64 characters, in the path. The contact’s id (ct_…). |
Answers
- 200: The contact
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Contact not found (
contact_not_found)
- Contact not found (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
email (required) | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
name (required) | text, or null. What to call them, if known. |
first_name (required) | text, or null. |
last_name (required) | text, or null. |
status (required) | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
locale (required) | text, or null. The language to write to them in (BCP 47). |
time_zone (required) | text, or null. The IANA zone their mail is timed in. |
fields (required) | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
tag_ids (required) | a list, each text. The tags they have (tag_…). |
topics (required) | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
topics[].topic_id (required) | text. |
topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
topics[].since (required) | a date and time (RFC 3339). When it became so. |
created_at (required) | a date and time (RFC 3339). |
Change a contact
PATCH /v1/contacts/{contact_id}
Changes what the body names and leaves the rest. Topics and tags change through their own operations, and status only by unsubscribing.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
contact_id (required) | text, up to 64 characters, in the path. The contact’s id (ct_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
name | text, up to 200 characters, or null. What to call them, if not their first and last names. Null clears it. |
first_name | text, up to 200 characters, or null. Null clears it. |
last_name | text, up to 200 characters, or null. Null clears it. |
locale | text, up to 35 characters, or null. The language to write to them in, as BCP 47 (fr-CA). |
time_zone | text, up to 64 characters, or null. The IANA zone their mail is timed in (America/Halifax): yours to set, never guessed over. |
country | text, up to 2 characters, or null. Where you know them to be: an ISO 3166-1 alpha-2 code (CA). |
region | text, up to 6 characters, or null. With country: an ISO 3166-2 code (CA-QC). |
fields | an object whose values are each text, a number or true or false, or null. Custom field values by each field’s key (GET /v1/contact-fields), in its type: text, a number, a YYYY-MM-DD date, or a boolean. Null or empty text clears one. |
Answers
- 200: The contact as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Contact not found (
contact_not_found)
- Contact not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
email | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
name | text, or null. What to call them, if known. |
first_name | text, or null. |
last_name | text, or null. |
status | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
locale | text, or null. The language to write to them in (BCP 47). |
time_zone | text, or null. The IANA zone their mail is timed in. |
fields | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
tag_ids | a list, each text. The tags they have (tag_…). |
topics | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
topics[].topic_id (required) | text. |
topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
topics[].since (required) | a date and time (RFC 3339). When it became so. |
created_at | a date and time (RFC 3339). |
Subscribe a contact to topics
POST /v1/contacts/{contact_id}/topics
Subscribes them under how they agreed, recorded as their consent with you as its source. Nobody is subscribed back to a topic they left, or after leaving everything: only they can, through a sign-up form (skipped_unsubscribed). One whose address is on the account's suppression list is skipped too. All the topics or none: an unknown or archived one refuses the request.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
contact_id (required) | text, up to 64 characters, in the path. The contact’s id (ct_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
topic_ids (required) | a list of up to 100, each text. |
agreed (required) | an object. How they agreed to hear from you, as the app asks it: signed_up (online, on paper, or at an event), asked (they asked you to add them), or customer (a customer or member who hasn't said no, with roughly when). Recorded as their consent's basis with you as its source. |
agreed.choice (required) | one of signed_up or asked. |
agreed.on | a date (YYYY-MM-DD). The day it happened, if known (YYYY-MM-DD); today if not. |
agreed.roughly | text. Roughly when they bought or paid: a month (YYYY-MM) or a day. |
statement | an object. The words behind the consent, kept with it as evidence. Without one, Flyanote records the words of the agreed choice the app shows. |
statement.text (required) | text, up to 10,000 characters. The words they agreed to, or that you used to ask, exactly as shown. No email addresses. |
statement.wording_version (required) | text. Your name for this wording and its version, changed whenever the words do. |
Answers
- 200: Each topic’s outcome, in the order given, and the contact as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Contact not found (
contact_not_found) - Topic not found (
topic_not_found)
- Contact not found (
- 409:
- Topic archived (
topic_archived)
- Topic archived (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
contact (required) | an object. The contact as it now is. A key without contacts:read gets id alone, and none of the other properties. |
contact.id (required) | text. |
contact.email | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
contact.name | text, or null. What to call them, if known. |
contact.first_name | text, or null. |
contact.last_name | text, or null. |
contact.status | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
contact.locale | text, or null. The language to write to them in (BCP 47). |
contact.time_zone | text, or null. The IANA zone their mail is timed in. |
contact.fields | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
contact.tag_ids | a list, each text. The tags they have (tag_…). |
contact.topics | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
contact.topics[].topic_id (required) | text. |
contact.topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
contact.topics[].since (required) | a date and time (RFC 3339). When it became so. |
contact.created_at | a date and time (RFC 3339). |
topics (required) | a list, each an object. |
topics[].topic_id (required) | text. |
topics[].outcome (required) | one of subscribed, already_subscribed, skipped_unsubscribed or skipped_suppressed, or another value later. subscribed; already_subscribed (what they agreed to already says as much); skipped_unsubscribed (they left this topic or everything: only they can join again, through a sign-up form); or skipped_suppressed (the account's suppression list holds their address). Treat a value you don't know as not subscribed. |
Unsubscribe a contact
POST /v1/contacts/{contact_id}/unsubscribe
On their behalf, recorded with you as its source: from one topic (topic_id), or from everything (all: true), which also puts each of their addresses on the account's suppression list. Leaving everything is final: only they can join a topic again, through a sign-up form. Unsubscribing again changes nothing they'd notice. Each counts toward the account's contact-irreversible limit, its own, which deleting a tag shares.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
contact_id (required) | text, up to 64 characters, in the path. The contact’s id (ct_…). |
Request body
A application/json body.
It takes one of 2 forms: with topic_id, or with all.
| Field | What it is |
|---|---|
topic_id | text. |
all | true. |
Answers
- 200: The contact as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Contact not found (
contact_not_found) - Topic not found (
topic_not_found)
- Contact not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
email | text, or null. Their email address as it was given. Null only once an erasure took every address they had. |
name | text, or null. What to call them, if known. |
first_name | text, or null. |
last_name | text, or null. |
status | one of active, unsubscribed_all or bounced. What stops all mail to them: active (nothing), unsubscribed_all (they left everything), or bounced (their address bounced). Each topic carries its own status too. |
locale | text, or null. The language to write to them in (BCP 47). |
time_zone | text, or null. The IANA zone their mail is timed in. |
fields | an object whose values are each text, a number or true or false. Their custom field values, by each field’s key. A field with no value is left out. |
tag_ids | a list, each text. The tags they have (tag_…). |
topics | a list, each an object. Every topic they have a consent record for, with where they stand on it. |
topics[].topic_id (required) | text. |
topics[].status (required) | one of subscribed, unsubscribed or expired, or another value later. subscribed, unsubscribed (from this topic, or from everything since), or expired (an implied consent that ran out). Treat a value you don’t know as not subscribed. |
topics[].since (required) | a date and time (RFC 3339). When it became so. |
created_at | a date and time (RFC 3339). |