Graine AI

Get what works for an agent

The agent's outcome patterns: an approach is used by the agent once it has been tried min_tries times and worked at least min_rate percent of the time — used marks the one per t…

The agent's outcome patterns: an approach is used by the agent once it has been tried min_tries times and worked at least min_rate percent of the time — used marks the one per topic its conversations carry.

Rate limit: 2000 requests per minute per organization, counted together with every endpoint that has no stricter limit of its own. Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.

GET
/v2/agents/{agent_id}/what-works
/v2/agents/6c6f4cc3-f56c-479d-8422-7f76694daa29/what-works

The Authorization access token

Authorization

Authorization
Required
Bearer <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

Path Parameters

agent_id
Required
Agent Id

The agent's id.

Query Parameters

organization_idOrganization Id

Must match the organisation the API key belongs to.

Response Body

200

The agent's outcome patterns.

agent_id
Required
Agent Id

The agent.

min_tries
Required
Min Tries

Tries an approach needs before the agent uses it.

min_rate
Required
Min Rate

The success rate it needs, in percent.

patterns
Required
Patterns

By topic (the most tried first), then the best rate.

401

1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

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.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

404

1200 — no such resource in your organization. A resource belonging to another organization answers 404, never 403.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

422

Validation Error

error
Required
integer

Stable integer code from the error table. Branch on this, not on the message.

message
Required
string

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.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

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.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

curl -X GET "https://api.graine.ai/v2/agents/6c6f4cc3-f56c-479d-8422-7f76694daa29/what-works?organization_id=string" \
  -H "Authorization: Bearer <token>"

The agent's outcome patterns.

{
  "agent_id": "agt_0123",
  "min_tries": 5,
  "min_rate": 50,
  "patterns": [
    {
      "topic": "Loan repayment",
      "approach": "Offered to split the payment in two",
      "tries": 12,
      "successes": 9,
      "rate": 75,
      "used": true,
      "updated_at": "2026-10-24T10:00:00Z"
    }
  ]
}