Update Token

Update an existing token.

/user/tokens/{identifier}

put

User API Tokens

user-api-tokens-update-token

Debug "planAvailability"

{
  "business": true,
  "enterprise": true,
  "free": true,
  "pro": true
}

Debug "tokenPermissions"

{
  "enum": [
    "com.cloudflare.api.token.update"
  ]
}

Debug "parameters"

[
  {
    "in": "path",
    "name": "identifier",
    "required": true,
    "schema": {}
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "allOf": [
          {
            "properties": {
              "condition": {
                "properties": {
                  "request.ip": {
                    "description": "Client IP restrictions.",
                    "example": {
                      "in": [
                        "123.123.123.0/24",
                        "2606:4700::/32"
                      ],
                      "not_in": [
                        "123.123.123.100/24",
                        "2606:4700:4700::/48"
                      ]
                    },
                    "properties": {
                      "in": {
                        "description": "List of IPv4/IPv6 CIDR addresses.",
                        "example": [
                          "199.27.128.0/21",
                          "2400:cb00::/32"
                        ],
                        "items": {
                          "description": "IPv4/IPv6 CIDR.",
                          "example": "199.27.128.0/21",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "not_in": {
                        "description": "List of IPv4/IPv6 CIDR addresses.",
                        "example": [
                          "199.27.128.0/21",
                          "2400:cb00::/32"
                        ],
                        "items": {
                          "description": "IPv4/IPv6 CIDR.",
                          "example": "199.27.128.0/21",
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "expires_on": {
                "description": "The expiration time on or after which the JWT MUST NOT be accepted for processing.",
                "example": "2020-01-01T00:00:00Z",
                "format": "date-time",
                "type": "string"
              },
              "id": {
                "description": "Token identifier tag.",
                "example": "ed17574386854bf78a67040be0a770b0",
                "maxLength": 32,
                "readOnly": true,
                "type": "string"
              },
              "issued_on": {
                "description": "The time on which the token was created.",
                "example": "2018-07-01T05:20:00Z",
                "format": "date-time",
                "readOnly": true,
                "type": "string"
              },
              "modified_on": {
                "description": "Last time the token was modified.",
                "example": "2018-07-02T05:20:00Z",
                "format": "date-time",
                "readOnly": true,
                "type": "string"
              },
              "name": {
                "description": "Token name.",
                "example": "readonly token",
                "maxLength": 120,
                "type": "string"
              },
              "not_before": {
                "description": "The time before which the token MUST NOT be accepted for processing.",
                "example": "2018-07-01T05:20:00Z",
                "format": "date-time",
                "type": "string"
              },
              "policies": {
                "description": "List of access policies assigned to the token.",
                "items": {
                  "oneOf": [
                    {
                      "properties": {
                        "effect": {
                          "description": "Allow or deny operations against the resources.",
                          "enum": [
                            "allow",
                            "deny"
                          ],
                          "example": "allow",
                          "type": "string"
                        },
                        "id": {
                          "description": "Policy identifier.",
                          "example": "f267e341f3dd4697bd3b9f71dd96247f",
                          "readOnly": true,
                          "type": "string"
                        },
                        "permission_groups": {
                          "description": "A set of permission groups that are specified to the policy.",
                          "example": [
                            {
                              "id": "c8fed203ed3043cba015a93ad1616f1f",
                              "name": "Zone Read"
                            },
                            {
                              "id": "82e64a83756745bbbb1c9c2701bf816b",
                              "name": "DNS Read"
                            }
                          ],
                          "items": {
                            "description": "A named group of permissions that map to a group of operations against resources.",
                            "properties": {
                              "id": {
                                "description": "Identifier of the group.",
                                "example": "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
                                "readOnly": true,
                                "type": "string"
                              },
                              "name": {
                                "description": "Name of the group.",
                                "example": "Load Balancers Write",
                                "readOnly": true,
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "resources": {
                          "description": "A list of resource names that the policy applies to.",
                          "example": {
                            "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*",
                            "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*"
                          },
                          "type": "object"
                        }
                      },
                      "required": [
                        "id",
                        "effect",
                        "resources",
                        "permission_groups"
                      ],
                      "title": "policy_with_permission_groups"
                    }
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "status": {
                "description": "Status of the token.",
                "enum": [
                  "active",
                  "disabled",
                  "expired"
                ],
                "example": "active",
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "status",
              "policies"
            ],
            "type": "object"
          }
        ]
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "items": {},
                          "type": "array"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "anyOf": [
                        {
                          "nullable": true,
                          "type": "object"
                        },
                        {
                          "nullable": true,
                          "type": "string"
                        }
                      ]
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "type": "object"
                }
              },
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Update Token response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "allOf": [
                    {
                      "properties": {
                        "errors": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "messages": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "items": {},
                              "type": "array"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "success": {
                          "description": "Whether the API call was successful",
                          "enum": [
                            true
                          ],
                          "example": true,
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "success",
                        "errors",
                        "messages",
                        "result"
                      ],
                      "type": "object"
                    },
                    {
                      "properties": {
                        "result": {
                          "anyOf": [
                            {
                              "nullable": true,
                              "type": "object"
                            },
                            {
                              "nullable": true,
                              "type": "string"
                            }
                          ]
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            {
              "properties": {
                "errors": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": [
                    {
                      "code": 7003,
                      "message": "No route for the URI"
                    }
                  ],
                  "minLength": 1
                },
                "messages": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": []
                },
                "result": {
                  "enum": [
                    null
                  ],
                  "nullable": true,
                  "type": "object"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    false
                  ],
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Update Token response failure"
  }
}

Debug "security"

[
  {
    "api_token": []
  }
]