Skip to main content
Beta ProductSQL Proxy is currently in beta. API endpoints may change.
Token management endpoints allow you to create, list, and revoke authentication tokens. Token Types:
  • Principal Tokens - Tokens for users and service principals to authenticate to the proxy
  • Proxy Manager Tokens - Admin tokens for managing the proxy configuration
The full token is only returned at creation time. Store it securely - it cannot be retrieved later.

Endpoints

All token endpoints follow the same pattern:
Principal TypeBase Path
Users/admin/users/{user_id}/tokens
Service Principals/admin/service-principals/{client_id}/tokens
Proxy Manager/admin/proxy-manager/tokens
OperationMethodPath
List tokensGET{base_path}
Create tokenPOST{base_path}
Get tokenGET{base_path}/{token_id}
Revoke tokenDELETE{base_path}/{token_id}
Revoke all tokensDELETE{base_path} (users and service principals only)

List Tokens

Returns all tokens for a principal. Query parameter include_revoked=true includes revoked tokens.
curl -X GET \
  -H "Authorization: Bearer <proxy-manager-token>" \
  "https://sqlproxy.your-company.datafold.com/admin/users/{user_id}/tokens?include_revoked=false"

Create Token

curl -X POST \
  -H "Authorization: Bearer <proxy-manager-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "dbt production",
    "expires_in_days": 365
  }' \
  https://sqlproxy.your-company.datafold.com/admin/users/{user_id}/tokens

Request Body

FieldTypeRequiredDescription
labelstringNoToken label (default: “API created”)
expires_in_daysintegerNoToken expiration in days. null for no expiration.

Revoke Token

curl -X DELETE \
  -H "Authorization: Bearer <proxy-manager-token>" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Rotating credentials"}' \
  https://sqlproxy.your-company.datafold.com/admin/users/{user_id}/tokens/{token_id}

Request Body (Optional)

FieldTypeRequiredDescription
reasonstringNoReason for revocation

Revoke All Tokens

Revokes all active tokens for a user or service principal. Not available for proxy manager tokens.
curl -X DELETE \
  -H "Authorization: Bearer <proxy-manager-token>" \
  -H "Content-Type: application/json" \
  -d '{"reason": "User offboarding"}' \
  https://sqlproxy.your-company.datafold.com/admin/users/{user_id}/tokens

Token Response Fields

FieldTypeDescription
idintegerUnique token identifier
prefixstringToken prefix for identification (safe to log)
token_typestringprincipal or proxy_manager
labelstringUser-defined label
statusstringactive, expired, or revoked
use_countintegerNumber of times the token has been used
created_atstringISO 8601 timestamp
expires_atstringISO 8601 timestamp, or null if no expiration
last_used_atstringISO 8601 timestamp, or null if never used
revoked_atstringOnly present for revoked tokens
revoked_reasonstringOnly present for revoked tokens