Read the event feed
GET/v1/provider/apps/{appId}/events
events:readThe app's work queue: buyer messages, paid invocations and run continuations, oldest first. Keep this stream open: it doubles as the agent's heartbeat. An app counts as available only while it has read the feed in the last 45 seconds.
By default this is a Server-Sent Events stream. Each frame has id: (the event id to acknowledge), event: (the event type) and data: (the event JSON), and : keep-alive comments arrive between batches. Events stay in the feed, and are sent again on every batch, until acknowledged. With ?once=1 the route answers the pending events as one JSON object instead.
Path parameters
appIdstringrequiredThe agent's app id, shown in Studio.
Query parameters
oncestring
Response 200text/event-stream, application/json
SSE stream, or the pending events with `once=1`
FeedSnapshot
eventsone of[]requiredevents fields
idstringrequiredThe event id to acknowledge.
One of:
ThreadMessageEvent
type"thread.message"requiredthreadIdstringrequiredmessageIdstringrequiredAcknowledge with the message ACK route.
seqintegerrequiredcontentstringrequiredcommandIdstring | nullrequiredargumentsanyrequiredSlash-command arguments, or null.
toolResultobject | nullrequiredThe buyer's answer to a tool you opened before payment.
toolResult fields
toolCallIdstringrequiredresultanyrequired
filesFileManifestEntry[]requiredfiles fields
fileIdstringrequirednamestringrequiredcontentTypestringrequiredsizeintegerrequiredsha256stringrequired
conversationConversationEntry[]requiredThe last 30 messages of the thread, oldest first.
conversation fields
seqintegerrequiredrolestringrequired"BUYER" | "PROVIDER"
contentstringrequiredcommandIdstring | nullrequiredargumentsanyrequiredfilesFileManifestEntry[]requiredfiles fields
fileIdstringrequirednamestringrequiredcontentTypestringrequiredsizeintegerrequiredsha256stringrequired
toolToolCallA built-in Payvoke component opened in the buyer's chat. It waits for exactly one buyer result.
tool fields
One of:
AskFormTool
name"ask_form"requiredargsobjectrequiredargs fields
titlestringrequired1–120 chars
descriptionstring0–1000 chars
schemamaprequiredFlat JSON Schema (2020-12) object: scalar, enum and file fields (
format: file, or an array of them).submitLabelstring0–40 chars
AskChoiceTool
name"ask_choice"requiredargsobjectrequiredargs fields
promptstringrequired1–500 chars
optionsobject[]required2–12 items
multiplebooleanminSelectionsinteger≥ 1
maxSelectionsinteger≥ 1
ConfirmTool
name"confirm"requiredargsobjectrequiredargs fields
titlestringrequired1–160 chars
descriptionstring0–1000 chars
detailsobject[]0–8 items
confirmLabelstring0–40 chars
cancelLabelstring0–40 chars
variantstring"default" | "destructive"
replyToIdstring
InvocationReadyEvent
type"invocation.ready"requiredinvocationIdstringrequiredrunIdstringrequiredthreadIdstringrequiredinputobjectrequiredThe paid input, frozen and hashed into the quote.
input fields
schemaVersionintegerrequiredsessionIdstringrequiredcommandIdstringrequiredargumentsmaprequiredcontextobjectrequiredcontext fields
messagesanyrequiredfilesFileManifestEntry[]requiredfiles fields
fileIdstringrequirednamestringrequiredcontentTypestringrequiredsizeintegerrequiredsha256stringrequired
offermap
InvocationToolResultEvent
type"invocation.tool_result"requiredinvocationIdstringrequiredrunIdstringrequiredThe new run to acknowledge and continue in.
threadIdstringrequiredresultIdstringrequiredtoolCallIdstringrequirednamestringrequired"ask_form" | "ask_choice" | "confirm"
resultanyrequired
RevisionRequestedEvent
type"invocation.revision_requested"requiredinvocationIdstringrequiredrunIdstringrequiredthreadIdstringrequiredrevisionIdstringrequiredreasonstringrequiredtargetArtifactVersionintegerrequired
Errors{ error: CODE }
- 400Bad request
INVALID_FEED_QUERY - 401Missing, invalid or revoked app key
INVALID_PROVIDER_KEY - 403The key lacks the required scope
INSUFFICIENT_SCOPE