GET
https://www.app.ocoya.com/api/_public/v1/contacts
List contacts
curl --request GET \
  --url https://www.app.ocoya.com/api/_public/v1/contacts \
  --header 'X-API-Key: <api-key>'
{
  "total": 123,
  "page": 123,
  "perPage": 123,
  "data": [
    {
      "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.

Query Parameters

brandIdstringrequired

Ocoya brand ID. Get one from GET /brands.

Example:"cmayvq3hk00017apshay5qezu"
querystring

Search by address or name.

statusenum<string>
Available options: subscribed, unsubscribed, bounced, complained
groupIdstring

Only contacts in this group.

pageinteger

Zero-based page number for paginated results.

Example:0
perPageinteger

Up to 100. Defaults to 25.

Required range: 1 <= x <= 100

Response

application/json

Success

totalinteger
pageinteger
perPageinteger
dataobject[]
Show child attributesHide child attributes
data.idstring
Example:"cmwdke27h0045y0k4fi0tm5pj"
data.emailstring
Example:"jane@example.com"
data.firstNamestring | null
Example:"Jane"
data.lastNamestring | null
data.propertiesobject | null

Extra fields.

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

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

Example:"api"

How they agreed: their consent record.

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