Workspace
Create a named workspace key
Mints a NAMED ps_workspace_ key (never the primary), returned only in this response. Owner or Admin (apikeys:rotate). The key is recorded as created by the account key’s user and is revoked if that user leaves the workspace. Up to 50 live (non-revoked) workspace keys per workspace, primary included (409 WORKSPACE_KEY_LIMIT_REACHED, with limit).
Requires an account key (ps_account_, created in Profile → API). Workspace keys, number keys and OAuth/MCP tokens get 403 ACCOUNT_KEY_REQUIRED. Sent with Cache-Control: no-store.
POST
/
v1
/
workspaces
/
{workspaceId}
/
api-keys
Create a named workspace key
curl --request POST \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Bakery Downtown"
}
'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys"
payload = { "name": "Bakery Downtown" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Bakery Downtown'})
};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/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://pilotstatus.com.br/v1/workspaces/{workspaceId}/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' => 'Bakery Downtown'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys"
payload := strings.NewReader("{\n \"name\": \"Bakery Downtown\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bakery Downtown\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Bakery Downtown\"\n}"
response = http.request(request)
puts response.read_body{
"apiKey": {
"id": "cmh2ab7770004ak8example9m",
"name": "Billing integration",
"key": "ps_workspace_4e8b0d2f6a1c3e5b7d9f0a2c4e6b8d0f1a3c5e7b9d0fa1c0",
"prefix": "ps_workspace_",
"last4": "a1c0",
"isPrimary": false,
"createdAt": "2026-10-28T09:15:00.000Z"
}
}{
"error": "The name is required | O nome é obrigatório",
"code": "NAME_REQUIRED"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires an account API key (ps_account_…), created in Profile → API. Workspace keys, number keys and OAuth tokens cannot use it | Este endpoint exige uma API key de conta (ps_account_…), criada em Perfil → API. Chaves de workspace, de número e tokens OAuth não podem usá-lo",
"code": "ACCOUNT_KEY_REQUIRED"
}{
"error": "This workspace already has 50 API keys, which is the limit | Este workspace já tem 50 API keys, que é o limite",
"code": "WORKSPACE_KEY_LIMIT_REACHED",
"limit": 50
}This mints a real key. The raw key comes only in this response — copy it before leaving the page.
Authorizations
apiKeyapiKeyId
Your ps_ API key
Path Parameters
Workspace id, from GET /v1/workspaces.
Body
application/json
1 to 60 characters, after trimming. Tells which integration holds the key.
Example:
"Bakery Downtown"
Response
Created — apiKey.key is returned only this once
Was this page helpful?
⌘I
Create a named workspace key
curl --request POST \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Bakery Downtown"
}
'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys"
payload = { "name": "Bakery Downtown" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Bakery Downtown'})
};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/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://pilotstatus.com.br/v1/workspaces/{workspaceId}/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' => 'Bakery Downtown'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys"
payload := strings.NewReader("{\n \"name\": \"Bakery Downtown\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bakery Downtown\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Bakery Downtown\"\n}"
response = http.request(request)
puts response.read_body{
"apiKey": {
"id": "cmh2ab7770004ak8example9m",
"name": "Billing integration",
"key": "ps_workspace_4e8b0d2f6a1c3e5b7d9f0a2c4e6b8d0f1a3c5e7b9d0fa1c0",
"prefix": "ps_workspace_",
"last4": "a1c0",
"isPrimary": false,
"createdAt": "2026-10-28T09:15:00.000Z"
}
}{
"error": "The name is required | O nome é obrigatório",
"code": "NAME_REQUIRED"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires an account API key (ps_account_…), created in Profile → API. Workspace keys, number keys and OAuth tokens cannot use it | Este endpoint exige uma API key de conta (ps_account_…), criada em Perfil → API. Chaves de workspace, de número e tokens OAuth não podem usá-lo",
"code": "ACCOUNT_KEY_REQUIRED"
}{
"error": "This workspace already has 50 API keys, which is the limit | Este workspace já tem 50 API keys, que é o limite",
"code": "WORKSPACE_KEY_LIMIT_REACHED",
"limit": 50
}