{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nowgetitdone-com/json-schema/nowgetitdone-com-created-api-key-schema.json",
  "title": "CreatedApiKey",
  "description": "A freshly minted API key, including its one-time plaintext secret.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nowgetitdone-com-openapi.yml#/components/schemas/CreatedApiKey",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable id of the key row."
    },
    "name": {
      "description": "Caller-given label.",
      "type": [
        "string",
        "null"
      ]
    },
    "key_prefix": {
      "description": "Non-secret fingerprint prefix shown in key lists (e.g. `gid_ab12`); never the full secret.",
      "type": [
        "string",
        "null"
      ]
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "workspaces:read",
          "tasks:read",
          "tasks:write",
          "members:read",
          "projects:read",
          "projects:write",
          "usage:read",
          "api-keys:manage",
          "webhooks:read",
          "webhooks:write",
          "destructive:run",
          "billing:manage",
          "account:manage",
          "team:manage",
          "connections:manage",
          "support:write"
        ]
      },
      "description": "Scopes granted to this key."
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "Last time this key authenticated a request, or null."
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "Expiry time, or null when the key never expires."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "description": "ISO-8601 UTC."
    },
    "legacy": {
      "type": "boolean",
      "description": "True for a pre-migration user-owned key; false for a current org-owned key. Legacy keys are read-only here — mint new keys as non-legacy."
    },
    "key": {
      "type": "string",
      "description": "The plaintext secret — shown EXACTLY ONCE. Store it now; it cannot be retrieved again."
    }
  },
  "required": [
    "id",
    "name",
    "key_prefix",
    "scopes",
    "last_used_at",
    "expires_at",
    "created_at",
    "legacy",
    "key"
  ],
  "additionalProperties": false
}