API tokens
ayx one token manages API-token resources for the active Alteryx One profile. Tokens are scoped to the authenticated caller. Creating and deleting tokens are mutating; add --apply to commit.
Two token concepts
Section titled “Two token concepts”Do not confuse these resources with the OAuth API access/refresh credential
used by ayx one login --auth-method oauth-refresh:
| Credential/resource | Used for | Lifecycle |
|---|---|---|
| OAuth2.0 API access/refresh pair | CLI authentication — the durable path for people, CI, and agents alike | Import the pair once; the CLI refreshes access tokens and persists rotated refresh tokens in the secure keyring |
ayx one token API-token resource |
Creating, listing, inspecting, and revoking API-token resources through the One API | Created and deleted explicitly; the returned secret is shown once and must be captured securely |
The two flows may have different scopes and issuance policies. A token created by this command is not automatically a replacement for an OAuth refresh token. Use Identity & auth for OAuth credential setup.
Quick reference
Section titled “Quick reference”| Command | What it does |
|---|---|
token list |
List API tokens for the current user |
token create --body <json> |
Create a new API token |
token detail <id> |
Show details for a specific token |
token delete <id> |
Delete a token |
Listing tokens
Section titled “Listing tokens”# List all tokens for the current userayx one token list
# Machine-readableayx -o json one token listtoken list takes no filter flags. Use jq to filter the JSON output.
Creating a token
Section titled “Creating a token”# Preview the requestayx one token create --body '{"name":"ci-bot","description":"..."}'
# Commitayx one token create \ --body '{"name":"ci-bot","description":"..."}' \ --applyThe token value is returned once at creation time. Store it immediately — it cannot be retrieved again.
Pass --profile <name> to create the token against a non-default environment.
Inspecting a token
Section titled “Inspecting a token”ayx one token detail <id>
# JSON for scriptingayx -o json one token detail <id>Pass --profile <name> to query a specific environment.
Deleting a token
Section titled “Deleting a token”Deleting a token immediately revokes it. Any automation using it will stop working.
# Previewayx one token delete <id>
# Commitayx one token delete <id> --apply --yes--yes skips the TTY confirmation, required in non-interactive scripts.
Automation patterns
Section titled “Automation patterns”# Audit: list all token IDs and namesayx -o json one token list \ | jq -r '.data[] | "\(.id)\t\(.name)"'
# Rotate: create new, then delete oldNEW_ID=$(ayx -o json one token create \ --body '{"name":"ci-bot-new"}' --apply \ | jq -r '.data.id')
# Store the new token value from that response, then:ayx one token delete <old-id> --apply --yesRelated
Section titled “Related”- Identity & auth
- Person — manage the users who own tokens
- Safety model