Skip to navigation

Import actions from an OpenAPI spec

How do I turn my API's OpenAPI spec into actions for my agent, one action per endpoint?

If your API has an OpenAPI (Swagger) spec, Atlas reads it and drafts an action for each endpoint, with the URL, method, parameters and a description filled in. You pick which ones to keep. Use it when you want several endpoints available to your agent without filling in a form for each.

Import a spec

  1. Open the External Actions page. The sidebar doesn’t list it. Open it from the Open Global Actions link below the action list on an action step in a job’s workflow.
  2. On the Atlas Actions tab, select Create action, then Import from OpenAPI spec.
  3. Choose how to give Atlas the spec:
    • Spec URL. Enter the address of your openapi.json or openapi.yaml, for example https://api.example.com/openapi.json. Atlas fetches it, and waits up to 30 seconds. The address has to be reachable from the internet.
    • Paste JSON. Paste the spec into the OpenAPI JSON box. YAML works too.
  4. Select Generate actions.

The spec needs an openapi or swagger field and at least one path. Generating takes longer for a large spec.

Pick what to import

Atlas shows a preview: “N actions generated from spec. Review and confirm to import.”

  • Each row is one action, with its method, name, description and URL.
  • Every row starts selected. Select a row to turn it off or on.
  • Select all and Deselect all flip them together. A counter shows how many are selected, as “N of M selected”.
  • Back returns to the spec box.

Select Import N actions. They appear on Connections, on the Actions tab, in the Custom group.

What Atlas writes for each endpoint

PartWhat Atlas drafts
NameA short, readable name such as “Get User by ID”, not the raw operation ID.
DescriptionWhat the action does, when to use it and what it returns. Drawn from the spec’s summary, description and responses.
URLThe server address from your spec plus the path.
HTTP MethodGET, POST, PUT or DELETE, from the operation.
ParametersPath, query and body parameters with types and descriptions. A whole number becomes a Number.
AuthenticationIf the operation needs sign-in, Atlas may name a connection for it. It does not create the connection. See After you import.
MessagesThree spoken lines: a start line, a “still working” line after 5 seconds (5000 ms), and a failure line that doesn’t end the call.
Usage instructionsRules for the agent on when and how to use the action. The action form doesn’t show them.

Atlas handles each path in the spec on its own. If it can’t draft an action for one path, it skips that path and the rest still come through.

After you import

  • Read each description. Descriptions drawn from a spec often need a rewrite so the agent knows when to use the action. See Create a custom action.
  • Set up sign-in. If an endpoint needs authentication, open the action. Under Authentication, pick a saved connection, or add a header yourself. See OAuth credentials.
  • Put the actions on a job. See Put an action on a job.

Importing again adds new actions. It doesn’t change or replace the ones you already have. To avoid doubles, delete the old ones first.

Troubleshooting

If the form shows one of these messages, do the fix next to it.

MessageFix
Please provide a value.Enter a URL or paste a spec.
OpenAPI spec must be valid JSON or YAML formatCheck the pasted text parses as JSON or YAML.
Invalid OpenAPI spec: missing "openapi" or "swagger" fieldAdd the openapi or swagger version field at the top.
Invalid OpenAPI spec: missing or invalid "paths" field or no paths definedAdd at least one path.
Failed to fetch OpenAPI spec from URL: ...Open the URL in a browser from outside your network. Atlas must be able to fetch it within 30 seconds. Or paste the spec instead.
Failed to create actions: followed by a listAtlas drafted the actions but couldn’t save them. Each line gives the reason. For example, Atlas refuses a server URL that doesn’t start with https://. See Create a custom action.

If the list is shorter than you expect, check the spec for the missing endpoint. Atlas skipped that path.

If some actions fail to import, the window closes and keeps the ones that worked. Check the Actions tab under Connections for what’s missing. If every one fails, the window stays open and lists each with its reason.