---
title: Verify Token
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Accounts](https://developers.cloudflare.com/api/go/resources/accounts)

[Tokens](https://developers.cloudflare.com/api/go/resources/accounts/subresources/tokens)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Verify Token

client.Accounts.Tokens.Verify(ctx, query) (\*[TokenVerifyResponse](<https://developers.cloudflare.com/api/go/resources/accounts#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/tokens/verify

Test whether a token works.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### ParametersExpand Collapse

<details>

<summary>

query TokenVerifyParams

</summary>

AccountID param.Field\[string]

Account identifier tag.

maxLength32

minLength32

<a href="#(resource)%20accounts.tokens%20%3E%20(method)%20verify%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20accounts.tokens%20%3E%20(method)%20verify%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type TokenVerifyResponse struct{…}

</summary>

ID string

Token identifier tag.

maxLength32

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Status TokenVerifyResponseStatus

Status of the token.

</summary>

One of the following:

const TokenVerifyResponseStatusActive TokenVerifyResponseStatus = "active"

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%200">Link to this property</a>

const TokenVerifyResponseStatusDisabled TokenVerifyResponseStatus = "disabled"

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%201">Link to this property</a>

const TokenVerifyResponseStatusExpired TokenVerifyResponseStatus = "expired"

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20status%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

ExpiresOn TimeOptional

The expiration time on or after which the JWT MUST NOT be accepted for processing.

formatdate-time

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20expires_on">Link to this property</a>

NotBefore TimeOptional

The time before which the token MUST NOT be accepted for processing.

formatdate-time

<a href="#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)%20%3E%20(property)%20not_before">Link to this property</a>

</details>

[Link to this property](<#(resource)%20accounts.tokens%20%3E%20(model)%20TokenVerifyResponse%20%3E%20(schema)>)

### Verify Token

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/accounts"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Accounts.Tokens.Verify(context.TODO(), accounts.TokenVerifyParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
```

200 example

```
{
  "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",
    "status": "active",
    "expires_on": "2020-01-01T00:00:00Z",
    "not_before": "2018-07-01T05:20:00Z"
  }
}
```

##### Returns Examples

200 example

```
{
  "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",
    "status": "active",
    "expires_on": "2020-01-01T00:00:00Z",
    "not_before": "2018-07-01T05:20:00Z"
  }
}
```