Getting started

Pagination

Lists come a page at a time. Follow next_cursor until has_more is false and you have every object.

Parameters

The leads list and a lead's messages take the same two parameters.

  • limitinteger
    How many objects a page holds at most, from 1 to 100. Defaults to 20.
  • cursorstring
    The next_cursor of the page before. Leave it out for the first page.

The list object

  • objectstring
    Always list.
  • dataarray
    The page's objects.
  • has_moreboolean
    True when there is a page after this one.
  • next_cursorstring or null
    The cursor of the next page, null on the last one.
Response200
{
  "object": "list",
  "data": [
    {
      "object": "lead",
      "id": "k3v9q2m7x4w8n1p6",
      "name": "Emma",
      "message_count": 2,
      "last_message": {
        "object": "message",
        "id": "b2n7x4w8p5",
        "lead": "k3v9q2m7x4w8n1p6",
        "direction": "out",
        "author": "Lumen Studio",
        "text": "Yes, Beginners Flow runs every Saturday at 10am. Want me to save you a spot?",
        "files": [],
        "created_at": "2026-11-24T09:12:51.000Z"
      },
      "last_message_at": "2026-11-24T09:12:51.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "MjAyNi0xMS0yMlQxNjo0MDoxMi4wMDBa"
}

Loop through every page

Ask for the next page with cursor while has_more is true. Always loop on has_more and next_cursor, never on the number of objects.

  • Cursors are opaque. Never build or change one, pass the next_cursor you got as it is.
  • Leads come the latest activity first, a lead's messages the newest first.
  • Webhook endpoints and files come in one page, with has_more set to false and next_cursor to null.
curl -G https://okaymate.ai/api/v1/leads \
  -H "Authorization: Bearer $OKAYMATE_API_KEY" \
  -d limit=100

# The next page, with the next_cursor of the one before
curl -G https://okaymate.ai/api/v1/leads \
  -H "Authorization: Bearer $OKAYMATE_API_KEY" \
  -d limit=100 \
  -d cursor=MjAyNi0xMS0yMlQxNjo0MDoxMi4wMDBa