{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roark/json-schema/roark-create-my-api-key-response-schema.json",
  "title": "CreateMyApiKeyResponse",
  "description": "The created credential, with its key",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/roark-me-api-openapi.yml#/components/schemas/CreateMyApiKeyResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Roark ID of the credential. Pass it to DELETE to revoke."
    },
    "name": {
      "type": "string",
      "description": "The label chosen when it was created"
    },
    "createdAt": {
      "type": "string",
      "description": "ISO 8601 timestamp"
    },
    "lastUsedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 timestamp, null if never used"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 timestamp, null if it never expires"
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "ACTIVE",
        "REVOKED"
      ]
    },
    "organizationId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The organization this credential is pinned to"
    },
    "defaultProjectId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The project a request acts on when it sends no X-Roark-Project-Id header. Null once that project is deleted."
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Coarse tier: READ, or WRITE for read and write"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Granted 'resource:action' permissions"
    },
    "key": {
      "type": "string",
      "description": "The credential value. Returned only here, only once."
    }
  },
  "required": [
    "id",
    "name",
    "createdAt",
    "lastUsedAt",
    "expiresAt",
    "status",
    "organizationId",
    "defaultProjectId",
    "scopes",
    "permissions",
    "key"
  ]
}