Overview
Create API Key
Create a company-scoped API key
POST
/
api
/
v1
/
api-keys
Create API Key
curl --request POST \
--url https://api.sequenzy.com/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"preset": "<string>",
"scopes": [
"<string>"
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/api-keys"
payload = {
"name": "<string>",
"preset": "<string>",
"scopes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', preset: '<string>', scopes: ['<string>']})
};
fetch('https://api.sequenzy.com/api/v1/api-keys', 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.sequenzy.com/api/v1/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'preset' => '<string>',
'scopes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"apiKey": {
"id": "key_abc123",
"name": "AI drafting agent",
"key": "seq_live_...",
"prefix": "seq_live_abcd",
"scopes": ["account:read", "subscribers:read", "emails:write"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 63,
"description": "3 of 63 current permissions are enabled."
},
"createdAt": "2026-05-01T10:30:00Z"
},
"message": "API key created successfully. Save this key securely - it cannot be retrieved later.",
"instructions": {
"envVariable": "SEQUENZY_API_KEY",
"example": "SEQUENZY_API_KEY=seq_live_...",
"note": "Add this to your .env file for the integration to work."
}
}
{
"error": "Unsupported API key permission preset"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "Failed to create API key"
}
Create a new company-scoped API key. The caller must have the
api_keys:manage permission. The plain key is returned only once, in this response.
When the caller is an account-scoped seq_user_ key, select the company with
the x-company-id header. The endpoint always creates the new key in the
authenticated request context; a companyId field in the JSON body is not a
supported selector.
Request
string
Human-readable key name. If omitted, Sequenzy creates a default integration
name.
string
Permission preset to apply when
scopes is omitted. Defaults to
full_access. Supported presets: full_access, read_only, agent_safe,
ai_drafting, data_ingest_safe, data_ingest_automations,
transactional_sender, marketing_sender. Full-access keys return a null
scopes value, which means all current and future permissions.string[]
Explicit permission scopes for the new key. If provided, this overrides
preset and must contain at least one supported scope.curl -X POST "https://api.sequenzy.com/api/v1/api-keys" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-company-id: company_abc123" \
-H "Content-Type: application/json" \
-d '{"name": "AI drafting agent", "scopes": ["account:read", "subscribers:read", "emails:write"]}'
Responses
{
"success": true,
"apiKey": {
"id": "key_abc123",
"name": "AI drafting agent",
"key": "seq_live_...",
"prefix": "seq_live_abcd",
"scopes": ["account:read", "subscribers:read", "emails:write"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 63,
"description": "3 of 63 current permissions are enabled."
},
"createdAt": "2026-05-01T10:30:00Z"
},
"message": "API key created successfully. Save this key securely - it cannot be retrieved later.",
"instructions": {
"envVariable": "SEQUENZY_API_KEY",
"example": "SEQUENZY_API_KEY=seq_live_...",
"note": "Add this to your .env file for the integration to work."
}
}
apiKey.permissions is the effective permission receipt for the stored key. For
full-access keys, apiKey.scopes is null, permissions.preset is
full_access, and permissions.fullAccess is true. If you explicitly send
every currently defined scope, the key remains a fixed custom selection and
does not automatically receive future permissions.{
"error": "Unsupported API key permission preset"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "Failed to create API key"
}
⌘I
Create API Key
curl --request POST \
--url https://api.sequenzy.com/api/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"preset": "<string>",
"scopes": [
"<string>"
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/api-keys"
payload = {
"name": "<string>",
"preset": "<string>",
"scopes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', preset: '<string>', scopes: ['<string>']})
};
fetch('https://api.sequenzy.com/api/v1/api-keys', 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.sequenzy.com/api/v1/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'preset' => '<string>',
'scopes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"apiKey": {
"id": "key_abc123",
"name": "AI drafting agent",
"key": "seq_live_...",
"prefix": "seq_live_abcd",
"scopes": ["account:read", "subscribers:read", "emails:write"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 63,
"description": "3 of 63 current permissions are enabled."
},
"createdAt": "2026-05-01T10:30:00Z"
},
"message": "API key created successfully. Save this key securely - it cannot be retrieved later.",
"instructions": {
"envVariable": "SEQUENZY_API_KEY",
"example": "SEQUENZY_API_KEY=seq_live_...",
"note": "Add this to your .env file for the integration to work."
}
}
{
"error": "Unsupported API key permission preset"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "Failed to create API key"
}