Skip to main content

Credentials API

API credentials may only be managed programmatically by a credential pair with the role auth, and may only rotate credential pairs with non-auth roles. auth credential pairs must be rotated manually in the Atomic Workbench. See authentication for more details.

A credential role of auth is required to utilize the Credentials API.

You can interact with the Credentials API using Insomnia (follow the Insomnia instructions) or curl. When using curl, you'll need to set up your Authentication first.

Detailed specs and examples for this API endpoint can be found in the Atomic API spec https://01.customer-api.atomic.io/spec.yaml.

API endpoints

Create a new API credential pair (token: auth)

PAYLOAD='{
"role": ("workbench" | "events") #choose one of the two
}'

# send request to Atomic
curl -X POST "https://$ORG_ID.customer-api.atomic.io/v1/$ENVIRONMENT_ID/credentials" \
--header "Content-Type:application/json" \
--header "Authorization: Bearer $TOKEN" \
--data "$PAYLOAD"

Returns client id and secret:

{
"data": {
"clientId": "...",
"clientSecret": "..."
}
}

Revoke a credential pair (token: auth)


CLIENT_ID="your-client-id"

# send request to Atomic
curl -X DELETE "https://$ORG_ID.customer-api.atomic.io/v1/$ENVIRONMENT_ID/credentials/$CLIENT_ID" \
--header "Content-Type:application/json" \
--header "Authorization: Bearer $TOKEN"

Returns the client id that was deleted:

{
"data": {
"clientId": "..."
}
}