---
title: Delete Token
---

[Skip to content](#_top)

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

[User](https://developers.cloudflare.com/api/go/resources/user)

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

Copy Markdown

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

---

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

# Delete Token

client.User.Tokens.Delete(ctx, tokenID) (\*[TokenDeleteResponse](<https://developers.cloudflare.com/api/go/resources/user#(resource)%20user.tokens%20%3E%20(model)%20TokenDeleteResponse%20%3E%20(schema)>), error)

DELETE/user/tokens/{token\_id}

Destroy a token.

##### 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`

##### Accepted Permissions (at least one required)

`API Tokens Write`

##### ParametersExpand Collapse

tokenID string

Token identifier tag.

maxLength32

[Link to this property](<#(resource)%20user.tokens%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20token_id%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

type TokenDeleteResponse struct{…}

</summary>

ID string

Identifier

maxLength32

minLength32

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

</details>

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

### Delete Token

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  token, err := client.User.Tokens.Delete(context.TODO(), "ed17574386854bf78a67040be0a770b0")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", token.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": "023e105f4ecef8ad9ca31a8372d0c353"
  }
}
```

##### 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": "023e105f4ecef8ad9ca31a8372d0c353"
  }
}
```