Create access token
POST https://datafa.st/api/v1/admin/access-tokens
Create a new
dft_ account token with specific permissions and optional website scope. The full token is returned once in the response — store it securely.You cannot grant permissions beyond what your own token has. Maximum 20 tokens per account.
Request
Body parameters
name"Production agent". Omit to store as null.permissions["*"]). Must not exceed your caller token — see permission list. Examples: read-only ["analytics:read", "websites:read"]; funnel manager ["funnels:read", "funnels:write", "websites:read"]; full access ["*"].websiteIds[] (default) for all websites on your account, or ObjectId strings to restrict. Get IDs from List websites. Example: ["665f0b3c4d2e1a0012345678"]. Cannot exceed your caller token scope.Example request body
{
"name": "Analytics read-only agent",
"permissions": ["analytics:read", "websites:read"],
"websiteIds": ["665f0b3c4d2e1a0012345678"]
}
What to pass in permissions
| If you want… | Pass this array |
|---|---|
| Read analytics and visitors | ["analytics:read", "websites:read"] |
| Send server-side goals | add "goals:write" |
| Record payments | add "payments:write" |
| Manage funnels | ["funnels:read", "funnels:write", "websites:read"] |
| Manage alerts | ["alerts:read", "alerts:write", "websites:read"] |
| Create other tokens / keys | add "api-keys:read" / "api-keys:write" |
| Everything | ["*"] or omit the field |
Valid strings:
analytics:read, goals:read, goals:write, payments:read, payments:write, identify:write, websites:read, websites:write, settings:read, settings:write, funnels:read, funnels:write, alerts:read, alerts:write, team:read, team:write, api-keys:read, api-keys:write, or "*".Full reference: authentication and scopes.
Response
Returns a JSON object with
status: "success" and endpoint-specific fields in data.Response fields
data[]._iddata[].namedata[].displayKeydata[].scopeuser.data[].permissions['*'] means full access. See permission list. Example: ['analytics:read', 'websites:read'].data[].websiteIds[] means all websites on the account. Example: ['665f0b3c4d2e1a0012345678'].data[].lastUsedAtdata[].createdAtdata[].keyAuthentication
Requires a
dft_ account token with api-keys:write. Website API keys (df_) cannot call this endpoint because it manages account-level resources.Create tokens in Account settings → API.
Errors
400 — Invalid permissions or token limit reached (max 20).
403 — Requested scope exceeds caller token permissions.
See API errors for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.