- Create a contact property POST
- Create a contact's preference links POST
- Delete a contact property DELETE
- Delete a contact DELETE
- Export contacts as CSV GET
- Retrieve a contact property GET
- Retrieve a contact's topics GET
- Retrieve a contact GET
- Import contacts in bulk POST
- List contact properties GET
- List contacts GET
- Resend a contact's confirmation email POST
- Update a contact property's fallback PATCH
- Update a contact's topics PATCH
- Update a contact PATCH
- Create or update a contact POST
- Add a sending domain POST
- Receive email at a domain POST
- Add a custom tracking domain POST
- Remove a sending domain DELETE
- Stop receiving email at a domain DELETE
- Remove a custom tracking domain DELETE
- Retrieve a DMARC report GET
- Retrieve a domain's DMARC status GET
- Retrieve a sending domain GET
- List a domain's DMARC reports GET
- List sending domains GET
- Check a domain's DNS records now POST
- Create an email template POST
- Delete an email template DELETE
- Retrieve a template's draft GET
- Retrieve a template version GET
- Retrieve an email template GET
- List a template's versions GET
- List email templates GET
- Publish a template's draft POST
- Restore a template version POST
- Update a template's draft PUT
- Update an email template PATCH
- Check an email address POST
- Check an IP address POST
- Check a rate limit POST
- Classify content POST
- Assess an event POST
- Report an assessment's outcome POST
- Create a rate limit bucket POST
- Add an allow or block list entry POST
- Create a rule POST
- Delete a rate limit bucket DELETE
- Remove a list entry DELETE
- Delete a rule DELETE
- Forget a user DELETE
- Retrieve an assessment GET
- Retrieve the calibration GET
- Retrieve a rate limit bucket GET
- Retrieve a list entry GET
- Retrieve a rule GET
- Retrieve the risk settings GET
- List assessments GET
- List rate limit buckets GET
- List allow and block list entries GET
- List rules GET
- Update a rate limit bucket PATCH
- Update a rule PATCH
- Update the risk settings PATCH
- Create a webhook endpoint POST
- Open a webhook listener POST
- Delete a webhook endpoint DELETE
- Close a webhook listener DELETE
- Retrieve a delivery GET
- Retrieve a webhook endpoint GET
- List an endpoint's deliveries GET
- List webhook endpoints GET
- Poll a webhook listener POST
- Recover failed deliveries POST
- Retry a delivery POST
- Roll a signing secret POST
- Update a webhook endpoint PATCH
Create or update a contact
Creates the contact with this address in the API key's environment, or updates the existing one: names are replaced when given, properties are merged (null removes one), audience_ids are added and topics choices recorded. status only changes when passed.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"application/json- body
- body
- …
email*stringThe contact's address. Display names are ignored; matching is case-insensitive.
first_name?|1 <= length <= 256last_name?|1 <= length <= 256properties?Custom properties by key (define them first, see contact properties). Merged into the contact's existing properties; null removes one.
status?stringSets the contact's consent. Omitted, a new contact is subscribed and an existing one keeps its status.
"subscribed""unsubscribed"audience_ids?array<string>Audiences to add the contact to (it stays in the others).
items <= 20topics?array<>Choices per topic; topics left out keep the contact's choice.
items <= 100double_opt_in?booleanAsk the contact to confirm first (default: the marketing settings' double_opt_in_default): a new or unsubscribed contact becomes pending and gets a confirmation email; it is subscribed once they click its link. Can't be combined with status: "subscribed", nor can the default (pass false to subscribe directly).
The existing contact, updated.
application/json- response
- response
- …
object*"contact""contact"id*stringemail*stringfirst_name*string|nulllast_name*string|nullstatus*stringConsent to marketing email: subscribed, unsubscribed (never receives marketing email; transactional email is unaffected) or pending (waiting for a double opt-in confirmation).
"subscribed""unsubscribed""pending"properties*source*stringHow the contact was created.
"api""dashboard""import""preference_center"subscribed_at*|date-timeunsubscribed_at*|date-timeconfirmed_at*|When the contact confirmed a double opt-in.
date-timecreated_at*stringdate-timeupdated_at*stringdate-timeimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.email.contacts.upsert({ email: "ada@example.com", first_name: "Ada", properties: { plan: "pro", }, topics: [ { topic: "newsletter", status: "opted_in", }, ],});{ "object": "contact", "id": "contact_01k7c8m4q2f3e9v6t5r1n0p8yz", "email": "ada@example.com", "first_name": "Ada", "last_name": "Lovelace", "status": "subscribed", "properties": { "plan": "pro", "seats": 5 }, "source": "api", "subscribed_at": "2026-10-10T12:00:00.000Z", "unsubscribed_at": null, "confirmed_at": null, "created_at": "2026-10-10T12:00:00.000Z", "updated_at": "2026-10-10T12:00:00.000Z"}