curl --request PATCH \
--url https://api.monid.ai/v1/api-keys/{label} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "ci-runner-renamed"
}
'import requests
url = "https://api.monid.ai/v1/api-keys/{label}"
payload = { "label": "ci-runner-renamed" }
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({label: 'ci-runner-renamed'})
};
fetch('https://api.monid.ai/v1/api-keys/{label}', 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.monid.ai/v1/api-keys/{label}",
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([
'label' => 'ci-runner-renamed'
]),
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.monid.ai/v1/api-keys/{label}"
payload := strings.NewReader("{\n \"label\": \"ci-runner-renamed\"\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.monid.ai/v1/api-keys/{label}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"ci-runner-renamed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/api-keys/{label}")
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 \"label\": \"ci-runner-renamed\"\n}"
response = http.request(request)
puts response.read_body{
"label": "ci-runner",
"keyPrefix": "monid_test_a1b2c3d4",
"owner": "<string>",
"createdBy": "USER#user_2abc",
"scopes": [
"runs:*",
"resources:*",
"wallet:read",
"topups:*",
"controls:read",
"api_keys:*"
],
"status": "ACTIVE",
"origin": "DASHBOARD",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedBy": "USER#user_2abc",
"lastUsedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}Update an API key
Updates an API key’s metadata (currently only the label).
curl --request PATCH \
--url https://api.monid.ai/v1/api-keys/{label} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "ci-runner-renamed"
}
'import requests
url = "https://api.monid.ai/v1/api-keys/{label}"
payload = { "label": "ci-runner-renamed" }
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({label: 'ci-runner-renamed'})
};
fetch('https://api.monid.ai/v1/api-keys/{label}', 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.monid.ai/v1/api-keys/{label}",
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([
'label' => 'ci-runner-renamed'
]),
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.monid.ai/v1/api-keys/{label}"
payload := strings.NewReader("{\n \"label\": \"ci-runner-renamed\"\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.monid.ai/v1/api-keys/{label}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"ci-runner-renamed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/api-keys/{label}")
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 \"label\": \"ci-runner-renamed\"\n}"
response = http.request(request)
puts response.read_body{
"label": "ci-runner",
"keyPrefix": "monid_test_a1b2c3d4",
"owner": "<string>",
"createdBy": "USER#user_2abc",
"scopes": [
"runs:*",
"resources:*",
"wallet:read",
"topups:*",
"controls:read",
"api_keys:*"
],
"status": "ACTIVE",
"origin": "DASHBOARD",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedBy": "USER#user_2abc",
"lastUsedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}Authorizations
Monid API key (Authorization: Bearer mk_...) or Clerk-issued JWT. Each operation lists the ONE scope an API key needs. {resource}:* grants every action on that resource; * grants everything; Clerk sessions hold *. Operations with an empty list need no scope. Scope catalog: GET /v1/api-keys/scopes.
Headers
Model driving the calling agent. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Agent harness or client making the call (e.g. a coding agent, an agent framework). Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Caller-side session identifier, so the calls of one agent session (discover → inspect → run → polling) can be correlated. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Path Parameters
Current label of the API key.
1"ci-runner"
Body
New label for the key.
1"ci-runner-renamed"
Response
Updated API key metadata (never the full key)
Human-readable label. Unique per workspace.
"ci-runner"
Display prefix of the key (e.g. "monid_test_a1b2c3d4...").
"monid_test_a1b2c3d4"
User id the key belongs to (bills to, listed under). Always a user; a child key inherits its parent's owner.
Who minted the key — USER#<id> (dashboard), API_KEY#<fingerprint> (another key), AEP#<did> (AEP grant) — an actor id: USER#<userId> (dashboard), API_KEY#<fingerprint> (another key), AEP#<did> (an enrolled agent), CLERK, SYSTEM.
"USER#user_2abc"
Scope grants: {resource}:{action} over runs, resources, wallet, topups, controls and api_keys with read/create/update/delete, plus {resource}:* and *. Catalog reads need no scope. Fixed at creation.
1*, runs:*, resources:*, wallet:*, topups:*, controls:*, api_keys:*, runs:create, runs:get, runs:list, runs:update, resources:read, resources:create, resources:update, resources:delete, wallet:read, wallet:update, topups:create, controls:read, controls:create, controls:update, controls:delete, api_keys:read, api_keys:create, api_keys:update, api_keys:revoke [
"runs:*",
"resources:*",
"wallet:read",
"topups:*",
"controls:read",
"api_keys:*"
]
ACTIVE, EXPIRED (derived from expiresAt) or REVOKED. Only ACTIVE keys authenticate.
ACTIVE, EXPIRED, REVOKED Channel the key was minted through — derived from createdBy: DASHBOARD, API, AEP or SYSTEM.
DASHBOARD, API, AEP, SYSTEM Creation time (ISO 8601).
Expiry (ISO 8601). Absent ⇒ never expires.
When the key was revoked. Present only when REVOKED.
Who revoked the key (present only when REVOKED) — an actor id: USER#<userId> (dashboard), API_KEY#<fingerprint> (another key), AEP#<did> (an enrolled agent), CLERK, SYSTEM.
"USER#user_2abc"
Last time the key authenticated a request. Absent if never used.