curl --request POST \
--url https://api.mnemom.ai/v1/orgs/{org_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"gateway",
"api:read",
"api:write"
]
}
'import requests
url = "https://api.mnemom.ai/v1/orgs/{org_id}/api-keys"
payload = {
"name": "<string>",
"scopes": ["gateway", "api:read", "api:write"]
}
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>', scopes: ['gateway', 'api:read', 'api:write']})
};
fetch('https://api.mnemom.ai/v1/orgs/{org_id}/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.mnemom.ai/v1/orgs/{org_id}/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>',
'scopes' => [
'gateway',
'api:read',
'api:write'
]
]),
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.mnemom.ai/v1/orgs/{org_id}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\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.mnemom.ai/v1/orgs/{org_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/orgs/{org_id}/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 \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_id": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"name": "<string>",
"org_id": "<string>",
"scopes": [
"gateway"
],
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Create organization API key
Create organization API key
curl --request POST \
--url https://api.mnemom.ai/v1/orgs/{org_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"gateway",
"api:read",
"api:write"
]
}
'import requests
url = "https://api.mnemom.ai/v1/orgs/{org_id}/api-keys"
payload = {
"name": "<string>",
"scopes": ["gateway", "api:read", "api:write"]
}
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>', scopes: ['gateway', 'api:read', 'api:write']})
};
fetch('https://api.mnemom.ai/v1/orgs/{org_id}/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.mnemom.ai/v1/orgs/{org_id}/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>',
'scopes' => [
'gateway',
'api:read',
'api:write'
]
]),
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.mnemom.ai/v1/orgs/{org_id}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\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.mnemom.ai/v1/orgs/{org_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mnemom.ai/v1/orgs/{org_id}/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 \"scopes\": [\n \"gateway\",\n \"api:read\",\n \"api:write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_id": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"name": "<string>",
"org_id": "<string>",
"scopes": [
"gateway"
],
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Supabase JWT token in Authorization: Bearer header
Path Parameters
Organization identifier (e.g. org-abc12345)
Body
Friendly name for the key (e.g., "ci-prod").
100Capability set for this org key (ADR-049). If omitted, the API substitutes the default. The caller is already verified as owner/admin of this org by the route's RBAC gate, so admin:org is implicit-eligible here; admin:platform still requires Mnemom-staff role.
Capability-based scope (ADR-049). gateway permits gateway-worker traffic; api:read and api:write permit identity-scoped GET and write endpoints respectively; admin:org permits org-admin operations on orgs the bearer owns/admins (per-request membership re-check); admin:platform permits /v1/admin/* Mnemom-staff operations (per-request staff-role re-check). The legacy api scope is accepted for backward compatibility and aliased to api:read + api:write at the auth gate; new keys should use the canonical vocabulary.
gateway, api:read, api:write, admin:org, admin:platform, api Response
Org API key created
Full secret key, only returned on creation
Capabilities granted to this key. Default for new keys is ["gateway", "api:read", "api:write"]. Admin scopes (admin:org, admin:platform) are opt-in and gated by the requester's role at mint time. See API Keys → Scope vocabulary.
Capability-based scope (ADR-049). gateway permits gateway-worker traffic; api:read and api:write permit identity-scoped GET and write endpoints respectively; admin:org permits org-admin operations on orgs the bearer owns/admins (per-request membership re-check); admin:platform permits /v1/admin/* Mnemom-staff operations (per-request staff-role re-check). The legacy api scope is accepted for backward compatibility and aliased to api:read + api:write at the auth gate; new keys should use the canonical vocabulary.
gateway, api:read, api:write, admin:org, admin:platform, api