Skip to main content

Authentication

Request

action
string
required
Must be "get_leads".
channel_id
uuid
required
The channel to retrieve leads from. Your company must have access to this channel.

Response

Returns a leads array ordered by creation date (newest first). Each lead includes its custom property values with the associated property definition.
leads
array

Example

Request

curl -X POST https://amwezouylooonljdehou.supabase.co/functions/v1/openapi-operations \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{
    "action": "get_leads",
    "channel_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }'

Response

{
  "leads": [
    {
      "id": "99887766-5544-3322-1100-aabbccddeeff",
      "created_at": "2025-04-01T14:22:00.000Z",
      "email": "jane@example.com",
      "first_name": "Jane",
      "last_name": "Smith",
      "phone": "+1-555-0199",
      "company_name": "Smith Consulting",
      "source": "Website",
      "employee": null,
      "status": "Qualified",
      "lead_status_id": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff",
      "notes": "Interested in enterprise plan",
      "business_id": null,
      "channels_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "property_values": [
        {
          "id": "77665544-3322-1100-aabb-ccddeeff0011",
          "value": "50000",
          "property_definitions_id": "11111111-2222-3333-4444-555555555555",
          "property_definitions": {
            "id": "11111111-2222-3333-4444-555555555555",
            "name": "Deal size",
            "type": "number"
          }
        }
      ]
    }
  ]
}

Errors

StatusErrorCause
400"channel_id required"The channel_id field is missing.
401"Invalid API key"Missing or invalid X-Api-Key header.
403"Channel not accessible"Your company does not have access to this channel.