Skip to navigation

Atlas CLI commands

Every built-in Atlas CLI command and flag, the API commands by resource, output formats, scripting and CI, exit codes, and what to do when a command fails.

Every Atlas API endpoint is a command. A few built-in commands handle sign-in, updates and completion.

Command pattern

atlas <resource> <operation> [arguments] [flags]
  • The resource is the area of the API, such as campaign, call, agent, contact, phone-number, knowledge-base.
  • The operation is the action, such as get-all-campaigns.
  • Arguments are the IDs in the path, in order.
  • Flags are the query filters for that endpoint. You give each as --name value.

Ask any command for its help:

atlas --help
atlas campaign --help
atlas call get-call-records --help

The help for a command lists its arguments, filters and the body fields it accepts. For a machine-readable list of every command, flag, argument and exit code, run:

atlas help --json

Built-in commands

CommandWhat it does
atlas login --api-key KEY [--profile NAME] [--base-url URL]Test the key and save it as a profile
atlas logout [--profile NAME]Remove a profile (the active one if you give no name)
atlas whoamiShow the active profile, account email, name and base URL
atlas profile listList profiles
atlas profile use NAMESwitch the active profile
atlas updateUpdate the CLI
atlas update-specDownload the API definition again now
atlas completion bash|zsh|fish|powershellPrint a shell completion script
atlas help --jsonPrint every command, flag and exit code as JSON

Global flags

Every command accepts these.

FlagShortWhat it does
--output <format>-ojson (default), table or yaml
--verbose-vShow the request and response on stderr. The key is hidden. The bodies are shown, so keep the output private
--no-updateSkip the automatic update check for this run
--spec-file <path>Build commands from a local OpenAPI file instead of the published one
--help-hHelp for any command
--versionPrint the CLI version

Environment variables

VariableWhat it does
ATLAS_API_KEYAPI key to use. Overrides the saved profile. No atlas login needed
ATLAS_BASE_URLAPI address. Overrides the profile’s base URL
ATLAS_NO_UPDATESet to 1 or true to skip the automatic update check
CISet to 1 or true (most CI systems do this) to skip the automatic update check
ATLAS_SPEC_FILESame as --spec-file

API commands

The CLI builds these from the Atlas API definition, so the list grows when the API does. They are there whether or not you are signed in. The CLI downloads the definition on first run and keeps a copy for 24 hours. If a refresh fails, it keeps using the copy it has. To download it again now:

atlas update-spec

Run atlas <resource> --help for the full list in your version. These are the main commands. Arguments in angle brackets are IDs.

Jobs (the campaign resource)

The API and the CLI call a job a campaign. In the Atlas app it is a job inside a department. Command names keep the API word.

atlas campaign get-all-campaigns
atlas campaign get-campaign <id>
atlas campaign create-campaign
atlas campaign update-campaign <id>
atlas campaign delete-campaign <id>
atlas campaign get-templates
atlas campaign set-campaign-status <id>
atlas campaign get-campaign-snapshots <campaignId>
atlas campaign get-campaign-calendars <campaignId>

Calls

atlas call get-call-records
atlas call get-call-record <id>
atlas call get-scheduled-calls <campaignId>

Statistics

atlas statistic get-all-campaigns-overview
atlas statistic get-campaign-overview <campaign_id>

Agents

atlas agent get-all-agents
atlas agent get-agents-by-campaign <campaignId>
atlas agent get-agent <campaignId> <id>

Contacts

atlas contact get-contacts <campaignId>
atlas contact get-global-contacts
atlas contact get-contact-count <campaign_id>
atlas contact get-contact-tokens <campaignId>

Knowledge base

atlas knowledge-base get-all-knowledge-files
atlas knowledge-base get-knowledge-files <campaignId>

Tools

atlas tool get-all-tools
atlas tool get-tool-templates
atlas tool get-tool-template-categories

Phone numbers

atlas phone-number get-all-phone-numbers
atlas phone-number get-phone-number <id>

Voices

atlas voice get-all-voices
atlas voice get-pangrams

Webhooks (the events-gateway resource)

atlas events-gateway events-get-campaign-triggers <campaignId>
atlas events-gateway events-subscribe-trigger --body '{"hookUrl": "https://example.com/atlas/webhook", "campaignId": "CAMPAIGN_ID", "triggerName": "call_completed", "provider": "custom"}'
atlas events-gateway events-unsubscribe-trigger --body '{"hookUrl": "https://example.com/atlas/webhook", "campaignId": "CAMPAIGN_ID", "triggerName": "call_completed", "provider": "custom"}'
atlas events-gateway events-get-sample-payload <triggerName> --campaignId <campaignId>

The signing-secret commands (events-get-webhook-signing-secret, events-rotate-webhook-signing-secret) are listed too, but their endpoints are not open yet. See Webhooks.

Other resources

atlas calendar-setting get-calendar-settings
atlas calls-forward get-call-forwards <campaignId>
atlas dashboard get-dashboard-stats
atlas dashboard get-deployment-stats
atlas account get-profile
atlas customer-quota get-customer-quota
atlas campaign-chat get-chat-sessions <campaignId>
atlas api-key get-api-keys

The other resources are booking and business-verification. Every endpoint in the API reference has a command.

Send data

For commands that create or change something, give the body as JSON.

Inline:

atlas api-key create-api-key --body '{"label": "CI runner"}'

From a file (JSON or YAML). Save this as subscribe.yaml:

hookUrl: https://example.com/atlas/webhook
campaignId: CAMPAIGN_ID
triggerName: call_completed
provider: custom

Then:

atlas events-gateway events-subscribe-trigger --from-file subscribe.yaml

Run <command> --help to see the body fields for any command and which are required.

If a field is a text field that holds JSON, you can give it as a normal object. The CLI turns it into text for you.

Commands that upload a raw file take --file <path> instead of a body.

Output

Output goes to stdout as JSON by default. Pick another format with --output (short: -o), or set output_format in ~/.atlas/config.

FormatUse it for
jsonScripts and agents. The default. Pipe it into tools like jq.
yamlReading by eye, config files.
tableQuick look at a list. Long values are cut at 50 characters.
atlas campaign get-all-campaigns -o table
atlas campaign get-all-campaigns | jq '.[].name'

For list endpoints, the CLI prints the rows from value directly. You get an array, without the wrapper.

To see exactly what the CLI sends and receives, add --verbose (short: -v). The request and response show on stderr. The key is hidden.

Shell completion

The macOS and Linux installer and the PowerShell installer set up tab completion for you. Restart your terminal after installing. The Command Prompt installer does not. To set it up by hand:

Zsh. Add to ~/.zshrc:

eval "$(atlas completion zsh)"

Bash. Add to ~/.bashrc:

eval "$(atlas completion bash)"

Fish:

atlas completion fish > ~/.config/fish/completions/atlas.fish

PowerShell. Add to your PowerShell profile:

atlas completion powershell | Out-String | Invoke-Expression

Exit codes

Every command exits with one of these codes. atlas help --json lists them under exit_codes.

CodeNameWhen
0okIt worked
2usageBad flag or argument, invalid JSON in --body, a file it can’t read, or atlas whoami with no key set up
3authThe API returned 401 or 403, or no API key is set for an API command
4clientThe API returned any other 4xx, such as 400, 404, 409 or 429
5serverThe API returned a 5xx, or the network failed (DNS, connect, TLS, timeout)

Errors go to stderr. With the default JSON output, an error is one JSON object. status and body are there when the API answered:

{"error":{"body":{"message":"Invalid or inactive Api-Key."},"code":"auth","exit_code":3,"message":"Invalid or inactive Api-Key.","status":401}}

With -o table or -o yaml, it is one line of text:

Error: unauthorized (401): Invalid or inactive Api-Key. | body: {"message":"Invalid or inactive Api-Key."}

Scripting and CI

The CLI runs without a person at the keyboard.

What you can count on

  • Results go to stdout as JSON. Errors go to stderr.
  • The exit code tells you the kind of failure. See Exit codes.
  • A request waits up to 90 seconds for the API, then fails with exit code 5.

What to know before you automate

  • Set ATLAS_API_KEY from your secret store. The CLI uses it directly, so you don’t need atlas login and no key is written to disk:

    export ATLAS_API_KEY="$YOUR_SECRET_VARIABLE"
    atlas campaign get-all-campaigns
  • If you do use atlas login on a shared or temporary runner, the key is saved in ~/.atlas/config. Remove it when the job ends with atlas logout.

  • The automatic update check is skipped when CI or ATLAS_NO_UPDATE is 1 or true, when stdout is not a terminal (for example when you pipe the output), and with --no-update. For a pinned build, install a fixed version from the release folder. See Install by hand.

  • List commands return one response. See Rate limits and pagination.

  • The API allows 100 requests a minute per key for each request method (GET, POST and so on). Add a pause in loops. A 429 exits with code 4.

Example: nightly export of call records

#!/usr/bin/env bash
set -euo pipefail
export ATLAS_API_KEY="$ATLAS_KEY_FROM_SECRETS"
atlas call get-call-records \
--campaignId "$CAMPAIGN_ID" \
--startDate "$(date -u -d 'yesterday' +%Y-%m-%dT%H:%M:%SZ)" \
--endDate "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o json > calls.json

--startDate and --endDate are filters from the call records endpoint. Run atlas call get-call-records --help to see every filter. The date -d form works on Linux. On macOS, use date -u -v-1d.

When something goes wrong

What you seeExit codeWhat to do
no API key configured: set ATLAS_API_KEY or run: atlas login --api-key <key>3Set ATLAS_API_KEY or run atlas login --api-key YOUR_API_KEY.
not logged in: set ATLAS_API_KEY or run: atlas login --api-key <key> (from atlas whoami)2Same as above.
unauthorized (401): Invalid or inactive Api-Key.3Your key is wrong or was deleted. Make a new key and sign in again.
invalid API key: ... when you run atlas login3The key was refused. Nothing was saved. Check the key in the Atlas app.
not found (404)4Check the ID. List the resource first.
API error (400)4The request is wrong. Read the details and body in the message.
API error (429)4You hit the rate limit. Wait, then retry.
server error (5xx) or network error5Wait and try again.
unknown flag or invalid JSON in --body2Fix the command. Run it with --help.
profile "..." not found or active profile "..." not found2Run atlas profile list, then atlas profile use NAME.
No commands besides the built-insThe CLI could not download the API definition. Check your connection, then run atlas update-spec.
A new endpoint is missingRun atlas update-spec.

More on status codes in Errors.

Using the CLI from an AI agent

Agents can use the CLI. Read Atlas for AI agents first. It covers safe use.