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

Import actions from OpenAPI

Translate supported OpenAPI 3.x operations into hosted actions, reporting every skipped operation and translation warning. A dry run creates nothing. Every operation that is not a GET is imported governed, declaring one exact resource mutation, so its invocations are previewed, counted against impact limits and given a receipt. Money is never inferred from the spec. Where the spec has a GET that reads back what a write changes, the result carries a proposedVerify rule for that action; it is not applied, and you add it with PATCH /api/v2/actions/{ref} once you have checked it. Pass governed: false to import plain template actions instead. Every imported operation also carries a suggestion: a risk class (read, write, irreversible or destructive), whether to require approval, and an impact declaration, read deterministically from the method, the path, the operation’s words, the request fields and vendor extensions. A suggestion is never applied by itself: name the operation in operations to set its approval or impact, for example with the suggestion a dry run returned. suggestedAllowedHosts lists the hosts the credential could be limited to, from the spec’s servers; set them on the secret to apply them.

POST/api/v2/actions/import
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.

Header parameters
X-Request-Idstring

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

max length 128
Idempotency-Keystring

Stable retry key for a mutation. The key is claimed atomically before the handler runs, so concurrent retries execute the side effect at most once. Replaying the key for the same request (same method, path, workspace and JSON body) returns the original response with an X-Idempotent-Replay: true header. Reusing the key for a different request returns 409 with error code idempotency_key_reuse. A duplicate arriving while the first is still in flight waits and then replays; if the first does not finish in time the duplicate gets 409 idempotency_request_in_progress. Keys are retained for 24 hours. Only successful (2xx) responses are stored; a failed request frees the key so it can be retried.

min length 1 · max length 255
Request body
requiredapplication/json
specobjectrequired

OpenAPI 3.x document.

baseUrlstring<uri>
authobject
Show properties
headerNamestringrequired
min length 1 · max length 100
secretNamestringrequired
min length 1 · max length 100 · matches ^[A-Z0-9_]+$
valueTemplatestring
min length 1 · max length 500
requiresApprovalboolean
default: false
dryRunboolean
default: false
onlystring[]
max items 200
governedboolean

Import every operation that is not a GET as a governed action declaring one resource mutation. false imports plain template actions.

default: true
operationsobject

Settings chosen per operation, keyed by operationId or METHOD /path, usually accepted from a dry run's suggestion. An operation not named here gets the defaults. A key that names no operation in the spec, an operation named twice, or an impact an action would not accept fails the whole request with 400 before anything is created.

Responses
200

Import or dry-run report returned.

successbooleanrequired
Allowed:true
dataobjectrequired
Show properties
createdImportedAction[]required
Show properties
Array of ImportedAction
namestringrequired
methodstringrequired
Allowed:GETPOSTPUTPATCHDELETE
pathstringrequired
urlTemplatestringrequired
warningsstring[]required
governedbooleanrequired

True when the action was imported governed. A GET never is.

impactobject | nullrequired

What a governed imported action declares it changes. One exact resource mutation unless operations chose another impact for it. Null for an ungoverned action.

Show properties
dimensionstringrequired
unitstring
amountstringrequired
boundstringrequired
Allowed:exactupper_bound
requiresApprovalbooleanrequired

Whether each call waits for a person's approval.

customizedbooleanrequired

True when operations named this operation.

suggestionImportSuggestionrequired

Suggested from the spec alone, with no model call, so the same spec always gives the same suggestion. Never applied by itself.

Show properties
riskstringrequired
Allowed:readwriteirreversibledestructive
reasonsstring[]required

The signals in the spec that produced the risk and the impact.

requiresApprovalbooleanrequired

True for an irreversible or destructive operation.

impactobject | nullrequired

An impact in the shape an action declares, or null when the operation changes nothing. unit is null for money when the spec does not fix one currency; choose it before accepting.

Show properties
dimensionstringrequired
unitstring | nullrequired
amountstringrequired
boundstringrequired
Allowed:exactupper_bound
impactNotestring | nullrequired

What to check before accepting the impact.

proposedVerifyobject | nullrequired

A read-back rule the spec makes possible for this write, or null. It is NOT on the action. Check that it reads back what the write changed, then set it as the action's verify.

Show properties
urlstringrequired
statusintegerrequired
matchobject[]required
Show properties
Array of object
pathstringrequired
equalsstringrequired
verifyNotestring | nullrequired

Why no read-back is proposed

actionAction
Show properties
idstringrequired
environmentIdstring<uuid>required

The environment this action lives in. An action belongs to exactly one.

namestringrequired
descriptionstring | nullrequired
methodstringrequired
Allowed:GETPOSTPUTPATCHDELETE
urlTemplatestringrequired
headersobjectrequired
bodyTemplateobject | nullrequired
inputSchemaobjectrequired
requiresApprovalbooleanrequired
enabledbooleanrequired
secretsstring[]required

Referenced secret names only; values are never returned.

currentVersionIdstring | nullrequired

The immutable version this definition currently is. An agent version pins a version id, so this is what to pin to hold an action at its present definition. Null only for actions that predate versioning and have not been edited since.

adapterActionAdapter | nullrequired

The governed-effect adapter, or null for a template action.

Show properties
Any of:
ActionAdapter
typestringrequired
Allowed:stripe.refundgithub.file_updateresend.email_send
configobjectrequired
credentialSecretstringrequired
matches ^[A-Z0-9_]+$
null
null
governedbooleanrequired

True when every invocation creates a governed effect. The action has an adapter, or it carries a declaration.

impactActionImpact | nullrequired

The declared impact, or null when the action declares none.

Show properties
Any of:
ActionImpact
dimensionstringrequired

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

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

The currency for money (lowercase ISO 4217, required). For every other dimension the unit is the dimension name and may be left out.

min length 1 · max length 32
amountstringrequired
min length 1 · max length 200
boundstringrequired
Allowed:exactupper_bound
null
null
verifyActionVerify | nullrequired

The declared read-back, or null when the action declares none.

Show properties
Any of:
ActionVerify
urlstringrequired
min length 1 · max length 2048
statusintegerrequired

The status the read-back must answer with.

min 100 · max 599
matchobject[]

JSON path equality checks on the read-back body. Every one must hold.

max items 10
Show properties
Array of object
pathstringrequired

A dotted path into the read-back body. A numeric segment indexes an array; a * segment stands for any item of one (labels.*.name).

min length 1 · max length 200
equalsany | nullrequired

A string, number, boolean or null. A string may be exactly one {{input.field}} or {{response.field}}.

absentboolean

True when the check holds only if no value at the path equals equals: how a removal is read back. Left out, the check holds when one does.

graphqlobject

A GraphQL read-back: Anlyon POSTs { query, variables } to url instead of a GET. The query is fixed text: no placeholder, and no mutation or subscription anywhere in it, so a read-back cannot write. Only the variables come from the call.

Show properties
querystringrequired
min length 1 · max length 10000
variablesobject

Each a string, number, boolean or null; a string may be exactly one {{input.field}} or {{response.field}}.

null
null
createdAtstring<date-time>required
updatedAtstring<date-time>required
skippedSkippedActionOperation[]required
Show properties
Array of SkippedActionOperation
pathstringrequired
methodstringrequired
reasonstringrequired
dryRunbooleanrequired
suggestedAllowedHostsstring[]required

Hosts the import's credential could be limited to, from the base URL and the spec's servers. Not applied; set them as the secret's allowedHosts.

201

Import or dry-run report returned.

successbooleanrequired
Allowed:true
dataobjectrequired
Show properties
createdImportedAction[]required
Show properties
Array of ImportedAction
namestringrequired
methodstringrequired
Allowed:GETPOSTPUTPATCHDELETE
pathstringrequired
urlTemplatestringrequired
warningsstring[]required
governedbooleanrequired

True when the action was imported governed. A GET never is.

impactobject | nullrequired

What a governed imported action declares it changes. One exact resource mutation unless operations chose another impact for it. Null for an ungoverned action.

Show properties
dimensionstringrequired
unitstring
amountstringrequired
boundstringrequired
Allowed:exactupper_bound
requiresApprovalbooleanrequired

Whether each call waits for a person's approval.

customizedbooleanrequired

True when operations named this operation.

suggestionImportSuggestionrequired

Suggested from the spec alone, with no model call, so the same spec always gives the same suggestion. Never applied by itself.

Show properties
riskstringrequired
Allowed:readwriteirreversibledestructive
reasonsstring[]required

The signals in the spec that produced the risk and the impact.

requiresApprovalbooleanrequired

True for an irreversible or destructive operation.

impactobject | nullrequired

An impact in the shape an action declares, or null when the operation changes nothing. unit is null for money when the spec does not fix one currency; choose it before accepting.

Show properties
dimensionstringrequired
unitstring | nullrequired
amountstringrequired
boundstringrequired
Allowed:exactupper_bound
impactNotestring | nullrequired

What to check before accepting the impact.

proposedVerifyobject | nullrequired

A read-back rule the spec makes possible for this write, or null. It is NOT on the action. Check that it reads back what the write changed, then set it as the action's verify.

Show properties
urlstringrequired
statusintegerrequired
matchobject[]required
Show properties
Array of object
pathstringrequired
equalsstringrequired
verifyNotestring | nullrequired

Why no read-back is proposed

actionAction
Show properties
idstringrequired
environmentIdstring<uuid>required

The environment this action lives in. An action belongs to exactly one.

namestringrequired
descriptionstring | nullrequired
methodstringrequired
Allowed:GETPOSTPUTPATCHDELETE
urlTemplatestringrequired
headersobjectrequired
bodyTemplateobject | nullrequired
inputSchemaobjectrequired
requiresApprovalbooleanrequired
enabledbooleanrequired
secretsstring[]required

Referenced secret names only; values are never returned.

currentVersionIdstring | nullrequired

The immutable version this definition currently is. An agent version pins a version id, so this is what to pin to hold an action at its present definition. Null only for actions that predate versioning and have not been edited since.

adapterActionAdapter | nullrequired

The governed-effect adapter, or null for a template action.

Show properties
Any of:
ActionAdapter
typestringrequired
Allowed:stripe.refundgithub.file_updateresend.email_send
configobjectrequired
credentialSecretstringrequired
matches ^[A-Z0-9_]+$
null
null
governedbooleanrequired

True when every invocation creates a governed effect. The action has an adapter, or it carries a declaration.

impactActionImpact | nullrequired

The declared impact, or null when the action declares none.

Show properties
Any of:
ActionImpact
dimensionstringrequired

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

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

The currency for money (lowercase ISO 4217, required). For every other dimension the unit is the dimension name and may be left out.

min length 1 · max length 32
amountstringrequired
min length 1 · max length 200
boundstringrequired
Allowed:exactupper_bound
null
null
verifyActionVerify | nullrequired

The declared read-back, or null when the action declares none.

Show properties
Any of:
ActionVerify
urlstringrequired
min length 1 · max length 2048
statusintegerrequired

The status the read-back must answer with.

min 100 · max 599
matchobject[]

JSON path equality checks on the read-back body. Every one must hold.

max items 10
Show properties
Array of object
pathstringrequired

A dotted path into the read-back body. A numeric segment indexes an array; a * segment stands for any item of one (labels.*.name).

min length 1 · max length 200
equalsany | nullrequired

A string, number, boolean or null. A string may be exactly one {{input.field}} or {{response.field}}.

absentboolean

True when the check holds only if no value at the path equals equals: how a removal is read back. Left out, the check holds when one does.

graphqlobject

A GraphQL read-back: Anlyon POSTs { query, variables } to url instead of a GET. The query is fixed text: no placeholder, and no mutation or subscription anywhere in it, so a read-back cannot write. Only the variables come from the call.

Show properties
querystringrequired
min length 1 · max length 10000
variablesobject

Each a string, number, boolean or null; a string may be exactly one {{input.field}} or {{response.field}}.

null
null
createdAtstring<date-time>required
updatedAtstring<date-time>required
skippedSkippedActionOperation[]required
Show properties
Array of SkippedActionOperation
pathstringrequired
methodstringrequired
reasonstringrequired
dryRunbooleanrequired
suggestedAllowedHostsstring[]required

Hosts the import's credential could be limited to, from the base URL and the spec's servers. Not applied; set them as the secret's allowedHosts.

202

Accepted, not applied: the change loosens a guardrail, so a workspace admin has to approve it. Location is the request to poll.

successbooleanrequired
Allowed:true
signOffRequiredbooleanrequired
Allowed:true
dataSignOffRequestrequired

A governance change that loosens a guardrail, asked for by an API key, a CLI login or an MCP session, waiting for a workspace admin. Give signOffUrl to a person; poll pollUrl.

Show properties
objectstringrequired
Allowed:sign_off_request
idstringrequired
statusstringrequired

pending until a workspace admin decides. applied: approved and in effect. rejected, expired (after 24 hours), cancelled (withdrawn by the credential) and failed (approved but could not be applied, see error): nothing changed.

Allowed:pendingappliedrejectedexpiredcancelledfailed
operationstringrequired
Allowed:policy.createpolicy.updatepolicy.deletepolicy_file.applyimpact_limit.updateimpact_limit.archivebudget.putbudget.deleteenvironment.resumeaction.createaction.updateaction.importsecret.putsecret_store.createsecret_store.updatesecret_store_settings.updateoauth_app.put
environmentIdstring<uuid>required
resourceobject | nullrequired
Show properties
typestringrequired
idstringrequired
namestring
summarystringrequired
changesSignOffChange[]required
Show properties
Array of SignOffChange
fieldstringrequired
fromany | nullrequired

The value before. Never a secret value.

toany | nullrequired

The value after. Never a secret value.

directionstringrequired
Allowed:tighteninglooseningneutral
reasonstringrequired
diffstringrequired

The changes as plain text

signOffUrlstring<uri>required

The console page where a workspace admin approves or rejects it. Give this to a person.

pollUrlstringrequired
pollAfterSecondsintegerrequired
requestedByobjectrequired
Show properties
typestringrequired
Allowed:api_keyoauth_clientsystem
idstring | nullrequired
onBehalfOfstring | null

For a CLI login or an MCP session

createdAtstring<date-time>required
expiresAtstring<date-time>required
decidedAtstring<date-time> | nullrequired
decidedByobject | nullrequired
Show properties
typestringrequired
Allowed:user
idstringrequired
viastringrequired
Allowed:consoleemail_link
decisionNotestring | nullrequired
resultany | nullrequired

When applied, what the original request would have returned: the limit, budget, policy or action as it now is.

errorobject | nullrequired
Show properties
codestringrequired
messagestringrequired
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.

402

Payment Required - Usage quota exceeded

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.

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/import' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "spec": {},
  "baseUrl": "http://example.com",
  "auth": {
    "headerName": "string",
    "secretName": "string",
    "valueTemplate": "Bearer {{secret}}"
  },
  "requiresApproval": false,
  "dryRun": false,
  "only": [
    "string"
  ],
  "governed": true,
  "operations": {
    "PostRefunds": {
      "requiresApproval": true,
      "impact": {
        "dimension": "money",
        "unit": "usd",
        "amount": "input.amount",
        "bound": "exact"
      }
    },
    "DELETE /v1/customers/{customer}": {
      "requiresApproval": true
    }
  }
}'
Response
{
  "success": true,
  "data": {
    "created": [
      {
        "name": "string",
        "method": "GET",
        "path": "string",
        "urlTemplate": "string",
        "warnings": [
          "string"
        ],
        "governed": true,
        "impact": {
          "dimension": "resource_mutations",
          "unit": "string",
          "amount": "1",
          "bound": "exact"
        },
        "requiresApproval": true,
        "customized": true,
        "suggestion": {
          "risk": "read",
          "reasons": [
            "string"
          ],
          "requiresApproval": true,
          "impact": {
            "dimension": "money",
            "unit": "usd",
            "amount": "input.amount",
            "bound": "exact"
          },
          "impactNote": "string"
        },
        "proposedVerify": {
          "url": "https://api.example.com/v1/pets/{{response.id}}",
          "status": 200,
          "match": [
            {
              "path": "name",
              "equals": "{{input.name}}"
            }
          ]
        },
        "verifyNote": "string",
        "action": {
          "id": "act_01JABCDEF",
          "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
          "name": "create-ticket",
          "description": "string",
          "method": "GET",
          "urlTemplate": "string",
          "headers": {},
          "bodyTemplate": {},
          "inputSchema": {},
          "requiresApproval": true,
          "enabled": true,
          "secrets": [
            "string"
          ],
          "currentVersionId": "acv_01JABCDEF",
          "adapter": {
            "type": "stripe.refund",
            "config": {
              "account": "acct_123",
              "mode": "test",
              "currency": "usd"
            },
            "credentialSecret": "STRIPE_TEST_KEY"
          },
          "governed": true,
          "impact": {
            "dimension": "emails",
            "unit": "emails",
            "amount": "count(input.to)",
            "bound": "exact"
          },
          "verify": {
            "url": "https://api.example.com/v1/messages/{{response.id}}",
            "status": 200,
            "match": [
              {
                "path": "status",
                "equals": "sent",
                "absent": true
              }
            ],
            "graphql": {
              "query": "query($id: String!) { issue(id: $id) { title } }",
              "variables": {
                "property1": null,
                "property2": null
              }
            }
          },
          "createdAt": "2019-08-24T14:15:22Z",
          "updatedAt": "2019-08-24T14:15:22Z"
        }
      }
    ],
    "skipped": [
      {
        "path": "string",
        "method": "string",
        "reason": "string"
      }
    ],
    "dryRun": true,
    "suggestedAllowedHosts": [
      "api.stripe.com"
    ]
  }
}

Was this page helpful?