## List Tokens `client.accounts.tokens.list(TokenListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/tokens` List all Account Owned API tokens created for this account. ### Parameters - `params: TokenListParams` - `account_id: string` Path param: Account identifier tag. - `direction?: "asc" | "desc"` Query param: Direction to order results. - `"asc"` - `"desc"` - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Maximum number of results per page. ### Returns - `Token` - `id?: string` Token identifier tag. - `condition?: Condition` - `request_ip?: RequestIP` Client IP restrictions. - `in?: Array` List of IPv4/IPv6 CIDR addresses. - `not_in?: Array` List of IPv4/IPv6 CIDR addresses. - `expires_on?: string` The expiration time on or after which the JWT MUST NOT be accepted for processing. - `issued_on?: string` The time on which the token was created. - `last_used_on?: string` Last time the token was used. - `modified_on?: string` Last time the token was modified. - `name?: string` Token name. - `not_before?: string` The time before which the token MUST NOT be accepted for processing. - `policies?: Array` List of access policies assigned to the token. - `id: string` Policy identifier. - `effect: "allow" | "deny"` Allow or deny operations against the resources. - `"allow"` - `"deny"` - `permission_groups: Array` A set of permission groups that are specified to the policy. - `id: string` Identifier of the permission group. - `meta?: Meta` Attributes associated to the permission group. - `key?: string` - `value?: string` - `name?: string` Name of the permission group. - `resources: Record | Record>` A list of resource names that the policy applies to. - `Record` - `Record>` - `status?: "active" | "disabled" | "expired"` Status of the token. - `"active"` - `"disabled"` - `"expired"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const token of client.accounts.tokens.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(token.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "ed17574386854bf78a67040be0a770b0", "condition": { "request_ip": { "in": [ "123.123.123.0/24", "2606:4700::/32" ], "not_in": [ "123.123.123.100/24", "2606:4700:4700::/48" ] } }, "expires_on": "2020-01-01T00:00:00Z", "issued_on": "2018-07-01T05:20:00Z", "last_used_on": "2020-01-02T12:34:00Z", "modified_on": "2018-07-02T05:20:00Z", "name": "readonly token", "not_before": "2018-07-01T05:20:00Z", "policies": [ { "id": "f267e341f3dd4697bd3b9f71dd96247f", "effect": "allow", "permission_groups": [ { "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value" }, "name": "Zone Read" }, { "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value" }, "name": "Magic Network Monitoring" } ], "resources": { "foo": "string" } } ], "status": "active" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ```