{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/taskbullet-com/json-schema/taskbullet-com-action-request-schema.json",
  "title": "ActionRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/taskbullet-com-api-openapi.json#/components/schemas/ActionRequest",
  "type": "object",
  "required": [
    "action_type",
    "recipients",
    "subject",
    "goal",
    "message",
    "consent_attestation",
    "deadline",
    "provider",
    "delegated_credential",
    "credential_scope",
    "credential_expires_at"
  ],
  "properties": {
    "action_type": {
      "type": "string",
      "enum": [
        "email"
      ]
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "subject": {
      "type": "string"
    },
    "goal": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "on_behalf_of": {
      "type": "string"
    },
    "consent_attestation": {
      "type": "boolean"
    },
    "deadline": {
      "type": "string",
      "format": "date-time"
    },
    "provider": {
      "type": "string",
      "enum": [
        "google",
        "gmail"
      ]
    },
    "delegated_credential": {
      "type": "object",
      "description": "Write-only one-time send credential. Never returned, logged, or sent to ops.",
      "required": [
        "access_token"
      ],
      "properties": {
        "access_token": {
          "type": "string"
        },
        "refresh_token": {
          "type": "string"
        }
      }
    },
    "credential_scope": {
      "type": "object",
      "required": [
        "recipients",
        "subject",
        "message"
      ],
      "properties": {
        "recipients": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subject": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "credential_expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "callback_url": {
      "type": "string",
      "format": "uri"
    }
  }
}