POST /api/org/keys

A new API key, shown once. A key cannot make keys.

Surface: organisation. Who may call: organisation. Key: organisation.keys.create.

Example request

curl -X POST https://caremcp.com/api/org/keys \
  -H "Authorization: Bearer <session or access token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"production"}'

Example input

{
  "name": "production"
}

Input schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "name": {
   "type": "string",
   "minLength": 1,
   "maxLength": 60
  }
 },
 "required": [
  "name"
 ]
}

Output schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "id": {
   "type": "string"
  },
  "name": {
   "type": "string"
  },
  "prefix": {
   "type": "string"
  },
  "createdAt": {
   "type": "string"
  },
  "lastUsedAt": {
   "type": [
    "string",
    "null"
   ]
  },
  "revokedAt": {
   "type": [
    "string",
    "null"
   ]
  },
  "key": {
   "type": "string"
  }
 },
 "required": [
  "id",
  "name",
  "prefix",
  "createdAt",
  "lastUsedAt",
  "revokedAt",
  "key"
 ],
 "additionalProperties": false
}