PATCH
https://www.app.ocoya.com/api/_public/v1/contacts/{contactId}
Update contact
curl --request PATCH \
  --url https://www.app.ocoya.com/api/_public/v1/contacts/{contactId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "firstName": "<string>",
  "lastName": "<string>",
  "properties": {},
  "groups": [
    "<string>"
  ],
  "status": "subscribed",
  "consentConfirmed": true
}
'
{
  "id": "cmwdke27h0045y0k4fi0tm5pj",
  "email": "jane@example.com",
  "firstName": "Jane",
  "lastName": "<string>",
  "properties": {},
  "status": "subscribed",
  "source": "api",
  "consentAt": "<string>",
  "consentText": "<string>",
  "unsubscribedAt": "<string>",
  "lastSentAt": "<string>",
  "lastOpenedAt": "<string>",
  "lastClickedAt": "<string>",
  "groups": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

X-API-Keystringheaderrequired

Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.

Path Parameters

contactIdstringrequired

Contact ID, from GET /contacts.

Example:"cmwdke27h0045y0k4fi0tm5pj"

Query Parameters

brandIdstringrequired

Ocoya brand ID. Get one from GET /brands.

Example:"cmayvq3hk00017apshay5qezu"

Body

application/json
firstNamestring
lastNamestring
propertiesobject

Replaces the contact's extra fields.

groupsstring[]

Every group the contact should be in, by name.

statusenum<string>
Available options: subscribed, unsubscribed

Response

application/json

Updated

idstring
Example:"cmwdke27h0045y0k4fi0tm5pj"
emailstring
Example:"jane@example.com"
firstNamestring | null
Example:"Jane"
lastNamestring | null
propertiesobject | null

Extra fields.

statusenum<string>
Available options: subscribed, unsubscribed, bounced, complained
Example:"subscribed"
sourcestring

manual, import, form, bio, api or workflow.

Example:"api"

How they agreed: their consent record.

unsubscribedAtstring | null
lastSentAtstring | null
lastOpenedAtstring | null
lastClickedAtstring | null
groupsobject[]
Show child attributesHide child attributes
groups.idstring
groups.namestring
createdAtstring
updatedAtstring