Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Preview a governed invocation

Normalize the input, resolve the exact target, read the provider (never write), and return a typed, execution-bound preview: environment and target, the exact change (field summaries and text diffs), expected impact against current impact limits, material preconditions with the time they were observed, expiry, and the adapter’s guarantees and limitations. Pass its id as previewId when invoking; any material difference is refused. For a declared action the preview is the normalized request itself, with every secret still a {{secret:NAME}} reference. Anlyon does not read an API it has no adapter for before the write, and the preview lists what a declared action does not guarantee.

POST/api/v2/actions/{ref}/previews
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Path parameters
refstringrequired

Action name or public action identifier.

min length 1 · max length 100
Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Anlyon-End-Userstring

The end user this call acts for: your own id for them, 1 to 128 characters of letters, digits and . _ : @ -. Accepted only with an API key, which stays on your server; a session or an OAuth token that sends it is refused. A key created with endUserRequired must send it on every action call (400 END_USER_REQUIRED). On an /end-users/{endUserId} route it must name the same end user as the path.

min length 1 · max length 128 · matches ^[A-Za-z0-9._:@-]{1,128}$
Request body
requiredapplication/json
inputobject
ttlSecondsinteger
min 60 · max 604800 · default: 3600
runIdstring

Resolve the action version this run's agent pins.

max length 80
Responses
201

Preview returned.

successbooleanrequired
Allowed:true
dataActionPreviewrequired
Show properties
idstringrequired
actionobjectrequired
Show properties
idstringrequired
namestringrequired
versionIdstringrequired
adapterobjectrequired
Show properties
typestringrequired
versionstringrequired
environmentobjectrequired
Show properties
idstringrequired
namestringrequired
kindstringrequired
targetobjectrequired
requestobjectrequired

The exact normalized request that will be dispatched.

impactImpactQuantity[]required
Show properties
Array of ImpactQuantity
dimensionstringrequired

money, resource_mutations, or a workspace-declared unit such as emails.

matches ^[a-z][a-z0-9_]{0,31}$
currencystring

Present for money.

matches ^[a-z]{3}$
amountintegerrequired

Integer minor units for money. A count for every other dimension.

min 0
boundstringrequired
Allowed:exactupper_bound
blocksPreviewBlock[]required
Show properties
Array of PreviewBlock
typestringrequired
Allowed:fieldstext_diffimpactlimitations
titlestringrequired
fieldsobject[]
Show properties
Array of object
labelstringrequired
valuestringrequired
pathstring
beforestring
afterstring
truncatedboolean
quantitiesImpactQuantity[]
itemsobject[]
Show properties
Array of object
kindstringrequired
Allowed:guaranteefreshnessunsupportedirreversible
textstringrequired
preconditionsobjectrequired

Material preconditions; part of the binding.

capabilitiesobjectrequired

The adapter's declared guarantees.

allowancesobject[]required

Applicable impact limits at preview time. Dispatch rechecks.

evidenceObservedAtstring<date-time>required
expiresAtstring<date-time>required
expiredbooleanrequired
requestDigeststringrequired
bindingDigeststringrequired

SHA-256 over the canonical request, target, versions, preconditions, scope and expiry. What an approval agrees to.

supersedesstring | nullrequired
effectIdstring | nullrequired

The effect executing this preview, once one is admitted.

endUserIdstring | nullrequired

The end user whose account read the provider. An invoke with this preview must name the same end user, and only a call for that end user (or one naming none) can read it.

createdAtstring<date-time>required
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

409

A conflict with current state, or, for a call made for an end user, END_USER_NOT_CONNECTED (they have not connected the integration) or END_USER_RECONNECT_REQUIRED (the provider refused their grant, or it could not be refreshed). Nothing was sent. Those two carry integration, displayName, endUserId and, when the environment has a default redirect URL and the integration signs in with OAuth, a fresh connectUrl with its expiresAt. A tool adopted from an MCP server that signs people in answers the same, with the server's mcp-<id> key as integration and its name as displayName.

successbooleanrequired
requestIdstringrequired
errorobjectrequired
Show properties
codestringrequired

END_USER_NOT_CONNECTED, END_USER_RECONNECT_REQUIRED, or another conflict code.

messagestringrequired
detailsobject
integrationstring

The integration the end user needs to connect, or mcp-<id> for a tool adopted from an MCP server that signs people in. Present on the two end-user codes.

displayNamestring

The name to show the end user: the integration's, or the MCP server's. Present on the two end-user codes.

endUserIdstring

Present on the two end-user codes.

connectUrlstring<uri>

A fresh connect link on the environment's default redirect URL. Absent without a default redirect URL

expiresAtstring<date-time>

When connectUrl expires.

fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/actions/string/previews' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {},
  "ttlSeconds": 3600,
  "runId": "string"
}'
Response
{
  "success": true,
  "data": {
    "id": "prv_01JABCDEF",
    "action": {
      "id": "string",
      "name": "string",
      "versionId": "string"
    },
    "adapter": {
      "type": "string",
      "version": "string"
    },
    "environment": {
      "id": "string",
      "name": "string",
      "kind": "string"
    },
    "target": {},
    "request": {},
    "impact": [
      {
        "dimension": "money",
        "currency": "usd",
        "amount": 0,
        "bound": "exact"
      }
    ],
    "blocks": [
      {
        "type": "fields",
        "title": "string",
        "fields": [
          {
            "label": "string",
            "value": "string"
          }
        ],
        "path": "string",
        "before": "string",
        "after": "string",
        "truncated": true,
        "quantities": [
          {
            "dimension": "money",
            "currency": "usd",
            "amount": 0,
            "bound": "exact"
          }
        ],
        "items": [
          {
            "kind": "guarantee",
            "text": "string"
          }
        ]
      }
    ],
    "preconditions": {},
    "capabilities": {},
    "allowances": [
      {}
    ],
    "evidenceObservedAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "expired": true,
    "requestDigest": "string",
    "bindingDigest": "string",
    "supersedes": "string",
    "effectId": "string",
    "endUserId": "string",
    "createdAt": "2019-08-24T14:15:22Z"
  }
}

Was this page helpful?