← Back to the studio

Postscript API reference

The editor and MCP tools share these endpoints. Checkout requires configured Stripe payments. Fulfillment is manual.

OpenAPI JSON · MCP tool schemas

GET /api/auth/status

Auth Status

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/auth/code

Auth Code

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AuthEmail"
        }
      }
    },
    "required": true
  }
}

POST /api/auth/verify

Auth Verify

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AuthVerify"
        }
      }
    },
    "required": true
  }
}

POST /api/auth/logout

Auth Logout

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/account

Account

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/account/export

Export Records

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/drafts/{draft_id}/archive

Archive Draft

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Version"
        }
      }
    }
  }
}

GET /api/site

Site Information

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/operator/backups

Backup Status

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/operator/backups

Create Backup

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/health

Health

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/catalog

Catalog

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/fonts/original-hand.ttf

Original Hand Browser Font

Parameters and request schema
{
  "parameters": [
    {
      "name": "revision",
      "in": "query",
      "required": false,
      "schema": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Revision"
      }
    }
  ],
  "requestBody": {}
}

POST /api/markdown/render

Render Markdown

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MarkdownBody"
        }
      }
    },
    "required": true
  }
}

GET /api/drafts

List Drafts

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/drafts

Create Draft

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateDraft"
        }
      }
    },
    "required": true
  }
}

POST /api/drafts/{draft_id}/copy

Copy Draft

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateDraft"
        }
      }
    }
  }
}

GET /api/drafts/{draft_id}

Read Draft

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {}
}

PATCH /api/drafts/{draft_id}

Update Draft

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UpdateDraft"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/artwork-library

Library Artwork

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/LibraryArtwork"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/attachments

Upload Attachment

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "$ref": "#/components/schemas/Body_upload_attachment_api_drafts__draft_id__attachments_post"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/attachments-base64

Upload Base64

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/FileUpload"
        }
      }
    }
  }
}

DELETE /api/drafts/{draft_id}/attachments/{file_id}

Delete Attachment

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    },
    {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "File Id"
      }
    },
    {
      "name": "version",
      "in": "query",
      "required": true,
      "schema": {
        "type": "integer",
        "title": "Version"
      }
    }
  ],
  "requestBody": {}
}

GET /api/files/{file_id}

Download File

Parameters and request schema
{
  "parameters": [
    {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "File Id"
      }
    }
  ],
  "requestBody": {}
}

GET /api/address-references

Address References

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/drafts/{draft_id}/address-references

Confirm Address References

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AddressConsent"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/preview

Create Preview

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Version"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/artwork-preview

Artwork Preview

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Version"
        }
      }
    }
  }
}

GET /api/previews/{preview_id}/files/{filename}

Preview File

Parameters and request schema
{
  "parameters": [
    {
      "name": "preview_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Preview Id"
      }
    },
    {
      "name": "filename",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Filename"
      }
    }
  ],
  "requestBody": {}
}

POST /api/drafts/{draft_id}/quote

Create Quote

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Version"
        }
      }
    }
  }
}

POST /api/drafts/{draft_id}/checkout

Checkout

Parameters and request schema
{
  "parameters": [
    {
      "name": "draft_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Draft Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Checkout"
        }
      }
    }
  }
}

GET /api/orders

List Orders

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/orders/{order_id}

Read Order

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {}
}

POST /api/payments/webhook

Payment Webhook

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/orders/{order_id}/payment-sync

Sync Payment

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {}
}

POST /api/orders/{order_id}/cancel

Cancel Order

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CancelOrder"
        }
      }
    }
  }
}

POST /api/operator/orders/{order_id}/refund

Refund Order

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/RefundOrder"
        }
      }
    }
  }
}

GET /api/payments/status

Payment Status

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/operator/orders/{order_id}/refund-sync

Sync Refund

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/RefundSync"
        }
      }
    }
  }
}

GET /api/operator/orders

Operator Orders

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/operator/archive

Archived Records

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/orders/{order_id}/status

Update Status

Parameters and request schema
{
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "title": "Order Id"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/StatusUpdate"
        }
      }
    }
  }
}

GET /api/agent/tools

Agent Tools

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/private/mcp

Mcp

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

GET /api/recovery/status

Status

Parameters and request schema
{
  "parameters": [],
  "requestBody": {}
}

POST /api/recovery/kit

Issue

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/IssueRecovery"
        }
      }
    },
    "required": true
  }
}

POST /api/recovery/claim

Claim

Parameters and request schema
{
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ClaimRecovery"
        }
      }
    },
    "required": true
  }
}

Shared model definitions

{
  "Address": {
    "properties": {
      "name": {
        "type": "string",
        "maxLength": 100,
        "title": "Name",
        "default": ""
      },
      "line1": {
        "type": "string",
        "maxLength": 120,
        "title": "Line1",
        "default": ""
      },
      "line2": {
        "type": "string",
        "maxLength": 100,
        "title": "Line2",
        "default": ""
      },
      "city": {
        "type": "string",
        "maxLength": 80,
        "title": "City",
        "default": ""
      },
      "state": {
        "type": "string",
        "maxLength": 2,
        "title": "State",
        "default": ""
      },
      "postal_code": {
        "type": "string",
        "maxLength": 10,
        "title": "Postal Code",
        "default": ""
      },
      "country": {
        "type": "string",
        "const": "US",
        "title": "Country",
        "default": "US"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "title": "Address"
  },
  "AddressConsent": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      },
      "approved": {
        "type": "boolean",
        "title": "Approved"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version",
      "approved"
    ],
    "title": "AddressConsent"
  },
  "AuthEmail": {
    "properties": {
      "email": {
        "type": "string",
        "maxLength": 254,
        "minLength": 3,
        "title": "Email"
      },
      "signup": {
        "type": "boolean",
        "title": "Signup",
        "default": false
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "email"
    ],
    "title": "AuthEmail"
  },
  "AuthVerify": {
    "properties": {
      "email": {
        "type": "string",
        "maxLength": 254,
        "minLength": 3,
        "title": "Email"
      },
      "code": {
        "type": "string",
        "maxLength": 10,
        "minLength": 6,
        "title": "Code"
      },
      "claim_guest_drafts": {
        "type": "boolean",
        "title": "Claim Guest Drafts",
        "default": false
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "email",
      "code"
    ],
    "title": "AuthVerify"
  },
  "Body_upload_attachment_api_drafts__draft_id__attachments_post": {
    "properties": {
      "file": {
        "type": "string",
        "contentMediaType": "application/octet-stream",
        "title": "File"
      },
      "kind": {
        "type": "string",
        "enum": [
          "pdf",
          "photo",
          "decoration"
        ],
        "title": "Kind"
      },
      "version": {
        "type": "integer",
        "title": "Version"
      }
    },
    "type": "object",
    "required": [
      "file",
      "kind",
      "version"
    ],
    "title": "Body_upload_attachment_api_drafts__draft_id__attachments_post"
  },
  "CancelOrder": {
    "properties": {
      "approved": {
        "type": "boolean",
        "title": "Approved"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "approved"
    ],
    "title": "CancelOrder"
  },
  "Checkout": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      },
      "quote_id": {
        "type": "string",
        "title": "Quote Id"
      },
      "preview_id": {
        "type": "string",
        "title": "Preview Id"
      },
      "approved": {
        "type": "boolean",
        "title": "Approved"
      },
      "idempotency_key": {
        "type": "string",
        "maxLength": 150,
        "minLength": 8,
        "title": "Idempotency Key"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version",
      "quote_id",
      "preview_id",
      "approved",
      "idempotency_key"
    ],
    "title": "Checkout"
  },
  "ClaimRecovery": {
    "properties": {
      "approved": {
        "type": "boolean",
        "title": "Approved"
      },
      "code": {
        "type": "string",
        "maxLength": 47,
        "minLength": 47,
        "title": "Code"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "approved",
      "code"
    ],
    "title": "ClaimRecovery"
  },
  "CreateDraft": {
    "properties": {
      "title": {
        "type": "string",
        "maxLength": 150,
        "title": "Title",
        "default": "Untitled letter"
      },
      "text": {
        "type": "string",
        "maxLength": 30000,
        "title": "Text",
        "default": ""
      },
      "content_type": {
        "type": "string",
        "enum": [
          "text",
          "markdown",
          "pdf"
        ],
        "title": "Content Type",
        "default": "text"
      },
      "paper": {
        "type": "string",
        "enum": [
          "classic",
          "ivory"
        ],
        "title": "Paper",
        "default": "classic"
      },
      "envelope": {
        "type": "string",
        "enum": [
          "white",
          "kraft"
        ],
        "title": "Envelope",
        "default": "white"
      },
      "style": {
        "type": "string",
        "enum": [
          "serif",
          "sans",
          "handwritten",
          "typewriter",
          "original_hand"
        ],
        "title": "Style",
        "default": "serif"
      },
      "recipient": {
        "$ref": "#/components/schemas/Address"
      },
      "sender": {
        "$ref": "#/components/schemas/Address"
      },
      "decorations": {
        "items": {
          "$ref": "#/components/schemas/Decoration"
        },
        "type": "array",
        "maxItems": 20,
        "title": "Decorations"
      },
      "pages": {
        "items": {
          "$ref": "#/components/schemas/PageContent"
        },
        "type": "array",
        "maxItems": 20,
        "title": "Pages"
      },
      "handwriting": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/HandwritingConfig"
          },
          {
            "type": "null"
          }
        ]
      },
      "original_hand": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OriginalHandConfig"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "additionalProperties": false,
    "type": "object",
    "title": "CreateDraft"
  },
  "Decoration": {
    "properties": {
      "id": {
        "type": "string",
        "maxLength": 100,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "title": "Id"
      },
      "file_id": {
        "type": "string",
        "maxLength": 100,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "title": "File Id"
      },
      "page": {
        "type": "integer",
        "maximum": 100.0,
        "minimum": 1.0,
        "title": "Page",
        "default": 1
      },
      "page_id": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          {
            "type": "null"
          }
        ],
        "title": "Page Id"
      },
      "page_offset": {
        "type": "integer",
        "maximum": 99.0,
        "minimum": 0.0,
        "title": "Page Offset",
        "default": 0
      },
      "x": {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.0,
        "title": "X"
      },
      "y": {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.0,
        "title": "Y"
      },
      "width": {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.02,
        "title": "Width"
      },
      "height": {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.02,
        "title": "Height"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "id",
      "file_id",
      "x",
      "y",
      "width",
      "height"
    ],
    "title": "Decoration"
  },
  "FileUpload": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      },
      "kind": {
        "type": "string",
        "enum": [
          "pdf",
          "photo",
          "decoration"
        ],
        "title": "Kind"
      },
      "name": {
        "type": "string",
        "maxLength": 150,
        "title": "Name"
      },
      "content_base64": {
        "type": "string",
        "maxLength": 14000000,
        "title": "Content Base64"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version",
      "kind",
      "name",
      "content_base64"
    ],
    "title": "FileUpload"
  },
  "HTTPValidationError": {
    "properties": {
      "detail": {
        "items": {
          "$ref": "#/components/schemas/ValidationError"
        },
        "type": "array",
        "title": "Detail"
      }
    },
    "type": "object",
    "title": "HTTPValidationError"
  },
  "HandwritingConfig": {
    "properties": {
      "seed": {
        "type": "string",
        "maxLength": 100,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "title": "Seed"
      },
      "engine_version": {
        "type": "string",
        "const": "joined-1",
        "title": "Engine Version",
        "default": "joined-1"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "seed"
    ],
    "title": "HandwritingConfig"
  },
  "IssueRecovery": {
    "properties": {
      "approved": {
        "type": "boolean",
        "title": "Approved"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "approved"
    ],
    "title": "IssueRecovery"
  },
  "LibraryArtwork": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      },
      "artwork_id": {
        "type": "string",
        "const": "bird_stamp",
        "title": "Artwork Id"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version",
      "artwork_id"
    ],
    "title": "LibraryArtwork"
  },
  "MarkdownBody": {
    "properties": {
      "text": {
        "type": "string",
        "maxLength": 30000,
        "title": "Text"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "text"
    ],
    "title": "MarkdownBody"
  },
  "OriginalHandConfig": {
    "properties": {
      "seed": {
        "type": "string",
        "maxLength": 100,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "title": "Seed"
      },
      "engine_version": {
        "type": "string",
        "const": "original-1",
        "title": "Engine Version",
        "default": "original-1"
      },
      "foundation_version": {
        "type": "string",
        "const": "study01-v1",
        "title": "Foundation Version",
        "default": "study01-v1"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "seed"
    ],
    "title": "OriginalHandConfig"
  },
  "PageContent": {
    "properties": {
      "id": {
        "type": "string",
        "maxLength": 100,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "title": "Id"
      },
      "text": {
        "type": "string",
        "maxLength": 30000,
        "title": "Text",
        "default": ""
      },
      "content_type": {
        "type": "string",
        "enum": [
          "text",
          "markdown"
        ],
        "title": "Content Type",
        "default": "text"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "id"
    ],
    "title": "PageContent"
  },
  "RefundOrder": {
    "properties": {
      "approved": {
        "type": "boolean",
        "title": "Approved"
      },
      "amount_cents": {
        "type": "integer",
        "exclusiveMinimum": 0.0,
        "title": "Amount Cents"
      },
      "idempotency_key": {
        "type": "string",
        "maxLength": 150,
        "minLength": 8,
        "title": "Idempotency Key"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "approved",
      "amount_cents",
      "idempotency_key"
    ],
    "title": "RefundOrder"
  },
  "RefundSync": {
    "properties": {
      "refund_id": {
        "type": "string",
        "maxLength": 150,
        "minLength": 4,
        "pattern": "^re_[A-Za-z0-9_]+$",
        "title": "Refund Id"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "refund_id"
    ],
    "title": "RefundSync"
  },
  "StatusUpdate": {
    "properties": {
      "status": {
        "type": "string",
        "enum": [
          "preparing",
          "printed",
          "mailed",
          "action_needed",
          "cancelled",
          "failed"
        ],
        "title": "Status"
      },
      "mailing_confirmed": {
        "type": "boolean",
        "title": "Mailing Confirmed",
        "default": false
      },
      "note": {
        "type": "string",
        "maxLength": 2000,
        "title": "Note",
        "default": ""
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "status"
    ],
    "title": "StatusUpdate"
  },
  "UpdateDraft": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 150
          },
          {
            "type": "null"
          }
        ],
        "title": "Title"
      },
      "text": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 30000
          },
          {
            "type": "null"
          }
        ],
        "title": "Text"
      },
      "content_type": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "text",
              "markdown",
              "pdf"
            ]
          },
          {
            "type": "null"
          }
        ],
        "title": "Content Type"
      },
      "paper": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "classic",
              "ivory"
            ]
          },
          {
            "type": "null"
          }
        ],
        "title": "Paper"
      },
      "envelope": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "white",
              "kraft"
            ]
          },
          {
            "type": "null"
          }
        ],
        "title": "Envelope"
      },
      "style": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "serif",
              "sans",
              "handwritten",
              "typewriter",
              "original_hand"
            ]
          },
          {
            "type": "null"
          }
        ],
        "title": "Style"
      },
      "recipient": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Address"
          },
          {
            "type": "null"
          }
        ]
      },
      "sender": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Address"
          },
          {
            "type": "null"
          }
        ]
      },
      "decorations": {
        "anyOf": [
          {
            "items": {
              "$ref": "#/components/schemas/Decoration"
            },
            "type": "array",
            "maxItems": 20
          },
          {
            "type": "null"
          }
        ],
        "title": "Decorations"
      },
      "pages": {
        "anyOf": [
          {
            "items": {
              "$ref": "#/components/schemas/PageContent"
            },
            "type": "array",
            "maxItems": 20
          },
          {
            "type": "null"
          }
        ],
        "title": "Pages"
      },
      "handwriting": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/HandwritingConfig"
          },
          {
            "type": "null"
          }
        ]
      },
      "original_hand": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/OriginalHandConfig"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version"
    ],
    "title": "UpdateDraft"
  },
  "ValidationError": {
    "properties": {
      "loc": {
        "items": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            }
          ]
        },
        "type": "array",
        "title": "Location"
      },
      "msg": {
        "type": "string",
        "title": "Message"
      },
      "type": {
        "type": "string",
        "title": "Error Type"
      },
      "input": {
        "title": "Input"
      },
      "ctx": {
        "type": "object",
        "title": "Context"
      }
    },
    "type": "object",
    "required": [
      "loc",
      "msg",
      "type"
    ],
    "title": "ValidationError"
  },
  "Version": {
    "properties": {
      "version": {
        "type": "integer",
        "minimum": 1.0,
        "title": "Version"
      }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
      "version"
    ],
    "title": "Version"
  }
}