PHP Client for Cloudflare API
User

Tokens

Tokens endpoint reference.

List

List all API tokens created for this user.

ParamTypeRequiredDefaultDescription
paramsarrayNo[]Array containing the necessary params.
php
$response = $client->user()->tokens()->list([]);
View this operation on the Cloudflare API Reference

Create

Create a new API token.

ParamTypeRequiredDefaultDescription
valuesarrayYesToken values, requires name and policies.
php
$response = $client->user()->tokens()->create([]);
View this operation on the Cloudflare API Reference

Get

Get information about a specific API token.

ParamTypeRequiredDefaultDescription
tokenIdstringYesToken identifier.
php
$response = $client->user()->tokens()->get('TOKEN_ID');
View this operation on the Cloudflare API Reference

Update

Update an existing token.

ParamTypeRequiredDefaultDescription
tokenIdstringYesToken identifier.
valuesarrayYesToken values, e.g. name, policies, condition, status.
php
$response = $client->user()->tokens()->update('TOKEN_ID', []);
View this operation on the Cloudflare API Reference

Delete

Destroy an API token.

ParamTypeRequiredDefaultDescription
tokenIdstringYesToken identifier.
php
$response = $client->user()->tokens()->delete('TOKEN_ID');
View this operation on the Cloudflare API Reference

Verify

Test whether a token works.

php
$response = $client->user()->tokens()->verify();
View this operation on the Cloudflare API Reference
Copyright © 2026