{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roark/json-schema/roark-create-my-api-key-input-schema.json",
  "title": "CreateMyApiKeyInput",
  "description": "A personal credential to mint for the caller",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/roark-me-api-openapi.yml#/components/schemas/CreateMyApiKeyInput",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "A label you will recognise later. It is the only thing that tells two credentials apart in the list you revoke from."
    },
    "projectId": {
      "type": "string",
      "description": "Project the credential assumes when a request sends no X-Roark-Project-Id header. Defaults to the calling credential's own default project. You must be an admin of whichever project is used."
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "READ",
          "WRITE"
        ]
      },
      "minItems": 1,
      "description": "Coarse tier. Defaults to the calling credential's own tier, and can never exceed it: a READ credential cannot mint a WRITE one."
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Granular 'resource:action' permissions. Defaults to the calling credential's own set, and can never exceed it. A ceiling, not an entitlement: the holder still only reaches what their project membership allows."
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 expiry. Defaults to the calling credential's own expiry (no expiry, for a `roark auth login` credential) and may not outlive it, so a short-lived connector credential cannot mint a permanent one."
    }
  },
  "required": [
    "name"
  ]
}