> 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.

# Create API Key

POST https://api.hellosign.com/v3/api_key
Content-Type: application/json

Creates a named API key on the specified account. The secret is returned only in this response.

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

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

### Query parameters

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

### Body (application/json)

This endpoint expects an AccountApiKeyCreateRequest.

- `name` (string, required) — Name for the API key. Must be unique on the account and at most 25 characters.

## Response

### 201

successful operation

- `api_key` (AccountApiKeyResponse, required)
- `warnings` (list of WarningResponse, optional) — A list of warnings.

## Errors

### 400 Client Request Error

failed_operation

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

## Types

### AccountApiKeyResponse

- `api_key_id` (string, required) — The ID of the API key.
- `account_id` (string, required) — The ID of the account that owns the API key.
- `name` (string, required) — The name of the API key.
- `secret` (string, required) — The API key secret. Returned only when the key is created.
- `is_primary` (boolean, required) — Whether this is the account's primary API key.
- `created_at` (integer, required) — When the API key was created, as a Unix timestamp.
- `updated_at` (integer, required) — When the API key was last updated, as a Unix timestamp.
- `last_used_at` (integer, optional, nullable) — When the API key was last used, as a Unix timestamp. `null` if the key has not been used.

### WarningResponse

A list of warnings.

- `warning_msg` (string, required) — Warning message
- `warning_name` (string, required) — Warning name

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

**Request**

```json
{
  "name": "Production"
}
```

**Response**

```json
{
  "api_key": {
    "api_key_id": "c3d4e5f6a7b8490c1d2e3f4a5b6c7d8e9f012345",
    "account_id": "ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97",
    "name": "Production",
    "secret": "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff",
    "is_primary": true,
    "created_at": 1735689600,
    "updated_at": 1735689600,
    "last_used_at": null
  },
  "warnings": []
}
```

**SDK Code**

```python Default Example
import requests

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

querystring = {"account_id":"ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97"}

payload = { "name": "Production" }
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring, auth=("<api_key>", ""))

print(response.json())
```

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

const options = {
  method: 'POST',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"name":"Production"}'
};

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

```go Default Example
package main

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

func main() {

	url := "https://api.hellosign.com/v3/api_key?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97"

	payload := strings.NewReader("{\n  \"name\": \"Production\"\n}")

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

	req.SetBasicAuth("<api_key>", "")
	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 Default Example
require 'uri'
require 'net/http'

url = URI("https://api.hellosign.com/v3/api_key?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<api_key>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Production\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.hellosign.com/v3/api_key?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")
  .basicAuth("<api_key>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Production\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hellosign.com/v3/api_key?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97', [
  'body' => '{
  "name": "Production"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<api_key>', ''],
]);

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

```csharp Default Example
using RestSharp;
using RestSharp.Authenticators;

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

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Production\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Default Example
import Foundation

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

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = ["name": "Production"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hellosign.com/v3/api_key?account_id=ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```