Skip to content
FolioSign inStart your trial

API reference

Ask

Conversations answered from the church's approved teaching, with citations.

GET/v1/conversations

List conversations#

Lists conversations started with this church's keys, most recently updated first. Messages are not included; read one conversation to get them.

Auth. A church API key. Needs the ask:read scope, or a wildcard that includes it (machine:read, machine:*, * on a partner key). A partner key can call it for a customer church by sending X-Folio-Church.

Limits. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After.

Auth
Church API key
Scope
ask:read
Operation id
machineListConversations

Parameters

Parameters
NameInDescription
limitqueryHow many items to return, from 1 to 100. (integer, e.g. 20)
cursorqueryThe opaque meta.next_cursor from the previous page. (string)
X-Folio-ChurchheaderPartner keys only: run this call as one of your customer churches (its org_ id or slug). The church must be one of yours, the key must be allowed to act for it, and plan checks run against that church. (string, e.g. org_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)

Responses

Response data fields
FieldTypeDescription
audience requiredstringWho can see the conversation: private for keys.
created_at requiredstring (date-time)When it was created, in RFC 3339 UTC.
id requiredstringThe id, with a type prefix such as tch_ or note_.
message_count requiredinteger (int32)How many messages the conversation holds.
messages requiredobject[]The messages.
mine requiredbooleanWhether the calling credential started it.
object requiredstringThe object type.
scope requiredvalueWhat the answers may draw on.
surface requiredstringWhere the conversation was started: machine for keys.
title requiredstringThe title.
updated_at requiredstring (date-time)When it last changed, in RFC 3339 UTC.
200 Success. List conversations.
200 example
{
  "status": true,
  "message": "conversations",
  "data": [
    {
      "id": "conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
      "object": "conversation",
      "title": "What did we teach about forgiveness?",
      "scope": {
        "kind": "org",
        "library": "own"
      },
      "surface": "machine",
      "audience": "private",
      "message_count": 2,
      "mine": false,
      "created_at": "2026-11-01T14:00:00Z",
      "updated_at": "2026-11-01T14:00:09Z",
      "messages": []
    }
  ],
  "meta": {
    "request_id": "req_b337770ecebe03b03a88a8998b59263d",
    "has_next": false,
    "has_prev": false
  }
}
400 The request could not be read.
400 example
{
  "status": false,
  "message": "the page cursor is not valid",
  "error": {
    "code": "invalid_argument",
    "status": 400,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
401 The key or session is missing, invalid or expired.
401 example
{
  "status": false,
  "message": "That API key is not valid or has expired.",
  "error": {
    "code": "unauthenticated",
    "status": 401,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
403 The credential lacks the scope, the church is suspended, the feature is not in the plan, or the address is not allowed.
403 example
{
  "status": false,
  "message": "That API key does not have the required scope.",
  "error": {
    "code": "permission_denied",
    "status": 403,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
404 The resource is not in this church.
404 example
{
  "status": false,
  "message": "That item is not in this church.",
  "error": {
    "code": "not_found",
    "status": 404,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
409 Conflict, including a duplicate Idempotency-Key still being processed.
409 example
{
  "status": false,
  "message": "A request with this Idempotency-Key is still running.",
  "error": {
    "code": "conflict",
    "status": 409,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
422 A field failed validation, or an Idempotency-Key was reused with a different body.
422 example
{
  "status": false,
  "message": "A field is not valid.",
  "error": {
    "code": "validation",
    "status": 422,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
429 Rate limited. Wait Retry-After seconds.
429 example
{
  "status": false,
  "message": "Too many requests. Wait before trying again.",
  "error": {
    "code": "rate_limited",
    "status": 429,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
500 Something went wrong. Quote error.request_id.
500 example
{
  "status": false,
  "message": "Something went wrong. Quote the request id to support.",
  "error": {
    "code": "internal",
    "status": 500,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}

Code samples

curl -X GET "$FOLIO_API_URL/v1/conversations?limit=20" \
  -H "Authorization: Bearer $FOLIO_API_KEY"

POST/v1/conversations

Start a conversation#

Starts a conversation and, when you send input, asks the first question. Answers are written from the church's own approved teaching and carry numbered sources.

The answer is asynchronous. The response holds the question and an answer with kind pending. Poll GET /v1/conversations/{conversation} until the answer's kind is no longer pending, or ask with stream on the messages route to receive it as server-sent events. Possible final kinds: answer, not_covered (the church has not taught on it), stopped, unavailable, and a few conversational kinds such as greeting and offtopic.

scope narrows what the answer may draw on. Leave it out for the whole church ({"kind":"org"}).

Auth. A church API key. Needs the ask:create scope, or a wildcard that includes it (machine:*, * on a partner key). A partner key can call it for a customer church by sending X-Folio-Church.

Plan. Needs the API and Ask features. A new question counts against the plan's Ask allowance: 402 quota_exceeded when it is used up, and 402 ai_budget_exhausted when the monthly AI budget is.

Limits. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After.

Auth
Church API key
Scope
ask:create
Plan
Needs the API and Ask features. A new question counts against the plan's Ask allowance: 402 quota_exceeded when it is used up, and 402 ai_budget_exhausted when the monthly AI budget is.
Operation id
machineCreateConversation

Parameters

Parameters
NameInDescription
Idempotency-KeyheaderMakes a retry safe. The same key with the same body replays the first response for 24 hours; the same key with a different body returns 422; a duplicate that is still running returns 409 with Retry-After. Responses that carry a one-time secret are not replayed. (string, e.g. sunday-2026-11-01-upload)
X-Folio-ChurchheaderPartner keys only: run this call as one of your customer churches (its org_ id or slug). The church must be one of yours, the key must be allowed to act for it, and plan checks run against that church. (string, e.g. org_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)

Request body

Request body fields
FieldTypeDescription
inputstringThe question.
scopeobject
campusstringA campus id.
campus_modestringHow the campus filter applies.
include_guestsbooleanWhether guest speakers' teaching may be used.
kindstringThe kind.
languagestringThe language code.
librarystringWhich library the answer may draw on.
refsstring[]Passages or teachings the conversation is about.
speakersstring[]Only teaching by these speakers.
titlestringThe title.
Example request body
{
  "title": "Forgiveness",
  "input": "What did we teach about forgiveness?",
  "scope": {
    "kind": "org",
    "library": "own"
  }
}

Responses

Response data fields
FieldTypeDescription
conversation requiredobject
audience requiredstringWho can see the conversation: private for keys.
created_at requiredstring (date-time)When it was created, in RFC 3339 UTC.
id requiredstringThe id, with a type prefix such as tch_ or note_.
message_count requiredinteger (int32)How many messages the conversation holds.
messages requiredobject[]The messages.
mine requiredbooleanWhether the calling credential started it.
object requiredstringThe object type.
scope requiredvalueWhat the answers may draw on.
surface requiredstringWhere the conversation was started: machine for keys.
title requiredstringThe title.
updated_at requiredstring (date-time)When it last changed, in RFC 3339 UTC.
turn requiredobject
answer requiredobject
blocks requiredobject[]The answer in blocks.
created_at requiredstring (date-time)When it was created, in RFC 3339 UTC.
follow_ups requiredstring[]Questions the reader may ask next.
id requiredstringThe id, with a type prefix such as tch_ or note_.
kind requiredstringThe kind.
next_steps requiredobject[]Suggested next actions for the reader.
object requiredstringThe object type.
role requiredstringuser or assistant.
shareable requiredbooleanWhether the answer can be shared by link.
short_answerstringA one or two sentence answer.
sources requiredobject[]The sources the answer is drawn from.
standing requiredobject[]Whether the teachings an answer drew on are current, superseded or retracted.
textstringThe text.
traceobject
steps requiredobject[]The steps taken to answer.
thoughtsstringA summary of how the answer was put together.
versesobject[]The verses.
question requiredobject
blocks requiredobject[]The answer in blocks.
created_at requiredstring (date-time)When it was created, in RFC 3339 UTC.
follow_ups requiredstring[]Questions the reader may ask next.
id requiredstringThe id, with a type prefix such as tch_ or note_.
kind requiredstringThe kind.
next_steps requiredobject[]Suggested next actions for the reader.
object requiredstringThe object type.
role requiredstringuser or assistant.
shareable requiredbooleanWhether the answer can be shared by link.
short_answerstringA one or two sentence answer.
sources requiredobject[]The sources the answer is drawn from.
standing requiredobject[]Whether the teachings an answer drew on are current, superseded or retracted.
textstringThe text.
traceobject
steps requiredobject[]The steps taken to answer.
thoughtsstringA summary of how the answer was put together.
versesobject[]The verses.
200 Success. Start a conversation.
200 example
{
  "status": true,
  "message": "turn created",
  "data": {
    "conversation": {
      "id": "conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
      "object": "conversation",
      "title": "Forgiveness",
      "scope": {
        "kind": "org",
        "library": "own"
      },
      "surface": "machine",
      "audience": "private",
      "message_count": 2,
      "mine": false,
      "created_at": "2026-11-01T14:00:00Z",
      "updated_at": "2026-11-01T14:00:00Z",
      "messages": []
    },
    "turn": {
      "question": {
        "id": "msg_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
        "object": "message",
        "role": "user",
        "kind": "question",
        "text": "What did we teach about forgiveness?",
        "blocks": [],
        "follow_ups": [],
        "sources": [],
        "standing": [],
        "next_steps": [],
        "shareable": false,
        "created_at": "2026-11-01T14:00:00Z"
      },
      "answer": {
        "id": "msg_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
        "object": "message",
        "role": "assistant",
        "kind": "pending",
        "blocks": [],
        "follow_ups": [],
        "sources": [],
        "standing": [],
        "next_steps": [],
        "shareable": false,
        "created_at": "2026-11-01T14:00:00Z"
      }
    }
  }
}
400 The request could not be read.
400 example
{
  "status": false,
  "message": "the page cursor is not valid",
  "error": {
    "code": "invalid_argument",
    "status": 400,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
401 The key or session is missing, invalid or expired.
401 example
{
  "status": false,
  "message": "That API key is not valid or has expired.",
  "error": {
    "code": "unauthenticated",
    "status": 401,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
402 The Ask allowance or the AI budget is used up.
402 example
{
  "status": false,
  "message": "This church has used its Ask allowance for this month.",
  "error": {
    "code": "quota_exceeded",
    "status": 402,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
403 The credential lacks the scope, the church is suspended, the feature is not in the plan, or the address is not allowed.
403 example
{
  "status": false,
  "message": "That API key does not have the required scope.",
  "error": {
    "code": "permission_denied",
    "status": 403,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
404 The resource is not in this church.
404 example
{
  "status": false,
  "message": "That item is not in this church.",
  "error": {
    "code": "not_found",
    "status": 404,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
409 Conflict, including a duplicate Idempotency-Key still being processed.
409 example
{
  "status": false,
  "message": "A request with this Idempotency-Key is still running.",
  "error": {
    "code": "conflict",
    "status": 409,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
422 The scope or a field is not valid.
422 example
{
  "status": false,
  "message": "That conversation scope is not valid.",
  "error": {
    "code": "validation",
    "status": 422,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
429 Rate limited. Wait Retry-After seconds.
429 example
{
  "status": false,
  "message": "Too many requests. Wait before trying again.",
  "error": {
    "code": "rate_limited",
    "status": 429,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
500 Something went wrong. Quote error.request_id.
500 example
{
  "status": false,
  "message": "Something went wrong. Quote the request id to support.",
  "error": {
    "code": "internal",
    "status": 500,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}

Code samples

curl -X POST "$FOLIO_API_URL/v1/conversations" \
  -H "Authorization: Bearer $FOLIO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: faq-forgiveness-1" \
  -d '{
  "title": "Forgiveness",
  "input": "What did we teach about forgiveness?",
  "scope": {
    "kind": "org",
    "library": "own"
  }
}'

GET/v1/conversations/{conversation}

Read a conversation#

Returns a conversation with all its messages. Poll this after asking until the last message's kind is not pending. A finished answer has short_answer, blocks (each citing source_refs), sources (numbered, with speaker, date and a time-coded excerpt), standing (whether a source teaching has since been superseded or retracted) and follow_ups.

Auth. A church API key. Needs the ask:read scope, or a wildcard that includes it (machine:read, machine:*, * on a partner key). A partner key can call it for a customer church by sending X-Folio-Church.

Limits. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After.

Auth
Church API key
Scope
ask:read
Operation id
machineGetConversation

Parameters

Parameters
NameInDescription
conversation requiredpathThe conversation id, such as conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012. (string, e.g. conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)
X-Folio-ChurchheaderPartner keys only: run this call as one of your customer churches (its org_ id or slug). The church must be one of yours, the key must be allowed to act for it, and plan checks run against that church. (string, e.g. org_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)

Responses

Response data fields
FieldTypeDescription
audience requiredstringWho can see the conversation: private for keys.
created_at requiredstring (date-time)When it was created, in RFC 3339 UTC.
id requiredstringThe id, with a type prefix such as tch_ or note_.
message_count requiredinteger (int32)How many messages the conversation holds.
messages requiredobject[]The messages.
mine requiredbooleanWhether the calling credential started it.
object requiredstringThe object type.
scope requiredvalueWhat the answers may draw on.
surface requiredstringWhere the conversation was started: machine for keys.
title requiredstringThe title.
updated_at requiredstring (date-time)When it last changed, in RFC 3339 UTC.
200 Success. Read a conversation.
200 example
{
  "status": true,
  "message": "conversation",
  "data": {
    "id": "conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
    "object": "conversation",
    "title": "Forgiveness",
    "scope": {
      "kind": "org",
      "library": "own"
    },
    "surface": "machine",
    "audience": "private",
    "message_count": 2,
    "mine": false,
    "created_at": "2026-11-01T14:00:00Z",
    "updated_at": "2026-11-01T14:00:09Z",
    "messages": [
      {
        "id": "msg_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
        "object": "message",
        "role": "user",
        "kind": "question",
        "text": "What did we teach about forgiveness?",
        "blocks": [],
        "follow_ups": [],
        "sources": [],
        "standing": [],
        "next_steps": [],
        "shareable": false,
        "created_at": "2026-11-01T14:00:00Z"
      },
      {
        "id": "msg_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
        "object": "message",
        "role": "assistant",
        "kind": "answer",
        "short_answer": "Forgiveness is a decision to release a debt, as God released ours. [1]",
        "blocks": [
          {
            "type": "paragraph",
            "text": "Pastor Ade taught that forgiving is not forgetting; it is releasing the debt. [1]",
            "source_refs": [
              1
            ]
          }
        ],
        "follow_ups": [
          "What did we teach about reconciliation?"
        ],
        "sources": [
          {
            "number": 1,
            "title": "Seventy times seven",
            "excerpt": "We forgive because we were forgiven.",
            "teaching_id": "tch_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012",
            "at_ms": 754000,
            "at": "12:34",
            "speaker": "Pastor Ade",
            "recorded_on": "2026-06-14",
            "standing": "current",
            "quote_verified": true
          }
        ],
        "standing": [],
        "next_steps": [],
        "shareable": true,
        "created_at": "2026-11-01T14:00:09Z"
      }
    ]
  }
}
400 The request could not be read.
400 example
{
  "status": false,
  "message": "the page cursor is not valid",
  "error": {
    "code": "invalid_argument",
    "status": 400,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
401 The key or session is missing, invalid or expired.
401 example
{
  "status": false,
  "message": "That API key is not valid or has expired.",
  "error": {
    "code": "unauthenticated",
    "status": 401,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
403 The credential lacks the scope, the church is suspended, the feature is not in the plan, or the address is not allowed.
403 example
{
  "status": false,
  "message": "That API key does not have the required scope.",
  "error": {
    "code": "permission_denied",
    "status": 403,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
404 The resource is not in this church.
404 example
{
  "status": false,
  "message": "That item is not in this church.",
  "error": {
    "code": "not_found",
    "status": 404,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
409 Conflict, including a duplicate Idempotency-Key still being processed.
409 example
{
  "status": false,
  "message": "A request with this Idempotency-Key is still running.",
  "error": {
    "code": "conflict",
    "status": 409,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
422 A field failed validation, or an Idempotency-Key was reused with a different body.
422 example
{
  "status": false,
  "message": "A field is not valid.",
  "error": {
    "code": "validation",
    "status": 422,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
429 Rate limited. Wait Retry-After seconds.
429 example
{
  "status": false,
  "message": "Too many requests. Wait before trying again.",
  "error": {
    "code": "rate_limited",
    "status": 429,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
500 Something went wrong. Quote error.request_id.
500 example
{
  "status": false,
  "message": "Something went wrong. Quote the request id to support.",
  "error": {
    "code": "internal",
    "status": 500,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}

Code samples

curl -X GET "$FOLIO_API_URL/v1/conversations/conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012" \
  -H "Authorization: Bearer $FOLIO_API_KEY"

POST/v1/conversations/{conversation}/messages

Ask a follow-up question#

Adds a question to an existing conversation. Without stream, the response is the same turn object as when you start a conversation, with a pending answer to poll for. With "stream": true the response is a server-sent event stream: a turn.created event first, then answer events until the answer is final.

Only one answer can be written at a time. Asking while one is pending answers 409 "An answer is already being written."; wait for it or stop it.

Auth. A church API key. Needs the ask:create scope, or a wildcard that includes it (machine:*, * on a partner key). A partner key can call it for a customer church by sending X-Folio-Church.

Plan. Counts against the plan's Ask allowance like any question.

Limits. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After.

Auth
Church API key
Scope
ask:create
Plan
Counts against the plan's Ask allowance like any question.
Operation id
machineCreateMessage

Parameters

Parameters
NameInDescription
conversation requiredpathThe conversation id, such as conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012. (string, e.g. conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)
Idempotency-KeyheaderMakes a retry safe. The same key with the same body replays the first response for 24 hours; the same key with a different body returns 422; a duplicate that is still running returns 409 with Retry-After. Responses that carry a one-time secret are not replayed. (string, e.g. sunday-2026-11-01-upload)
X-Folio-ChurchheaderPartner keys only: run this call as one of your customer churches (its org_ id or slug). The church must be one of yours, the key must be allowed to act for it, and plan checks run against that church. (string, e.g. org_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)

Request body

Request body fields
FieldTypeDescription
inputstringThe question.
streambooleanStreaming is not supported.
Example request body
{
  "input": "And what about forgiving someone who has not apologised?",
  "stream": false
}

Responses

200 Success. Ask a follow-up question.
200 example
"event: answer\ndata: {\"text\":\"…\"}\n\n"
400 The request could not be read.
400 example
{
  "status": false,
  "message": "the page cursor is not valid",
  "error": {
    "code": "invalid_argument",
    "status": 400,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
401 The key or session is missing, invalid or expired.
401 example
{
  "status": false,
  "message": "That API key is not valid or has expired.",
  "error": {
    "code": "unauthenticated",
    "status": 401,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
402 The Ask allowance or the AI budget is used up.
402 example
{
  "status": false,
  "message": "This church has used its Ask allowance for this month.",
  "error": {
    "code": "quota_exceeded",
    "status": 402,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
403 The credential lacks the scope, the church is suspended, the feature is not in the plan, or the address is not allowed.
403 example
{
  "status": false,
  "message": "That API key does not have the required scope.",
  "error": {
    "code": "permission_denied",
    "status": 403,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
404 The resource is not in this church.
404 example
{
  "status": false,
  "message": "That item is not in this church.",
  "error": {
    "code": "not_found",
    "status": 404,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
409 An answer is already being written for this conversation.
409 example
{
  "status": false,
  "message": "An answer is already being written.",
  "error": {
    "code": "conflict",
    "status": 409,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
422 A field failed validation, or an Idempotency-Key was reused with a different body.
422 example
{
  "status": false,
  "message": "A field is not valid.",
  "error": {
    "code": "validation",
    "status": 422,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
429 Rate limited. Wait Retry-After seconds.
429 example
{
  "status": false,
  "message": "Too many requests. Wait before trying again.",
  "error": {
    "code": "rate_limited",
    "status": 429,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
500 Something went wrong. Quote error.request_id.
500 example
{
  "status": false,
  "message": "Something went wrong. Quote the request id to support.",
  "error": {
    "code": "internal",
    "status": 500,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}

Code samples

curl -X POST "$FOLIO_API_URL/v1/conversations/conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012/messages" \
  -H "Authorization: Bearer $FOLIO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: faq-forgiveness-2" \
  -d '{
  "input": "And what about forgiving someone who has not apologised?",
  "stream": false
}'

POST/v1/conversations/{conversation}/stop

Stop the current answer#

Stops the answer that is being written. The answer ends with kind stopped. Calling it when nothing is pending is harmless.

Auth. A church API key. Needs the ask:create scope, or a wildcard that includes it (machine:*, * on a partner key). A partner key can call it for a customer church by sending X-Folio-Church.

Limits. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After.

Auth
Church API key
Scope
ask:create
Operation id
machineStopConversation

Parameters

Parameters
NameInDescription
conversation requiredpathThe conversation id, such as conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012. (string, e.g. conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)
Idempotency-KeyheaderMakes a retry safe. The same key with the same body replays the first response for 24 hours; the same key with a different body returns 422; a duplicate that is still running returns 409 with Retry-After. Responses that carry a one-time secret are not replayed. (string, e.g. sunday-2026-11-01-upload)
X-Folio-ChurchheaderPartner keys only: run this call as one of your customer churches (its org_ id or slug). The church must be one of yours, the key must be allowed to act for it, and plan checks run against that church. (string, e.g. org_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012)

Responses

200 Success. Stop the current answer.
200 example
{
  "status": true,
  "message": "answer stopped",
  "data": null
}
400 The request could not be read.
400 example
{
  "status": false,
  "message": "the page cursor is not valid",
  "error": {
    "code": "invalid_argument",
    "status": 400,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
401 The key or session is missing, invalid or expired.
401 example
{
  "status": false,
  "message": "That API key is not valid or has expired.",
  "error": {
    "code": "unauthenticated",
    "status": 401,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
403 The credential lacks the scope, the church is suspended, the feature is not in the plan, or the address is not allowed.
403 example
{
  "status": false,
  "message": "That API key does not have the required scope.",
  "error": {
    "code": "permission_denied",
    "status": 403,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
404 The resource is not in this church.
404 example
{
  "status": false,
  "message": "That item is not in this church.",
  "error": {
    "code": "not_found",
    "status": 404,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
409 Conflict, including a duplicate Idempotency-Key still being processed.
409 example
{
  "status": false,
  "message": "A request with this Idempotency-Key is still running.",
  "error": {
    "code": "conflict",
    "status": 409,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
422 A field failed validation, or an Idempotency-Key was reused with a different body.
422 example
{
  "status": false,
  "message": "A field is not valid.",
  "error": {
    "code": "validation",
    "status": 422,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
429 Rate limited. Wait Retry-After seconds.
429 example
{
  "status": false,
  "message": "Too many requests. Wait before trying again.",
  "error": {
    "code": "rate_limited",
    "status": 429,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}
500 Something went wrong. Quote error.request_id.
500 example
{
  "status": false,
  "message": "Something went wrong. Quote the request id to support.",
  "error": {
    "code": "internal",
    "status": 500,
    "request_id": "req_b337770ecebe03b03a88a8998b59263d"
  }
}

Code samples

curl -X POST "$FOLIO_API_URL/v1/conversations/conv_0192f7a8-3b1c-7d2e-9a40-5c6d7e8f9012/stop" \
  -H "Authorization: Bearer $FOLIO_API_KEY"

Verified against API version 0.0.0-dev. Generated from the live OpenAPI document.