Skip to content
QwryAI
Documentation
Pages

Endpoints

Get leads for a chatbot

Read an agent's newest Collect leads submissions

This endpoint returns the newest submissions to an agent's Collect leads forms, up to 10, newest first, in the same shape QwryAI sends to Zapier. It has no date filter or paging. To receive every lead as it comes in, connect Zapier or a webhook instead.

GEThttps://api.qwryai.com/api/v1/zapier/agents/{agentId}/form-submissions

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Change actions and procedures. This endpoint takes API keys only, not OAuth tokens. See Authentication.

Body parameters

There's no body. The endpoint takes these in the path and query string:

NameTypeRequiredDescription
agentIdstringYesPath. The agent's id, from list_agents.
limitintegerNoQuery. How many submissions to return, from 1 to 10. Defaults to 3.

Request example

Bash
curl 'https://api.qwryai.com/api/v1/zapier/agents/YOUR_AGENT_ID/form-submissions?limit=10' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

The response is a JSON array, not wrapped in data:

JSON
[
  {
    "id": "<submissionId>",
    "conversationId": "fd5ae9e1-9b30-4503-b346-ccd4d7ef16a3",
    "customerEmail": "sam.tester@example.com",
    "customerName": "Sam Tester",
    "customerPhone": "+14155550123",
    "customFields": { "company": "Northwind Outfitters" }
  }
]
FieldTypeDescription
idstringThe submission's id.
conversationIdstringThe conversation the form was submitted in.
customerEmail, customerName, customerPhonestringThe contact fields the visitor filled in; empty when the form doesn't ask for one.
customFieldsobjectAny other fields the form collects, by field name. Only on forms shown inside the conversation.

An agent with no Collect leads form returns []. See Collect leads to add one.

Errors

HTTP statuscodeWhen
401API_KEY_REQUIREDNo API key was sent, or an OAuth token was sent instead of a key.
401INVALID_API_KEYThe key is malformed, unknown or deleted.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Change actions and procedures.
404AGENT_NOT_FOUNDNo agent with that id in your workspace.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes for this key.

See Error Handling for the error envelope.

Explore the documentation