{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-create-migration-request-schema.json",
  "title": "CreateMigrationRequest",
  "description": "`api_key` for SendGrid, Postmark, Mailgun and Resend; `aws_access_key_id`, `aws_secret_access_key` and `aws_region` for Amazon SES (`ses`).\n",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-openapi.yaml#/components/schemas/CreateMigrationRequest",
  "type": "object",
  "required": [
    "provider"
  ],
  "properties": {
    "provider": {
      "type": "string",
      "enum": [
        "sendgrid",
        "postmark",
        "mailgun",
        "resend",
        "ses"
      ],
      "description": "The provider to import from. `ses` is Amazon SES."
    },
    "api_key": {
      "type": "string",
      "writeOnly": true,
      "description": "Required for every provider except `ses`. SendGrid API key, Postmark server API token, or Mailgun private API key (read access is enough), or a Resend API key with Full access. Used for this request only; never stored.\n"
    },
    "account_api_key": {
      "type": "string",
      "writeOnly": true,
      "description": "Postmark only. The account API token, needed to import sending domains."
    },
    "region": {
      "type": "string",
      "enum": [
        "us",
        "eu"
      ],
      "default": "us",
      "description": "SendGrid and Mailgun only. Use `eu` for EU-region accounts."
    },
    "aws_access_key_id": {
      "type": "string",
      "writeOnly": true,
      "description": "Amazon SES only (required). Access key ID of an IAM user or role with the read-only import policy (ses:List* and ses:Get* calls for identities, templates, the suppression list and configuration sets). Used for this request only; never stored.\n"
    },
    "aws_secret_access_key": {
      "type": "string",
      "writeOnly": true,
      "description": "Amazon SES only (required). The secret access key. Used for this request only; never stored."
    },
    "aws_session_token": {
      "type": "string",
      "writeOnly": true,
      "description": "Amazon SES only. The session token, for temporary credentials (SSO or an assumed role)."
    },
    "aws_region": {
      "type": "string",
      "description": "Amazon SES only (required). The region to import, such as `us-east-1`. SES keeps identities, templates and suppressions per region: run one import per region.\n"
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "domains",
          "webhooks",
          "templates",
          "suppressions"
        ]
      },
      "description": "What to import. Defaults to all four. Ignored when `cursor` is set."
    },
    "dry_run": {
      "type": "boolean",
      "default": false,
      "description": "Preview without writing anything. Suppressions are counted from the first page of each list only (`suppressions.estimated: true`). Ignored when `cursor` is set.\n"
    },
    "cursor": {
      "type": "string",
      "description": "The `next_cursor` from the previous response, to continue the same import."
    }
  }
}