> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paperjoy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a postcard

> Renders the handwritten side of a postcard as a PNG. Previews are free and never create an order. Requires the `postcards:write` ability.



## OpenAPI

````yaml /en/openapi.yaml post /api/postcards/preview
openapi: 3.1.0
info:
  title: Paperjoy API
  version: '2026-10-19'
  description: >-
    Create, preview, and track real handwritten postcards. The API key decides
    whether a request runs in test or live mode.
  termsOfService: https://paperjoy.co/regulamin
  license:
    name: Proprietary
    url: https://paperjoy.co/regulamin
servers:
  - url: https://paperjoy.co
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The authenticated account and its credit balance.
  - name: Postcards
    description: Create, preview, list, and retrieve postcards.
  - name: Signatures
    description: Custom handwritten signatures available to your organization.
paths:
  /api/postcards/preview:
    post:
      tags:
        - Postcards
      summary: Preview a postcard
      description: >-
        Renders the handwritten side of a postcard as a PNG. Previews are free
        and never create an order. Requires the `postcards:write` ability.
      operationId: previewPostcard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewPostcardRequest'
            example:
              content: |-
                Dear Anna,
                thank you for your first order!
              signature: Marta from the Linden Florist
              font_id: font-1
              mistake: false
      responses:
        '200':
          description: A PNG image of the card.
          content:
            image/png:
              schema:
                type: string
                contentEncoding: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    PreviewPostcardRequest:
      type: object
      required:
        - content
        - font_id
      properties:
        content:
          $ref: '#/components/schemas/Content'
        signature:
          $ref: '#/components/schemas/TypedSignature'
        signature_id:
          $ref: '#/components/schemas/SignatureIdInput'
        font_id:
          $ref: '#/components/schemas/FontId'
        mistake:
          $ref: '#/components/schemas/Mistake'
    Content:
      type: string
      maxLength: 300
      description: >-
        The handwritten message. Line breaks (`\n`) and blank lines are kept.
        The text must fit on the card; see the `card_fit` validation error.
    TypedSignature:
      type:
        - string
        - 'null'
      maxLength: 50
      description: >-
        A sign-off written on one line at the bottom of the card. Do not send
        together with `signature_id`.
    SignatureIdInput:
      type:
        - string
        - 'null'
      description: >-
        An active custom signature ID from `GET /api/signatures`. Requires a
        plan with custom signatures. Do not send together with `signature`.
      examples:
        - sig_ZeXOkSQjTp
    FontId:
      type: string
      enum:
        - font-1
        - font-2
      description: >-
        `font-1` is clear, rounded handwriting. `font-2` is a faster, joined-up
        cursive.
    Mistake:
      type: boolean
      default: false
      description: >-
        Cross out one word and write it again, like a real person would. The
        same message always gets the same correction.
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationError:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthorized:
      description: The API key is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Unauthenticated.
    Forbidden:
      description: >-
        The API key lacks the required ability, or the resource belongs to
        someone else.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: This action is unauthorized.
    ValidationError:
      description: >-
        A field is invalid, the text does not fit on the card or envelope, or
        the `Idempotency-Key` is longer than 255 characters.
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/Error'
          examples:
            field:
              summary: Invalid field
              value:
                message: The selected font id is invalid.
                errors:
                  font_id:
                    - The selected font id is invalid.
            card_fit:
              summary: Message does not fit on the card
              value:
                message: >-
                  The content does not fit on the postcard. Shorten it or remove
                  blank lines.
                errors:
                  content:
                    - >-
                      The content does not fit on the postcard. Shorten it or
                      remove blank lines.
            envelope_fit:
              summary: Address does not fit on the envelope
              value:
                message: The sender or recipient address does not fit on the envelope.
                errors:
                  address:
                    - >-
                      The sender or recipient address does not fit on the
                      envelope.
            draft_limit:
              summary: Too many open drafts
              value:
                message: >-
                  You already have 100 open drafts. Submit or delete some of
                  them before saving another draft.
                errors:
                  draft:
                    - >-
                      You already have 100 open drafts. Submit or delete some of
                      them before saving another draft.
            signature_unavailable:
              summary: Custom signature unavailable
              value:
                message: >-
                  The selected signature is unavailable or is not active for
                  your plan.
                errors:
                  signature_id:
                    - >-
                      The selected signature is unavailable or is not active for
                      your plan.
    TooManyRequests:
      description: A rate limit was exceeded. Wait before retrying.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Paperjoy API key. Keys starting with `pj_test_` use test mode; keys
        starting with `pj_live_` use live mode.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.