Skip to main content
DELETE
/
v2
/
customers
/
{customerId}
Delete a customer
curl --request DELETE \
  --url https://api.cdp.coinbase.com/platform/v2/customers/{customerId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.cdp.coinbase.com/platform/v2/customers/{customerId}"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.cdp.coinbase.com/platform/v2/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cdp.coinbase.com/platform/v2/customers/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.cdp.coinbase.com/platform/v2/customers/{customerId}"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.cdp.coinbase.com/platform/v2/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cdp.coinbase.com/platform/v2/customers/{customerId}")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "errorType": "invalid_request",
  "errorMessage": "Invalid request. Please check the request body and parameters."
}
{
"errorType": "unauthorized",
"errorMessage": "The request is not properly authenticated."
}
{
"errorType": "not_found",
"errorMessage": "Customer not found."
}
{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}
{
"errorType": "bad_gateway",
"errorMessage": "Bad gateway. Please try again later."
}
{
"errorType": "service_unavailable",
"errorMessage": "Service unavailable. Please try again later."
}

Authorizations

Authorization
string
header
required

A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the Generate Bearer Token section of our Authentication docs for information on how to generate your Bearer Token.

Headers

X-Idempotency-Key
string

An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our Idempotency docs for more information on using idempotency keys.

Required string length: 1 - 128

Path Parameters

customerId
string
required

The ID of the customer. The ID of the Customer, which is a UUID prefixed by customer_.

Pattern: ^customer_[a-f0-9\-]{36}$
Example:

"customer_af2937b0-9846-4fe7-bfe9-ccc22d935114"

Response

Customer deletion initiated successfully.