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.

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
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
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.

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}}.

null
null
createdAtstring<date-time>required
updatedAtstring<date-time>required
skippedSkippedActionOperation[]required
Show properties
Array of SkippedActionOperation
pathstringrequired
methodstringrequired
reasonstringrequired
dryRunbooleanrequired
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
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.

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}}.

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

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

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

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

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

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
402

Payment Required - Usage quota exceeded

successbooleanrequired
requestIdstringrequired

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

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
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
429

Too Many Requests - Rate limit exceeded

successbooleanrequired
requestIdstringrequired

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

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
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 'Content-Type: application/json' \
  -d '{
  "spec": {},
  "baseUrl": "http://example.com",
  "auth": {
    "headerName": "string",
    "secretName": "string",
    "valueTemplate": "Bearer {{secret}}"
  },
  "requiresApproval": false,
  "dryRun": false,
  "only": [
    "string"
  ]
}'
Response
{
  "success": true,
  "data": {
    "created": [
      {
        "name": "string",
        "method": "GET",
        "path": "string",
        "urlTemplate": "string",
        "warnings": [
          "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"
              }
            ]
          },
          "createdAt": "2019-08-24T14:15:22Z",
          "updatedAt": "2019-08-24T14:15:22Z"
        }
      }
    ],
    "skipped": [
      {
        "path": "string",
        "method": "string",
        "reason": "string"
      }
    ],
    "dryRun": true
  }
}