Amistio
Back to Developers

For developers

Partner API reference

Everything the partner API answers today, read from the same schemas the routes validate with. List your agents, start runs of their published versions, read results, mint embed sessions, register signed result callbacks - and create, check, and change agents as JSON documents, freeze versions, and put them live - from your own servers, with your own keys.

The reference text - operation summaries, descriptions, and field descriptions - comes from the API description itself and is in English.

Overview

The API is plain JSON over HTTPS. Every address below is relative to the base URL, every request carries your key in the Authorization header, and every answer is JSON - including failures.

Base URL
https://www.amistio.com/api/v1
API version
1.0.0
Format
JSON over HTTPS

Changes inside v1 are additive only: new fields and new operations may appear, existing ones keep their meaning. Anything that would break a working client arrives as /api/v2 instead.

Authentication

Create API keys under Settings in Amistio. Each key belongs to you and carries only the scopes you chose when you created it.

Key shape

amk_<keyId>_<secret>

Header

Authorization: Bearer amk_<keyId>_<secret>
  • The key is shown exactly once, when you create it. Amistio keeps only a digest and can never show it again.
  • Send the key only in the Authorization header over HTTPS. A key anywhere in the query string is refused with 400 before anything else runs.
  • A key can carry an expiry date and can be revoked at any time. Revocation takes effect on the very next request.
  • Every use updates the key's last-used time, so Settings shows which keys are really in use.
  • You can hold at most 20 live keys at a time.
  • Amistio's own signed-in pages may call the same operations with the browser session, same-origin only. Keys are for your servers - never put one in a browser.

Scopes

A request the key's scopes do not cover fails with 403 before anything else runs. Give a key only the scopes its job needs.

Scopes
ScopeMeaningOperations
agents:readRead your agents and their published version pins.
runs:startStart runs of your agents' published versions.
runs:readRead runs, their results, and their callback deliveries.
embed:mintMint embed sessions for your allowed embedding origins.
callbacks:manageRegister, pause, resume, rotate, and remove result callbacks.
agents:writeCreate agents from documents, check documents, and replace drafts.
agents:publishFreeze versions and put an agent live or take it off.

Limits

Protection bounds, not pricing. When a bound is reached the answer is 429 with a Retry-After header that says how many seconds to wait.

Limits
WhatBound
Requests per key60 per minute
Run starts per owner10 per minute
Agent document writes per owner30 per minute
Version freezes per owner10 per minute
List page sizelimit from 1 to 100, default 20
Request bodyup to 256 KiB - a larger body answers 413
Callbacks per agentat most 10
Live keys per ownerat most 20
Embed token first usethe frame must load within 10 minutes of minting
Callback delivery attemptsup to 5 attempts, with growing waits between them

Idempotency

Send an Idempotency-Key header when you start a run, so a retry after a timeout or a lost answer never starts a second run.

  1. The key is yours to choose: 1 to 200 printable ASCII characters, for example your own order id.
  2. A repeat with the same key within 24 hours returns the same run with replayed set to true and status 200. A run that really started answers 201.
  3. The same key with a different input fails with 409, so a mistaken reuse can never silently return someone else's run.

Start one durable run of the agent's published version. Input is validated exactly like the public run page; an input object above the run bound (49152 serialized characters) fails with 400. Send an Idempotency-Key header to make retries safe: a repeat inside 24 hours returns the same run and never starts a second one; a repeat with a different input fails with 409.

POST /agents/{agentId}/runs

Pagination

List operations return one page at a time and hand you a cursor for the next one.

  1. Ask for a page with limit, from 1 to 100. Without it you get 20 items.
  2. When more pages exist the answer carries nextCursor. Pass it back as cursor with the same limit to read the next page.
  3. The last page carries no nextCursor.

Errors

Every failure is the same typed JSON body. The code is one of a closed, stable set; the message is plain, bounded, and never carries a secret.

Error body

{
  "error": {
    "code": "not-found",
    "message": "not found"
  }
}

Two answers carry data beside the error: a stale expectedRevision (409) adds the draft's current revision, and a refused agent document (422) adds the findings list the Studio would show.

Every answer also carries an x-request-id header. Quote it when you report a problem, so the exact request can be found.

HTTP statuses

HTTP statuses
StatusMeaningWhere
200
  • The OpenAPI document
  • One page of agents
  • The agent
  • An earlier start with the same Idempotency-Key was returned
  • One page of runs
  • The run
  • The agent's callbacks
  • The callback
  • The updated callback
  • The callback with its new secret, shown once
  • The run's deliveries
  • The JSON Schema document
  • An earlier create with the same Idempotency-Key was returned
  • The verdict and every finding (empty when ok)
  • The draft document and its revision
  • The saved draft document and its new revision
  • This exact document was already frozen from this draft
201
  • The run was started (it may still be running)
  • The embed session
  • The callback with its secret, shown once
  • The agent was created; the draft is at revision 0
  • A new version was frozen
  • The version is live
204
  • Removed
  • Taken off
400
  • Malformed request (also: an API key placed in the query string)
  • Malformed request, or an address that is not public https (private, loopback, link-local, and metadata ranges are refused)
401
  • No credential, or an invalid, expired, or revoked API key
  • Every authenticated operation
403
  • The key lacks the required scope
  • Every authenticated operation
404
  • Unknown or foreign id - always the same body
  • The partner API is off
  • The partner API is off
409
  • No published version is live, or the Idempotency-Key was reused with a different input
  • The origin is not on your allowed list, or no published version is live
  • The agent already has 10 callbacks
  • The Idempotency-Key was reused with a different body
  • expectedRevision is stale - the body carries the current revision
  • expectedRevision is stale - the body carries the current revision
  • No frozen version exists, setup is incomplete, or the version cannot start (no trigger, a one-time schedule in the past)
  • Nothing is live (activation-inactive)
413
  • The request body is larger than 256 KiB
  • The request body is larger than 256 KiB
  • The request body is larger than 256 KiB
  • The request body is larger than 256 KiB
422
  • The document is not a valid agent - the same findings the Studio shows; nothing was saved
  • The document is not a valid agent - the same findings the Studio shows; nothing changed
  • The draft has blocking findings and cannot freeze
429
  • Protection bound reached; wait Retry-After seconds
  • Every authenticated operation
501
  • Embedding is not configured on this deployment
  • The version claims a runtime semantics this deployment does not interpret

Error codes

The codes a request can come back with, and the HTTP status each one travels with. Match on the code, not on the message.

Error codes
CodeStatusMeaning
auth-required401No credential was sent and no session is signed in.
auth-invalid401The API key is malformed, unknown, expired, or revoked.
scope-insufficient403The key lacks the scope this operation needs.
payload-invalid400The body, a parameter, or a header is malformed - including a key placed in the query string.
payload-too-large413The request body is larger than the allowed size.
not-found404The id is unknown, belongs to someone else, is malformed, or the partner API is off - always the same answer.
rate-limited429A protection bound was reached; wait the seconds named in Retry-After.
version-not-published409The agent has no live published version to run or embed.
unsupported-trigger409The agent's live version has no trigger that a run or an embedded page could start.
conflict409The Idempotency-Key was already used with a different input.
budget-exceeded409The agent already has the maximum number of callbacks.
embed-origin-not-allowed409The origin is not on your allowed embedding origins list.
stale-revision409expectedRevision is not the draft's current revision; the body carries the current one - read the draft again, merge your change, and retry.
invalid-agent422The document is not a valid agent. The body carries the same findings the Studio shows, and nothing was saved.
validation-blocked409The agent cannot go live yet because its setup is incomplete - finish the setup in the Studio, then try again.
activation-inactive409Nothing is live on this agent, so there is nothing to take off.
draft-archived409The agent is archived; restore it on My agents before writing to it or freezing a version.
capability-not-implemented501Amistio does not offer what the request needs, for example embedding is not configured.
storage-error500Amistio could not complete the request; try again later.

Endpoints

One section per operation, grouped by resource. Each sample reads your key from an environment variable and is meant to run on your server, never in a browser.

Documents

GET/openapi.json

This document

The OpenAPI 3.1 description of the partner API, generated from the same schemas the routes validate with.

ScopeNone - public while the API is onoperationIdgetOpenApiDocument

Request body

No request body.

Responses

Request sample

curl https://www.amistio.com/api/v1/openapi.json
GET/schemas/agent.json

The agent document's JSON Schema

The JSON Schema (draft 2020-12) of the agent document, generated from the very schema Amistio parses a Studio save with. Point your editor or CI at it to check a file before sending it. Public when the partner API is on.

ScopeNone - public while the API is onoperationIdgetAgentDocumentSchema

Request body

No request body.

Responses

Request sample

curl https://www.amistio.com/api/v1/schemas/agent.json

Agents

GET/agents

List your agents

Your agents with their published version pins, newest-updated first, paged by cursor.

Scopeagents:readoperationIdlistAgents

Query parameters

Query parameters
NameTypeRequiredDescription
cursorstringoptional
limitstringoptional1-100, default 20

Request body

No request body.

Responses

  • 200One page of agents

    listAgents 200
    NameTypeRequiredDescription
    agentsarray of objectrequired
    agentIdstringrequiredThe agent's definition id
    namestringrequired
    descriptionstringoptional
    publishedVersionIdstring | nullrequiredThe exact published version the agent runs, or null when nothing is live
    livebooleanrequiredTrue when a published version is active and runnable through the API
    archivedbooleanrequired
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    nextCursorstringoptionalPass back as cursor to read the next page
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents
GET/agents/{agentId}

One agent

One agent with its published pin, start mode, and the input form its published version expects.

Scopeagents:readoperationIdgetAgent

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

No request body.

Responses

  • 200The agent

    One agent in detail

    getAgent 200
    NameTypeRequiredDescription
    agentIdstringrequiredThe agent's definition id
    namestringrequired
    descriptionstringoptional
    publishedVersionIdstring | nullrequiredThe exact published version the agent runs, or null when nothing is live
    livebooleanrequiredTrue when a published version is active and runnable through the API
    archivedbooleanrequired
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    startModestringoptionalHow the live version starts; present only when liveAllowed values: manual, schedule, provider-event, event, none
    formobject | nullrequiredThe inputs to send in input when starting a run; null when nothing is live
    fieldsarray of objectrequired
    keystringrequiredInput key this field's value lands under
    labelstringrequired
    kindstringrequiredField kind, e.g. text, long-text, number, select, photo, document
    requiredbooleanoptional
    placeholderstringoptional
    helpstringoptional
    optionsarray of stringoptionalChoices for select fields
    minnumberoptional
    maxnumberoptional
    stepnumberoptional
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>
POST/agents

Create an agent from a document

Create one agent whose draft is exactly the document you send - the same document the Studio saves, checked the same way (schema, graph validation, size bounds, and no credential-shaped strings). The new agent is an ordinary agent: it appears on My agents with the Edit door, in GET /agents, and nowhere as a special type. Optional setup applies flat setup values before saving. Send an Idempotency-Key header to make retries safe: a repeat inside 24 hours with the same body returns the same agent and never creates a second one; a repeat with a different body fails with 409. Bounded at 30 document writes per minute per owner.

Scopeagents:writeoperationIdcreateAgent

Request headers

Request headers
NameTypeRequiredDescription
Idempotency-KeystringoptionalOptional client-chosen key (1-200 printable ASCII characters)

Request body

Create one agent from a document

createAgent Request body
NameTypeRequiredDescription
documentAgentDocumentrequiredThe agent document - the same file the JSON Schema at /schemas/agent.json describes
setupobject (any keys)optionalOptional flat setup values applied to the document before it is saved - a calendar-scheduled document then needs timezone (IANA) and scheduleTime (HH:MM); unknown keys are refused

Responses

  • 200An earlier create with the same Idempotency-Key was returned

    createAgent 200
    NameTypeRequiredDescription
    agentobjectrequiredOne agent in detail
    agentIdstringrequiredThe agent's definition id
    namestringrequired
    descriptionstringoptional
    publishedVersionIdstring | nullrequiredThe exact published version the agent runs, or null when nothing is live
    livebooleanrequiredTrue when a published version is active and runnable through the API
    archivedbooleanrequired
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    startModestringoptionalHow the live version starts; present only when liveAllowed values: manual, schedule, provider-event, event, none
    formobject | nullrequiredThe inputs to send in input when starting a run; null when nothing is live
    fieldsarray of objectrequired
    keystringrequiredInput key this field's value lands under
    labelstringrequired
    kindstringrequiredField kind, e.g. text, long-text, number, select, photo, document
    requiredbooleanoptional
    placeholderstringoptional
    helpstringoptional
    optionsarray of stringoptionalChoices for select fields
    minnumberoptional
    maxnumberoptional
    stepnumberoptional
    draftobjectrequiredThe agent's current draft as a document plus its revision
    documentobjectrequired
    namestringminLength: 1, maxLength: 128required
    descriptionstringminLength: 1, maxLength: 2048optional
    runtimeSemanticsVersionintegerminimum: 2, maximum: 1000000optional
    graphobjectrequired
    nodesarray of any | objectmaxItems: 256required
    edgesarray of anymaxItems: 1024required
    revisionintegerminimum: 0requiredSend this back as expectedRevision on the next replace or freeze
    replayedbooleanrequiredTrue when an Idempotency-Key matched an earlier create and no new agent was made
  • 201The agent was created; the draft is at revision 0

    createAgent 201
    NameTypeRequiredDescription
    agentobjectrequiredOne agent in detail
    agentIdstringrequiredThe agent's definition id
    namestringrequired
    descriptionstringoptional
    publishedVersionIdstring | nullrequiredThe exact published version the agent runs, or null when nothing is live
    livebooleanrequiredTrue when a published version is active and runnable through the API
    archivedbooleanrequired
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    startModestringoptionalHow the live version starts; present only when liveAllowed values: manual, schedule, provider-event, event, none
    formobject | nullrequiredThe inputs to send in input when starting a run; null when nothing is live
    fieldsarray of objectrequired
    keystringrequiredInput key this field's value lands under
    labelstringrequired
    kindstringrequiredField kind, e.g. text, long-text, number, select, photo, document
    requiredbooleanoptional
    placeholderstringoptional
    helpstringoptional
    optionsarray of stringoptionalChoices for select fields
    minnumberoptional
    maxnumberoptional
    stepnumberoptional
    draftobjectrequiredThe agent's current draft as a document plus its revision
    documentobjectrequired
    namestringminLength: 1, maxLength: 128required
    descriptionstringminLength: 1, maxLength: 2048optional
    runtimeSemanticsVersionintegerminimum: 2, maximum: 1000000optional
    graphobjectrequired
    nodesarray of any | objectmaxItems: 256required
    edgesarray of anymaxItems: 1024required
    revisionintegerminimum: 0requiredSend this back as expectedRevision on the next replace or freeze
    replayedbooleanrequiredTrue when an Idempotency-Key matched an earlier create and no new agent was made
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409The Idempotency-Key was reused with a different body

    The shared error body - see Errors.

  • 413The request body is larger than 256 KiB

    The shared error body - see Errors.

  • 422The document is not a valid agent - the same findings the Studio shows; nothing was saved

    The typed error plus the complete findings list

    createAgent 422
    NameTypeRequiredDescription
    errorobjectrequired
    codestringrequiredClosed runtime error code, e.g. not-found, auth-invalid, rate-limited
    messagestringrequiredPlain, bounded, secret-free explanation
    findingsarray of objectrequired
    codestringrequiredClosed finding code: one of the Studio's graph findings (e.g. trigger-missing, unknown-node-kind, graph-oversized) or schema-invalid, credential-shaped-value, runtime-semantics-unsupported
    blockingbooleanrequiredTrue when this finding alone refuses the write
    nodesarray of stringrequiredIds of the nodes involved
    edgesarray of stringrequiredIds of the edges involved
    pathstringoptionalDotted JSON path into the document, e.g. graph.nodes.2.config.instructions
    messagestringoptionalPlain words about the rule - never the refused value
  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

hello.agent.json is your agent file - the same document the JSON Schema describes. See the smallest valid one in the quickstart

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-42" \
  -d "{\"document\":$(cat hello.agent.json)}" \
  https://www.amistio.com/api/v1/agents
POST/agents/validate

Check a document without saving

Run exactly the checks a create or replace runs - schema, graph validation, size bounds, credential-shaped strings - and answer 200 with ok and the complete findings list. Nothing is saved, whatever the answer. Use it in CI before you send a file.

Scopeagents:writeoperationIdvalidateAgent

Request body

Check a document without saving anything

validateAgent Request body
NameTypeRequiredDescription
documentanyrequiredThe document to check - any JSON; problems come back as findings, never as a 400

Responses

  • 200The verdict and every finding (empty when ok)

    validateAgent 200
    NameTypeRequiredDescription
    okbooleanrequiredTrue when the document would be accepted as it is
    findingsarray of objectrequiredEvery finding; empty when ok
    codestringrequiredClosed finding code: one of the Studio's graph findings (e.g. trigger-missing, unknown-node-kind, graph-oversized) or schema-invalid, credential-shaped-value, runtime-semantics-unsupported
    blockingbooleanrequiredTrue when this finding alone refuses the write
    nodesarray of stringrequiredIds of the nodes involved
    edgesarray of stringrequiredIds of the edges involved
    pathstringoptionalDotted JSON path into the document, e.g. graph.nodes.2.config.instructions
    messagestringoptionalPlain words about the rule - never the refused value
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 413The request body is larger than 256 KiB

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

hello.agent.json is your agent file - the same document the JSON Schema describes. See the smallest valid one in the quickstart

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"document\":$(cat hello.agent.json)}" \
  https://www.amistio.com/api/v1/agents/validate
GET/agents/{agentId}/draft

Read the draft as a document

The agent's current draft as the document plus its revision - the same bytes you would write to a file, so a read followed by an unchanged write is accepted. Keep the revision: PUT and freeze require it.

Scopeagents:readoperationIdgetAgentDraft

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

No request body.

Responses

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/draft
PUT/agents/{agentId}/draft

Replace the draft with a document

Replace the whole draft with the document, behind the revision you read. A stale expectedRevision answers 409 with the current revision and changes nothing - never a silent overwrite. The document is checked exactly like a Studio save; blocking findings answer 422 and nothing changes. The new revision records that it was written through the API (the Studio shows "Edited through the API"). Bounded at 30 document writes per minute per owner.

Scopeagents:writeoperationIdreplaceAgentDraft

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

Replace the draft with a document, behind the revision you read

replaceAgentDraft Request body
NameTypeRequiredDescription
documentAgentDocumentrequiredThe agent document - the same file the JSON Schema at /schemas/agent.json describes
expectedRevisionintegerminimum: 0requiredThe draft revision you read; a stale value answers 409 with the current one

Responses

  • 200The saved draft document and its new revision

    The agent's current draft as a document plus its revision

    replaceAgentDraft 200
    NameTypeRequiredDescription
    documentAgentDocumentrequiredThe agent document - the same file the JSON Schema at /schemas/agent.json describes
    revisionintegerminimum: 0requiredSend this back as expectedRevision on the next replace or freeze
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409expectedRevision is stale - the body carries the current revision

    The typed error plus the current draft revision

    replaceAgentDraft 409
    NameTypeRequiredDescription
    errorobjectrequired
    codestringrequiredClosed runtime error code, e.g. not-found, auth-invalid, rate-limited
    messagestringrequiredPlain, bounded, secret-free explanation
    revisionintegerminimum: 0requiredThe draft's CURRENT revision - read, merge, and retry with it
  • 413The request body is larger than 256 KiB

    The shared error body - see Errors.

  • 422The document is not a valid agent - the same findings the Studio shows; nothing changed

    The typed error plus the complete findings list

    replaceAgentDraft 422
    NameTypeRequiredDescription
    errorobjectrequired
    codestringrequiredClosed runtime error code, e.g. not-found, auth-invalid, rate-limited
    messagestringrequiredPlain, bounded, secret-free explanation
    findingsarray of objectrequired
    codestringrequiredClosed finding code: one of the Studio's graph findings (e.g. trigger-missing, unknown-node-kind, graph-oversized) or schema-invalid, credential-shaped-value, runtime-semantics-unsupported
    blockingbooleanrequiredTrue when this finding alone refuses the write
    nodesarray of stringrequiredIds of the nodes involved
    edgesarray of stringrequiredIds of the edges involved
    pathstringoptionalDotted JSON path into the document, e.g. graph.nodes.2.config.instructions
    messagestringoptionalPlain words about the rule - never the refused value
  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

hello.agent.json is your agent file - the same document the JSON Schema describes. See the smallest valid one in the quickstart

curl -X PUT -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"document\":$(cat hello.agent.json),\"expectedRevision\":0}" \
  https://www.amistio.com/api/v1/agents/<agentId>/draft
POST/agents/{agentId}/versions

Freeze a version

Freeze the draft at expectedRevision into an immutable version and return its pin and digest. The same draft frozen twice answers 200 with the existing version (outcome idempotent). A stale revision answers 409 with the current one; a draft with blocking findings answers 422 with them, exactly as the Studio refuses the same save. Bounded at 10 freezes per minute per owner.

Scopeagents:publishoperationIdfreezeAgentVersion

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

Freeze the draft into an immutable version

freezeAgentVersion Request body
NameTypeRequiredDescription
expectedRevisionintegerminimum: 0requiredThe draft revision you are freezing; required, so a version is never cut from a draft you have not read

Responses

  • 200This exact document was already frozen from this draft

    freezeAgentVersion 200
    NameTypeRequiredDescription
    versionobjectrequiredOne immutable version of an agent
    versionIdstringrequiredThe version pin
    statestringrequiredAllowed values: frozen, published, archived, deletion-pending, deleted
    draftRevisionintegerminimum: 0requiredThe draft revision this version was frozen from
    frozenAtMillisintegerminimum: 0requiredUnix time in milliseconds
    contentAddressobjectrequiredThe digest of the frozen canonical document; identical documents share it
    algorithmstringrequiredAllowed values: sha256
    digeststringrequiredSHA-256 of the canonical document
    outcomestringrequiredidempotent when this exact document was already frozen from this draftAllowed values: frozen, idempotent
  • 201A new version was frozen

    freezeAgentVersion 201
    NameTypeRequiredDescription
    versionobjectrequiredOne immutable version of an agent
    versionIdstringrequiredThe version pin
    statestringrequiredAllowed values: frozen, published, archived, deletion-pending, deleted
    draftRevisionintegerminimum: 0requiredThe draft revision this version was frozen from
    frozenAtMillisintegerminimum: 0requiredUnix time in milliseconds
    contentAddressobjectrequiredThe digest of the frozen canonical document; identical documents share it
    algorithmstringrequiredAllowed values: sha256
    digeststringrequiredSHA-256 of the canonical document
    outcomestringrequiredidempotent when this exact document was already frozen from this draftAllowed values: frozen, idempotent
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409expectedRevision is stale - the body carries the current revision

    The typed error plus the current draft revision

    freezeAgentVersion 409
    NameTypeRequiredDescription
    errorobjectrequired
    codestringrequiredClosed runtime error code, e.g. not-found, auth-invalid, rate-limited
    messagestringrequiredPlain, bounded, secret-free explanation
    revisionintegerminimum: 0requiredThe draft's CURRENT revision - read, merge, and retry with it
  • 422The draft has blocking findings and cannot freeze

    The typed error plus the complete findings list

    freezeAgentVersion 422
    NameTypeRequiredDescription
    errorobjectrequired
    codestringrequiredClosed runtime error code, e.g. not-found, auth-invalid, rate-limited
    messagestringrequiredPlain, bounded, secret-free explanation
    findingsarray of objectrequired
    codestringrequiredClosed finding code: one of the Studio's graph findings (e.g. trigger-missing, unknown-node-kind, graph-oversized) or schema-invalid, credential-shaped-value, runtime-semantics-unsupported
    blockingbooleanrequiredTrue when this finding alone refuses the write
    nodesarray of stringrequiredIds of the nodes involved
    edgesarray of stringrequiredIds of the edges involved
    pathstringoptionalDotted JSON path into the document, e.g. graph.nodes.2.config.instructions
    messagestringoptionalPlain words about the rule - never the refused value
  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0}' \
  https://www.amistio.com/api/v1/agents/<agentId>/versions
POST/agents/{agentId}/activation

Put the latest version live

Publish the latest frozen version and make it the one that runs - the Studio's Go live. Preconditions are the Studio's own: a frozen version must exist (409 version-not-published otherwise) and the agent's setup must be complete (409 validation-blocked, e.g. a Telegram channel without its bound chat). For an event-triggered agent the response carries the raw webhook token exactly once.

Scopeagents:publishoperationIdactivateAgent

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

No request body.

Responses

  • 201The version is live

    activateAgent 201
    NameTypeRequiredDescription
    activationobjectrequiredThe agent's activation: which version is live
    versionIdstringrequiredThe exact version that is live
    enabledbooleanrequired
    activatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    webhookTokenstringoptionalFor an event-triggered agent: the raw webhook token, shown exactly once; Amistio keeps only its digest
    triggersarray of objectoptionalProvider-event subscriptions this activation established
    nodeIdstringrequired
    providerstringrequired
    triggerKeystringrequired
    transportstringrequiredAllowed values: webhook, polling
    statestringrequiredAllowed values: registered, pending-manual
    ingestUrlstringoptionalShown exactly once when a provider needs you to register the address by hand
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409No frozen version exists, setup is incomplete, or the version cannot start (no trigger, a one-time schedule in the past)

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

  • 501The version claims a runtime semantics this deployment does not interpret

    The shared error body - see Errors.

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/activation
DELETE/agents/{agentId}/activation

Take the agent off

Stop the live version: runs can no longer start through the API, the run page, schedules, or webhooks. Drafts and versions are untouched; POST again to go live. Nothing live answers the Studio's own 409.

Scopeagents:publishoperationIddeactivateAgent

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

No request body.

Responses

Request sample

curl -X DELETE -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/activation

Runs

POST/agents/{agentId}/runs

Start a run

Start one durable run of the agent's published version. Input is validated exactly like the public run page; an input object above the run bound (49152 serialized characters) fails with 400. Send an Idempotency-Key header to make retries safe: a repeat inside 24 hours returns the same run and never starts a second one; a repeat with a different input fails with 409.

Scoperuns:startoperationIdstartRun

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request headers

Request headers
NameTypeRequiredDescription
Idempotency-KeystringoptionalOptional client-chosen key (1-200 printable ASCII characters)

Request body

Start one run of the agent's published version

startRun Request body
NameTypeRequiredDescription
inputobject (any keys)optionalThe run input, keyed exactly like the agent's form fields; validated like the public run page

Responses

  • 200An earlier start with the same Idempotency-Key was returned

    startRun 200
    NameTypeRequiredDescription
    runobjectrequiredOne run: state plus the same bounded, redacted view the Amistio result page shows
    runIdstringrequired
    agentIdstringrequired
    versionIdstringoptional
    statestringrequiredAllowed values: running, awaiting-approval, succeeded, failed, cancelled
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    finishedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    originobjectrequired
    kindstringrequiredAllowed values: manual, draft-test, webhook, schedule, share-link, provider-event, room-message, conversation, api, embed
    inputobject (any keys)required
    outputsobject (any keys)requiredRedacted outputs; generated media keeps only descriptors
    stepsarray of objectrequired
    seqintegerminimum: 0required
    kindstringrequired
    statusstringrequiredAllowed values: ok, error
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    durationMillisintegerminimum: 0required
    previewstringrequiredBounded, redacted preview of the step's output
    stepsTruncatedbooleanrequired
    errorobjectoptional
    codestringrequired
    messagestringrequired
    pendingApprovalobjectoptionalPresent while the run waits for the owner's decision in Amistio
    requiredApproversintegerminimum: -9007199254740991required
    decisionsintegerminimum: -9007199254740991required
    approvalsintegerminimum: 0required
    usageobjectoptional
    modelCallsintegerminimum: -9007199254740991required
    toolCallsintegerminimum: -9007199254740991required
    connectorCallsintegerminimum: -9007199254740991required
    retriesintegerminimum: -9007199254740991required
    cancellationobjectoptional
    reasonstringrequiredAllowed values: user-requested, deadline
    requestedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    replayedbooleanrequiredTrue when an Idempotency-Key matched an earlier start and no new run began
  • 201The run was started (it may still be running)

    startRun 201
    NameTypeRequiredDescription
    runobjectrequiredOne run: state plus the same bounded, redacted view the Amistio result page shows
    runIdstringrequired
    agentIdstringrequired
    versionIdstringoptional
    statestringrequiredAllowed values: running, awaiting-approval, succeeded, failed, cancelled
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    finishedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    originobjectrequired
    kindstringrequiredAllowed values: manual, draft-test, webhook, schedule, share-link, provider-event, room-message, conversation, api, embed
    inputobject (any keys)required
    outputsobject (any keys)requiredRedacted outputs; generated media keeps only descriptors
    stepsarray of objectrequired
    seqintegerminimum: 0required
    kindstringrequired
    statusstringrequiredAllowed values: ok, error
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    durationMillisintegerminimum: 0required
    previewstringrequiredBounded, redacted preview of the step's output
    stepsTruncatedbooleanrequired
    errorobjectoptional
    codestringrequired
    messagestringrequired
    pendingApprovalobjectoptionalPresent while the run waits for the owner's decision in Amistio
    requiredApproversintegerminimum: -9007199254740991required
    decisionsintegerminimum: -9007199254740991required
    approvalsintegerminimum: 0required
    usageobjectoptional
    modelCallsintegerminimum: -9007199254740991required
    toolCallsintegerminimum: -9007199254740991required
    connectorCallsintegerminimum: -9007199254740991required
    retriesintegerminimum: -9007199254740991required
    cancellationobjectoptional
    reasonstringrequiredAllowed values: user-requested, deadline
    requestedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    replayedbooleanrequiredTrue when an Idempotency-Key matched an earlier start and no new run began
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409No published version is live, or the Idempotency-Key was reused with a different input

    The shared error body - see Errors.

  • 413The request body is larger than 256 KiB

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-42" \
  -d '{"input":{}}' \
  https://www.amistio.com/api/v1/agents/<agentId>/runs
GET/runs

List runs of one agent

Runs of one agent you own, newest first, paged by cursor. The agent query parameter is required.

Scoperuns:readoperationIdlistRuns

Query parameters

Query parameters
NameTypeRequiredDescription
cursorstringoptional
limitstringoptional1-100, default 20
agentstringrequiredThe agent whose runs to list (required)

Request body

No request body.

Responses

  • 200One page of runs

    listRuns 200
    NameTypeRequiredDescription
    runsarray of objectrequired
    runIdstringrequired
    agentIdstringrequired
    versionIdstringoptional
    statestringrequiredAllowed values: running, awaiting-approval, succeeded, failed, cancelled
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    finishedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    originobjectrequired
    kindstringrequiredAllowed values: manual, draft-test, webhook, schedule, share-link, provider-event, room-message, conversation, api, embed
    inputobject (any keys)required
    outputsobject (any keys)requiredRedacted outputs; generated media keeps only descriptors
    stepsarray of objectrequired
    seqintegerminimum: 0required
    kindstringrequired
    statusstringrequiredAllowed values: ok, error
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    durationMillisintegerminimum: 0required
    previewstringrequiredBounded, redacted preview of the step's output
    stepsTruncatedbooleanrequired
    errorobjectoptional
    codestringrequired
    messagestringrequired
    pendingApprovalobjectoptionalPresent while the run waits for the owner's decision in Amistio
    requiredApproversintegerminimum: -9007199254740991required
    decisionsintegerminimum: -9007199254740991required
    approvalsintegerminimum: 0required
    usageobjectoptional
    modelCallsintegerminimum: -9007199254740991required
    toolCallsintegerminimum: -9007199254740991required
    connectorCallsintegerminimum: -9007199254740991required
    retriesintegerminimum: -9007199254740991required
    cancellationobjectoptional
    reasonstringrequiredAllowed values: user-requested, deadline
    requestedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    nextCursorstringoptionalPass back as cursor with the same limit to read the next page
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  "https://www.amistio.com/api/v1/runs?agent=<agentId>&limit=20"
GET/runs/{runId}

One run

State plus the same bounded, redacted view the Amistio result page shows.

Scoperuns:readoperationIdgetRun

Path parameters

Path parameters
NameTypeRequiredDescription
runIdstringrequired

Request body

No request body.

Responses

  • 200The run

    One run: state plus the same bounded, redacted view the Amistio result page shows

    getRun 200
    NameTypeRequiredDescription
    runIdstringrequired
    agentIdstringrequired
    versionIdstringoptional
    statestringrequiredAllowed values: running, awaiting-approval, succeeded, failed, cancelled
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    finishedAtMillisintegerminimum: 0optionalUnix time in milliseconds
    originobjectrequired
    kindstringrequiredAllowed values: manual, draft-test, webhook, schedule, share-link, provider-event, room-message, conversation, api, embed
    inputobject (any keys)required
    outputsobject (any keys)requiredRedacted outputs; generated media keeps only descriptors
    stepsarray of objectrequired
    seqintegerminimum: 0required
    kindstringrequired
    statusstringrequiredAllowed values: ok, error
    startedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    durationMillisintegerminimum: 0required
    previewstringrequiredBounded, redacted preview of the step's output
    stepsTruncatedbooleanrequired
    errorobjectoptional
    codestringrequired
    messagestringrequired
    pendingApprovalobjectoptionalPresent while the run waits for the owner's decision in Amistio
    requiredApproversintegerminimum: -9007199254740991required
    decisionsintegerminimum: -9007199254740991required
    approvalsintegerminimum: 0required
    usageobjectoptional
    modelCallsintegerminimum: -9007199254740991required
    toolCallsintegerminimum: -9007199254740991required
    connectorCallsintegerminimum: -9007199254740991required
    retriesintegerminimum: -9007199254740991required
    cancellationobjectoptional
    reasonstringrequiredAllowed values: user-requested, deadline
    requestedAtMillisintegerminimum: 0optionalUnix time in milliseconds
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/runs/<runId>

Embedding

POST/embed-sessions

Mint an embed session

A short-lived signed token that lets exactly one allowed origin show the agent's public run page inside an iframe at the returned embedUrl. The frame must load within 10 minutes; the token is shown once.

Scopeembed:mintoperationIdcreateEmbedSession

Request body

Mint one short-lived embed session

createEmbedSession Request body
NameTypeRequiredDescription
agentIdstringrequiredA live agent you own
originstringrequiredExact site that will embed the frame, e.g. https://app.example.com; must be on your allowed list
surfacestringoptionalThe only surface in this sliceAllowed values: run-page

Responses

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agentId":"<agentId>","origin":"https://app.example.com"}' \
  https://www.amistio.com/api/v1/embed-sessions

Callbacks

GET/agents/{agentId}/callbacks

List an agent's result callbacks

The callbacks registered on one agent you own, oldest first. Secrets are never listed. Every callback POST carries X-Amistio-Event-Id, X-Amistio-Timestamp (Unix seconds), and X-Amistio-Signature: sha256=<hex HMAC-SHA256(secret, "<timestamp>.<rawBody>")>. Verify with the raw secret over the raw body in constant time, refuse timestamps more than 300 seconds from your clock, and deduplicate on the event id (retries resend the same id with a fresh timestamp and signature). The registration's secretVersion tells you which secret signed after a rotation.

Scopecallbacks:manageoperationIdlistCallbacks

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

No request body.

Responses

  • 200The agent's callbacks

    listCallbacks 200
    NameTypeRequiredDescription
    callbacksarray of objectrequired
    callbackIdstringrequiredThe registration id (cb-...)
    agentIdstringrequiredThe agent this callback belongs to
    urlstringrequiredThe https address Amistio POSTs to
    descriptionstringoptional
    eventsarray of stringrequiredWhich settle states are sentAllowed values: succeeded, failed, cancelled, awaiting-approval
    enabledbooleanrequiredFalse while paused: nothing new is sent
    secretVersionintegerexclusiveMinimum: 0requiredIncrements on every rotation; tells the receiver which secret signed a message
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    disabledAtMillisintegerminimum: 0optionalPresent while paused
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks
POST/agents/{agentId}/callbacks

Register a result callback

Register one public https address to receive a signed message whenever a run of this agent settles (succeeded, failed, cancelled, or awaiting-approval - or only the states you list). The address is checked against the egress guard now and again before every send. The response is the ONLY time the raw secret is returned. At most 10 callbacks per agent. Every callback POST carries X-Amistio-Event-Id, X-Amistio-Timestamp (Unix seconds), and X-Amistio-Signature: sha256=<hex HMAC-SHA256(secret, "<timestamp>.<rawBody>")>. Verify with the raw secret over the raw body in constant time, refuse timestamps more than 300 seconds from your clock, and deduplicate on the event id (retries resend the same id with a fresh timestamp and signature). The registration's secretVersion tells you which secret signed after a rotation.

Scopecallbacks:manageoperationIdcreateCallback

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired

Request body

Register one result callback for the agent

createCallback Request body
NameTypeRequiredDescription
urlstringminLength: 1, maxLength: 2048requiredPublic https address, no embedded credentials or fragment; private and internal addresses are refused
eventsarray of stringminItems: 1, maxItems: 4optionalSettle states to send; absent means all of themAllowed values: succeeded, failed, cancelled, awaiting-approval
descriptionstringmaxLength: 200optionalA short note for yourself

Responses

  • 201The callback with its secret, shown once

    createCallback 201
    NameTypeRequiredDescription
    callbackobjectrequiredOne result-callback registration; never carries the secret or its digest
    callbackIdstringrequiredThe registration id (cb-...)
    agentIdstringrequiredThe agent this callback belongs to
    urlstringrequiredThe https address Amistio POSTs to
    descriptionstringoptional
    eventsarray of stringrequiredWhich settle states are sentAllowed values: succeeded, failed, cancelled, awaiting-approval
    enabledbooleanrequiredFalse while paused: nothing new is sent
    secretVersionintegerexclusiveMinimum: 0requiredIncrements on every rotation; tells the receiver which secret signed a message
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    disabledAtMillisintegerminimum: 0optionalPresent while paused
    secretstringrequiredThe raw signing secret (amcb_...). Shown exactly once here and on rotate; Amistio keeps only its digest
  • 400Malformed request, or an address that is not public https (private, loopback, link-local, and metadata ranges are refused)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 409The agent already has 10 callbacks

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://app.example.com/amistio/callback"}' \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks
GET/agents/{agentId}/callbacks/{callbackId}

One result callback

One callback registration on an agent you own, without its secret.

Scopecallbacks:manageoperationIdgetCallback

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired
callbackIdstringrequired

Request body

No request body.

Responses

  • 200The callback

    getCallback 200
    NameTypeRequiredDescription
    callbackobjectrequiredOne result-callback registration; never carries the secret or its digest
    callbackIdstringrequiredThe registration id (cb-...)
    agentIdstringrequiredThe agent this callback belongs to
    urlstringrequiredThe https address Amistio POSTs to
    descriptionstringoptional
    eventsarray of stringrequiredWhich settle states are sentAllowed values: succeeded, failed, cancelled, awaiting-approval
    enabledbooleanrequiredFalse while paused: nothing new is sent
    secretVersionintegerexclusiveMinimum: 0requiredIncrements on every rotation; tells the receiver which secret signed a message
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    disabledAtMillisintegerminimum: 0optionalPresent while paused
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks/<callbackId>
PATCH/agents/{agentId}/callbacks/{callbackId}

Pause or resume a result callback

Set enabled to false to pause: nothing new is sent and a message already queued for it is skipped. Set it to true to resume. The secret and the events do not change.

Scopecallbacks:manageoperationIdupdateCallback

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired
callbackIdstringrequired

Request body

Pause or resume one callback

updateCallback Request body
NameTypeRequiredDescription
enabledbooleanrequiredFalse pauses the callback; true resumes it

Responses

  • 200The updated callback

    updateCallback 200
    NameTypeRequiredDescription
    callbackobjectrequiredOne result-callback registration; never carries the secret or its digest
    callbackIdstringrequiredThe registration id (cb-...)
    agentIdstringrequiredThe agent this callback belongs to
    urlstringrequiredThe https address Amistio POSTs to
    descriptionstringoptional
    eventsarray of stringrequiredWhich settle states are sentAllowed values: succeeded, failed, cancelled, awaiting-approval
    enabledbooleanrequiredFalse while paused: nothing new is sent
    secretVersionintegerexclusiveMinimum: 0requiredIncrements on every rotation; tells the receiver which secret signed a message
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    disabledAtMillisintegerminimum: 0optionalPresent while paused
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -X PATCH -H "Authorization: Bearer $AMISTIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}' \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks/<callbackId>
DELETE/agents/{agentId}/callbacks/{callbackId}

Remove a result callback

Permanently remove the registration and its secret. Deliveries already recorded stay on their runs as evidence.

Scopecallbacks:manageoperationIddeleteCallback

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired
callbackIdstringrequired

Request body

No request body.

Responses

Request sample

curl -X DELETE -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks/<callbackId>
POST/agents/{agentId}/callbacks/{callbackId}/rotate-secret

Rotate a callback's secret

Mint a fresh secret and raise secretVersion. Messages sent after this call are signed with the new secret only - there is no overlap window - so update the receiver right after. The response is the only time the new secret is returned. Every callback POST carries X-Amistio-Event-Id, X-Amistio-Timestamp (Unix seconds), and X-Amistio-Signature: sha256=<hex HMAC-SHA256(secret, "<timestamp>.<rawBody>")>. Verify with the raw secret over the raw body in constant time, refuse timestamps more than 300 seconds from your clock, and deduplicate on the event id (retries resend the same id with a fresh timestamp and signature). The registration's secretVersion tells you which secret signed after a rotation.

Scopecallbacks:manageoperationIdrotateCallbackSecret

Path parameters

Path parameters
NameTypeRequiredDescription
agentIdstringrequired
callbackIdstringrequired

Request body

No request body.

Responses

  • 200The callback with its new secret, shown once

    rotateCallbackSecret 200
    NameTypeRequiredDescription
    callbackobjectrequiredOne result-callback registration; never carries the secret or its digest
    callbackIdstringrequiredThe registration id (cb-...)
    agentIdstringrequiredThe agent this callback belongs to
    urlstringrequiredThe https address Amistio POSTs to
    descriptionstringoptional
    eventsarray of stringrequiredWhich settle states are sentAllowed values: succeeded, failed, cancelled, awaiting-approval
    enabledbooleanrequiredFalse while paused: nothing new is sent
    secretVersionintegerexclusiveMinimum: 0requiredIncrements on every rotation; tells the receiver which secret signed a message
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    updatedAtMillisintegerminimum: 0requiredUnix time in milliseconds
    disabledAtMillisintegerminimum: 0optionalPresent while paused
    secretstringrequiredThe raw signing secret (amcb_...). Shown exactly once here and on rotate; Amistio keeps only its digest
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -X POST -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/agents/<agentId>/callbacks/<callbackId>/rotate-secret

Deliveries

GET/runs/{runId}/deliveries

Callback deliveries for one run

Every callback delivery recorded for one run you own, oldest first: outcome (pending, delivered, failed, skipped), the closed reason, and each attempt's time, HTTP status or failure class, and bounded response excerpt. Never a secret, and never the registered address beyond its host.

Scoperuns:readoperationIdlistRunDeliveries

Path parameters

Path parameters
NameTypeRequiredDescription
runIdstringrequired

Request body

No request body.

Responses

  • 200The run's deliveries

    listRunDeliveries 200
    NameTypeRequiredDescription
    deliveriesarray of objectrequired
    deliveryIdstringrequired
    callbackIdstringrequiredThe registration this delivery was for
    targetHoststringoptionalHost of the registered address (never its path or query); absent when the callback was removed
    runIdstringrequired
    agentIdstringrequired
    versionIdstringoptional
    eventstringrequiredrun.<state>, the same value as the body's type
    eventIdstringrequiredStable across retries; the receiver deduplicates on it
    settledAtMillisintegerminimum: 0requiredUnix time in milliseconds
    createdAtMillisintegerminimum: 0requiredUnix time in milliseconds
    outcomestringrequiredAllowed values: pending, delivered, failed, skipped
    reasonstringoptionalClosed reason for a failed or skipped outcomeAllowed values: queue-unavailable, enqueue-failed, registration-missing, registration-disabled, run-missing, secret-unavailable, egress-denied, rejected, attempts-exhausted
    attemptsarray of objectrequired
    attemptintegerexclusiveMinimum: 0required
    atMillisintegerminimum: 0requiredUnix time in milliseconds
    statusintegerminimum: -9007199254740991optionalHTTP status the receiver answered, when it answered
    errorClassstringoptionalClosed failure class; never raw error textAllowed values: timeout, network, egress-denied, rejected, server-error, rate-limited
    responseExcerptstringoptionalAt most 256 printable, secret-free characters of the response
    nextAttemptAtMillisintegerminimum: 0optionalUnix time in milliseconds
    finishedAtMillisintegerminimum: 0optionalUnix time in milliseconds
  • 400Malformed request (also: an API key placed in the query string)

    The shared error body - see Errors.

  • 401No credential, or an invalid, expired, or revoked API key

    The shared error body - see Errors.

  • 403The key lacks the required scope

    The shared error body - see Errors.

  • 404Unknown or foreign id - always the same body

    The shared error body - see Errors.

  • 429Protection bound reached; wait Retry-After seconds

    The shared error body - see Errors.

Request sample

curl -H "Authorization: Bearer $AMISTIO_KEY" \
  https://www.amistio.com/api/v1/runs/<runId>/deliveries

Changelog

  1. v1.0.0

    First public release, with 14 operations.

  2. v1.0.0

    Agents as code: 8 operations added - the document's JSON Schema, create, check, read and replace the draft, freeze a version, and put an agent live or take it off.

Not offered

Amistio does not offer an SDK, a CLI, an extension marketplace, or self-hosting today. Use the API directly with any HTTP client - every sample above is plain HTTP in its language.

Essential cookies keep Amistio working. Nothing is tracked until you allow analytics.