{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cooperemail-com/json-schema/cooperemail-com-api-key-create-schema.json",
  "title": "ApiKeyCreate",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cooperemail-com-openapi.yml#/components/schemas/ApiKeyCreate",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "username": {
      "type": "string",
      "description": "Signup only (no Bearer). Optional inbox local part. Omit it and Cooper picks box plus 8 hex characters."
    },
    "display_name": {
      "type": "string",
      "description": "Signup only (no Bearer). Optional From name for the first inbox."
    },
    "create_inbox": {
      "type": "boolean",
      "description": "Signup only (no Bearer). False skips the first inbox. Omit it, or pass true, and the call creates one."
    },
    "inbox_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "enum": [
          "inbox_read",
          "inbox_create",
          "inbox_update",
          "inbox_delete",
          "message_read",
          "message_send",
          "message_update",
          "message_delete",
          "draft_write",
          "draft_send",
          "webhook_read",
          "webhook_write",
          "domain_read",
          "domain_write",
          "list_read",
          "list_write",
          "owner_manage",
          "task_read",
          "task_reply",
          "key_read",
          "key_write",
          "workspace_manage",
          "billing_read",
          "billing_write"
        ]
      },
      "description": "Null or omitted means full access. Unknown names return 400 invalid_permission. draft_write creates, edits, and deletes drafts. draft_send sends a draft. Scheduling a draft (send_at) counts as sending and needs message_send or draft_send."
    },
    "ttl_hours": {
      "type": "number"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}