Skip to content
Ask for an invite

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

ParameterWhat it is
cursortext, in the query. The previous page’s next_cursor.
limita whole number from 1 to 100, in the query.

Answers

What a 200 answers

FieldWhat 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.

FieldWhat 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

What a 200 answers

FieldWhat 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

FieldWhat 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

ParameterWhat it is
field_id (required)text, up to 64 characters, in the path. The field’s id (fld_…).

Request body

A application/json body.

FieldWhat it is
label (required)text, up to 100 characters.

Answers

What a 200 answers

FieldWhat 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.

FieldWhat it is
querytext, up to 200 characters. Text anywhere in their name or address, ignoring case.
topic_idtext. Only those subscribed to this topic.
tag_idtext. Only those with this tag.
statusone of active, unsubscribed_all or bounced. Only those with this status.
cursortext. The previous page’s next_cursor.
limita whole number from 1 to 50.

Answers

What a 200 answers

FieldWhat 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.

FieldWhat it is
email (required)text, up to 320 characters.
nametext, up to 200 characters, or null. What to call them, if not their first and last names. Null clears it.
first_nametext, up to 200 characters, or null. Null clears it.
last_nametext, up to 200 characters, or null. Null clears it.
localetext, up to 35 characters, or null. The language to write to them in, as BCP 47 (fr-CA).
time_zonetext, up to 64 characters, or null. The IANA zone their mail is timed in (America/Halifax): yours to set, never guessed over.
countrytext, up to 2 characters, or null. Where you know them to be: an ISO 3166-1 alpha-2 code (CA).
regiontext, up to 6 characters, or null. With country: an ISO 3166-2 code (CA-QC).
fieldsan 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_idsa list of up to 100, each text. Tags to give them.
topicsan 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.ona date (YYYY-MM-DD). The day it happened, if known (YYYY-MM-DD); today if not.
topics.agreed.roughlytext. Roughly when they bought or paid: a month (YYYY-MM) or a day.
topics.statementan 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

What a 200 answers

FieldWhat 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.emailtext, or null. Their email address as it was given. Null only once an erasure took every address they had.
contact.nametext, or null. What to call them, if known.
contact.first_nametext, or null.
contact.last_nametext, or null.
contact.statusone 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.localetext, or null. The language to write to them in (BCP 47).
contact.time_zonetext, or null. The IANA zone their mail is timed in.
contact.fieldsan 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_idsa list, each text. The tags they have (tag_…).
contact.topicsa 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_ata 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

FieldWhat 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.emailtext, or null. Their email address as it was given. Null only once an erasure took every address they had.
contact.nametext, or null. What to call them, if known.
contact.first_nametext, or null.
contact.last_nametext, or null.
contact.statusone 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.localetext, or null. The language to write to them in (BCP 47).
contact.time_zonetext, or null. The IANA zone their mail is timed in.
contact.fieldsan 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_idsa list, each text. The tags they have (tag_…).
contact.topicsa 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_ata 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

ParameterWhat it is
contact_id (required)text, up to 64 characters, in the path. The contact’s id (ct_…).

Answers

What a 200 answers

FieldWhat 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

ParameterWhat it is
contact_id (required)text, up to 64 characters, in the path. The contact’s id (ct_…).

Request body

A application/json body.

FieldWhat it is
nametext, up to 200 characters, or null. What to call them, if not their first and last names. Null clears it.
first_nametext, up to 200 characters, or null. Null clears it.
last_nametext, up to 200 characters, or null. Null clears it.
localetext, up to 35 characters, or null. The language to write to them in, as BCP 47 (fr-CA).
time_zonetext, up to 64 characters, or null. The IANA zone their mail is timed in (America/Halifax): yours to set, never guessed over.
countrytext, up to 2 characters, or null. Where you know them to be: an ISO 3166-1 alpha-2 code (CA).
regiontext, up to 6 characters, or null. With country: an ISO 3166-2 code (CA-QC).
fieldsan 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

What a 200 answers

FieldWhat it is
id (required)text.
emailtext, or null. Their email address as it was given. Null only once an erasure took every address they had.
nametext, or null. What to call them, if known.
first_nametext, or null.
last_nametext, or null.
statusone 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.
localetext, or null. The language to write to them in (BCP 47).
time_zonetext, or null. The IANA zone their mail is timed in.
fieldsan 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_idsa list, each text. The tags they have (tag_…).
topicsa 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_ata 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

ParameterWhat it is
contact_id (required)text, up to 64 characters, in the path. The contact’s id (ct_…).

Request body

A application/json body.

FieldWhat 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.ona date (YYYY-MM-DD). The day it happened, if known (YYYY-MM-DD); today if not.
agreed.roughlytext. Roughly when they bought or paid: a month (YYYY-MM) or a day.
statementan 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

What a 200 answers

FieldWhat 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.emailtext, or null. Their email address as it was given. Null only once an erasure took every address they had.
contact.nametext, or null. What to call them, if known.
contact.first_nametext, or null.
contact.last_nametext, or null.
contact.statusone 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.localetext, or null. The language to write to them in (BCP 47).
contact.time_zonetext, or null. The IANA zone their mail is timed in.
contact.fieldsan 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_idsa list, each text. The tags they have (tag_…).
contact.topicsa 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_ata 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

ParameterWhat 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.

FieldWhat it is
topic_idtext.
alltrue.

Answers

What a 200 answers

FieldWhat it is
id (required)text.
emailtext, or null. Their email address as it was given. Null only once an erasure took every address they had.
nametext, or null. What to call them, if known.
first_nametext, or null.
last_nametext, or null.
statusone 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.
localetext, or null. The language to write to them in (BCP 47).
time_zonetext, or null. The IANA zone their mail is timed in.
fieldsan 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_idsa list, each text. The tags they have (tag_…).
topicsa 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_ata date and time (RFC 3339).