Overview
Update API Key
Rename a company API key or change its permissions in place
PATCH
/
api
/
v1
/
api-keys
/
{apiKeyId}
Update API Key
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/api-keys/{apiKeyId} \
--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/{apiKeyId}"
payload = {
"name": "<string>",
"preset": "<string>",
"scopes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{apiKeyId}', 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/{apiKeyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{apiKeyId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/api-keys/{apiKeyId}")
.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/{apiKeyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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": "Agent key",
"prefix": "seq_live_abcd",
"type": "company",
"scopes": ["account:read", "subscribers:read", "subscribers:tag"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 65,
"description": "3 of 65 current permissions are enabled."
},
"deviceName": null,
"lastUsedAt": "2026-08-04T09:12:00Z",
"createdAt": "2026-07-17T10:30:00Z",
"updatedAt": "2026-08-04T10:30:00Z",
"isCurrent": false
},
"message": "API key permissions updated. Added permissions apply on the next retry; removed permissions may take up to five minutes to expire across API instances."
}
{
"error": "Provide a name or permissions to update"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "API key not found"
}
Rename a company-scoped API key, replace its permissions, or both. The caller
must have the
Provide at least one of
api_keys:manage permission.
The key value does not change. Added permissions apply on the next retry, so use
this instead of issuing a replacement key when a call fails with a missing-scope
error. Removed permissions may remain usable for up to five minutes while API
caches expire.
preset and scopes replace the whole permission selection rather than
merging into it. Call List API Keys first and
send the full set you want.Request
string
required
Exact API key ID returned by the list API keys endpoint.
string
New human-readable key name.
string
Replacement permission preset:
full_access, read_only, agent_safe,
ai_drafting, data_ingest_safe, data_ingest_automations,
transactional_sender, or marketing_sender.string[]
Replacement explicit permission scopes. Overrides
preset when provided.name, preset, or scopes.
curl -X PATCH "https://api.sequenzy.com/api/v1/api-keys/key_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-company-id: company_abc123" \
-H "Content-Type: application/json" \
-d '{"preset": "agent_safe"}'
Responses
{
"success": true,
"apiKey": {
"id": "key_abc123",
"name": "Agent key",
"prefix": "seq_live_abcd",
"type": "company",
"scopes": ["account:read", "subscribers:read", "subscribers:tag"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 65,
"description": "3 of 65 current permissions are enabled."
},
"deviceName": null,
"lastUsedAt": "2026-08-04T09:12:00Z",
"createdAt": "2026-07-17T10:30:00Z",
"updatedAt": "2026-08-04T10:30:00Z",
"isCurrent": false
},
"message": "API key permissions updated. Added permissions apply on the next retry; removed permissions may take up to five minutes to expire across API instances."
}
The response returns metadata only. It never includes the plain key or stored
hash.
{
"error": "Provide a name or permissions to update"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "API key not found"
}
⌘I
Update API Key
curl --request PATCH \
--url https://api.sequenzy.com/api/v1/api-keys/{apiKeyId} \
--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/{apiKeyId}"
payload = {
"name": "<string>",
"preset": "<string>",
"scopes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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/{apiKeyId}', 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/{apiKeyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{apiKeyId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"preset\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sequenzy.com/api/v1/api-keys/{apiKeyId}")
.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/{apiKeyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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": "Agent key",
"prefix": "seq_live_abcd",
"type": "company",
"scopes": ["account:read", "subscribers:read", "subscribers:tag"],
"permissions": {
"preset": "custom",
"fullAccess": false,
"selectedScopeCount": 3,
"currentScopeCount": 65,
"description": "3 of 65 current permissions are enabled."
},
"deviceName": null,
"lastUsedAt": "2026-08-04T09:12:00Z",
"createdAt": "2026-07-17T10:30:00Z",
"updatedAt": "2026-08-04T10:30:00Z",
"isCurrent": false
},
"message": "API key permissions updated. Added permissions apply on the next retry; removed permissions may take up to five minutes to expire across API instances."
}
{
"error": "Provide a name or permissions to update"
}
{
"error": "Invalid API key"
}
{
"error": "API key is missing required scope: api_keys:manage"
}
{
"error": "API key not found"
}