Save a contact through the assistant API
Compatibility reference for the existing contact.save operation.
On this page
Create and update behavior
Existing integrations can send contact.save to POST /api/v1/assistant with an audience:write API key and an Idempotency-Key. Without contact_id it creates a contact or updates the existing contact with the same email address. Supply contact_id to update that contact directly.
Send the desired state, consent source, names, and full list membership. Omitting names clears them, and omitting list_ids removes all list memberships. A new membership can trigger active Automations and real email delivery. Use the dedicated contact endpoints for create-only and partial-update behavior.
const response = await fetch("https://routekite.com/api/v1/assistant", {method: "POST",headers: {"Authorization": `Bearer ${process.env.ROUTEKITE_API_KEY}`,"Content-Type": "application/json","Idempotency-Key": "contact-save-example-001",},body: JSON.stringify({"operation":"contact.save","email":"contact@example.com","first_name":"Sam","state":"unsubscribed","consent_source":"Account registration without marketing opt-in","list_ids":[]}),});const data = response.status === 204 ? null : await response.json();
{"object":"contact","id":"b98a691d-4ad6-4c22-9aab-f8a374eaef06","email":"contact@example.com","state":"unsubscribed"}Writes and retries
The API key must have been created by a current workspace member. Use a unique Idempotency-Key for each intended write. Reuse it only when retrying the same operation with the same input.