> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://infonite.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://infonite.dev/_mcp/server.

# Revoke a token

DELETE https://clients.infonite.tech/api/executions/t10n/{token_id}

Revoke a token and mark the stored credentials for deletion.

Call it the moment a customer withdraws consent, closes their account with you, or asks you to stop — and after any suspicion that the pair leaked. It is immediate and it is not reversible: no execution can use the token afterwards.

* `204` — revoked.
* `304` — it was already revoked. Nothing changed.
* `404` — no such token for your application.

Revoking a token does not touch executions already run with it, nor the records they produced. Those are deleted with [Delete an Execution](api:DELETE/executions/handler/v1/\{execution_id}/delete).

> This endpoint needs to be executed with an app secret, so should always be used in server side without exposing the secret to customers.

Reference: https://infonite.dev/api-reference/direct-executions/direct-executions-api/tokenization/direct-executions-v-1-token-delete

## Authentication

- `X-APP-SECRET` header (required) — Application Secret

## Servers

- `https://clients.infonite.tech/api` (Legacy Server, default)
- `https://clients.infonite.io/api` (Production Server)

## Request

### Path parameters

- `token_id` (string, required) — The stored-credentials token, as the exchange returned it.

## Response

### 204

**204 No Content**Revoked. The token stops working immediately and the credentials it stood for are removed. **Executions already run with it, and the records they produced, are untouched** — those are deleted with the executions themselves. No body.

## Errors

### 404 Not Found Error

**404 Not Found**No token with that id for your application. The same answer as one that belongs to somebody else.

- `detail` (string, required) — Error message

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of object, optional)
  - `loc` (list of string or integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any, optional)
  - `ctx` (object, optional)

## Examples

**SDK Code**

```python
import requests

url = "https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d"

headers = {"X-APP-SECRET": "<apiKey>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d';
const options = {method: 'DELETE', headers: {'X-APP-SECRET': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-APP-SECRET", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["X-APP-SECRET"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d")
  .header("X-APP-SECRET", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d', [
  'headers' => [
    'X-APP-SECRET' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-APP-SECRET", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-APP-SECRET": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://clients.infonite.tech/api/executions/t10n/aaa48f1586c7ed54a13f559d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```