List agents
List the organisation's agents, newest first by default.
List the organisation's agents, newest first by default.
A row here and the agent read on its own carry the same keys, so you can
write one decoder for both. Two fields are necessarily thinner on a row:
prompts comes back empty and knowledge_base null, because neither is
fetched while listing. Everything else — the greeting, the labels, the seven
configuration buckets — is the same object.
Two other behaviours worth knowing:
- A page can come back with fewer rows than you asked for — this is normal.
Creating an agent also creates an internal browser-calling companion that shares its
prompt. Those are removed from the results after the page is fetched, so
page_size=20commonly returns about 10 agents, andpage_size=1can return none at all. A short page does NOT mean the end of the list. - Use
has_more, nevertotal, to decide whether to keep going.has_moreis authoritative.totalis an estimate: it counts what is upstream and subtracts the companions removed from the page being returned, so it shifts withpage_sizeand is not a number to divide. Iterate untilhas_moreis false and collect what arrives.
Rate limit: 1000 requests per minute per organization (bucket default). Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.
v2/agentsAuthorization
AuthorizationRequiredBearer <token>
Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.
In: header
Query Parameters
statusStatus
DRAFT | ACTIVE | INACTIVE | ARCHIVED. ARCHIVED agents are excluded unless this filter names them explicitly.
categoryCategory
Filter by the agent's category.
searchSearch
Substring match on the agent's name.
sort_bySort By
created_at | updated_at | name | status
"created_at"sort_orderSort Order
asc | desc
"desc"organization_idOrganization Id
Must match the organisation the API key belongs to.
pagePage
1-indexed page number (max 10000 — narrow the window instead)
1Minimum: 1Maximum: 10000page_sizePage Size
Items per page (max 100)
20Minimum: 1Maximum: 100Response Body
200
A page of agents, newest first by default. Each row carries the same keys as GET /v2/agents/{agent_id}.
dataRequiredData
This page of agents, newest first by default.
paginationRequiredPagination
Where this page sits in the result set.
400
1000 — malformed or contradictory input. 1002 — a required parameter is missing.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
401
1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
403
1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
422
1001 — the body or query failed validation; the message names the first offending field.
errorRequiredinteger
Stable integer code from the error table. Branch on this, not on the message.
messageRequiredstring
One human-readable sentence. Wording may change; the code will not.
429
1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
503
1501 — a service this endpoint depends on is unreachable or returned a 5xx.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
504
1502 — a service this endpoint depends on did not answer in time.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
A page of agents, newest first by default. Each row carries the same keys as GET /v2/agents/{agent_id}.

