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

# Delete API Key

DELETE https://api.hellosign.com/v3/api_key/{api_key_id}

Deletes an API key. The primary key cannot be deleted. Promote another key first.

Reference: https://developers.hellosign.com/api/api-keys/delete

## Authentication

- `Authorization` header (basic auth, required) — Use your API key with HTTP Basic authentication in the form `Basic <api_key>`. See [Authentication](/api/reference/authentication) for more information. ✅ Supported by Try it console (calls sent in `test_mode` only).
- `Authorization` header (bearer token, required) — You can use an Access Token issued through an OAuth flow to send calls to the Dropbox Sign API from your app. The access scopes required by this endpoint are listed in the gray box above. See [Authentication](/api/reference/authentication) for more information. ❌ **Not supported** by Try it console.

## Request

### Path parameters

- `api_key_id` (string, required) — The ID of the API key to delete.

### Query parameters

- `account_id` (string, optional) — The ID of the account that owns the API key. Defaults to the authenticated account when omitted.

## Response

### 204

successful operation

## Errors

### 400 Client Request Error

failed_operation

- `error` (ErrorResponseError, required) — Contains information about an error that occurred.

## Types

### ErrorResponseError

Contains information about an error that occurred.

- `error_msg` (string, required) — Message describing an error.
- `error_name` (string, required) — Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance.
- `error_path` (string, optional) — Path at which an error occurred.

## Examples

**SDK Code**

```python
import requests

url = "https://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345"

querystring = {"account_id":"ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97"}

response = requests.delete(url, params=querystring, auth=("<api_key>", ""))

print(response.json())
```

```javascript
const url = 'https://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97';
const credentials = btoa("<api_key>:");

const options = {method: 'DELETE', headers: {Authorization: `Basic ${credentials}`}};

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://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97"

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

	req.SetBasicAuth("<api_key>", "")

	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.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")

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

request = Net::HTTP::Delete.new(url)
request.basic_auth("<api_key>", "")

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.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")
  .basicAuth("<api_key>", "")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97', [
  'headers' => [
  ],
    'auth' => ['<api_key>', ''],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97");
client.Authenticator = new HttpBasicAuthenticator("<api_key>", "");
var request = new RestRequest(Method.DELETE);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<api_key>:".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/api_key/c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")! 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()
```