UserUser API Tokens

Update Token

PUT
Update an existing token.

Path parameters

identifieranyRequired

Request

This endpoint expects an object.
id
stringRequired
Token identifier tag.
name
stringRequired
Token name.
policies
list of objectsRequired
List of access policies assigned to the token.
status
enumRequired
Status of the token.
Allowed values: activedisabledexpired
condition
objectOptional
expires_on
datetimeOptional
The expiration time on or after which the JWT MUST NOT be accepted for processing.
issued_on
datetimeOptional
The time on which the token was created.
modified_on
datetimeOptional
Last time the token was modified.
not_before
datetimeOptional
The time before which the token MUST NOT be accepted for processing.

Response

This endpoint returns an object
result
map from strings to anyOptional
PUT
1curl -X PUT https://api.cloudflare.com/client/v4/user/tokens/string \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "id": "ed17574386854bf78a67040be0a770b0",
6 "name": "readonly token",
7 "policies": [
8 {
9 "effect": "allow",
10 "id": "f267e341f3dd4697bd3b9f71dd96247f",
11 "permission_groups": [
12 {
13 "id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
14 "name": "Load Balancers Write"
15 }
16 ],
17 "resources": {
18 "string": "string"
19 }
20 }
21 ],
22 "status": "active",
23 "condition": {
24 "request.ip": {
25 "in": [
26 "199.27.128.0/21"
27 ],
28 "not_in": [
29 "199.27.128.0/21"
30 ]
31 }
32 },
33 "expires_on": "2020-01-01T00:00:00Z",
34 "issued_on": "2018-07-01T05:20:00Z",
35 "modified_on": "2018-07-02T05:20:00Z",
36 "not_before": "2018-07-01T05:20:00Z"
37}'
200Updated
1{}