> This page is for Developer.

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

# Delete Backend API Tokens

DELETE https://api-b2b.bigcommerce.com/api/io/auth/backend
Content-Type: application/json

Deletes an existing Server to Server API `authToken` by specifying its ID. You can get a token’s ID using the [Get All Server to Server Tokens](#get-all-server-to-server-tokens) endpoint. This endpoint cannot be used to delete a BigCommerce API `X-Auth-Token`.

**Note:**  Unlike most DELETE requests, the `id` value must be added to the request body instead of the parameters.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/management/authentication/delete-auth-backend

## Authentication

- `authToken` header (required) — Required to authenticate requests. Include the token in a header parameter called `authToken`.

## Request

### Body (application/json)

This endpoint expects an object.

- `id` (integer, required) — The internal ID for the API token.
- `email` (string, optional) — The email address associated with the user's account.
- `name` (string, optional) — The internal name assigned to the generated API token.

## Response

### 200

OK

- `code` (integer, optional, default: 200) — The HTTP Status code of the response.
- `data` (list of any, optional)
- `meta` (AuthBackendDeleteResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 404 Not Found Error

NOT FOUND

- `code` (integer, optional, default: 404) — The HTTP Status code of the response.
- `data` (AuthBackendDeleteResponsesContentApplicationJsonSchemaData, optional)
- `meta` (AuthBackendDeleteResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### AuthBackendDeleteResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional)

### AuthBackendDeleteResponsesContentApplicationJsonSchemaData

- `errMsg` (string, optional) — Message associated with the error.

## Examples

**Request**

```json
{
  "id": 123
}
```

**Response**

```json
{
  "code": 200,
  "data": [
    null
  ],
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-b2b.bigcommerce.com/api/io/auth/backend"

payload = { "id": 123 }
headers = {
    "authToken": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/io/auth/backend';
const options = {
  method: 'DELETE',
  headers: {authToken: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"id":123}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-b2b.bigcommerce.com/api/io/auth/backend"

	payload := strings.NewReader("{\n  \"id\": 123\n}")

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

	req.Header.Add("authToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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://api-b2b.bigcommerce.com/api/io/auth/backend")

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

request = Net::HTTP::Delete.new(url)
request["authToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": 123\n}"

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://api-b2b.bigcommerce.com/api/io/auth/backend")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": 123\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-b2b.bigcommerce.com/api/io/auth/backend', [
  'body' => '{
  "id": 123
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/io/auth/backend");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": 123\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["id": 123] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/io/auth/backend")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```