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

# Export a ScreenJSON document to a screenplay format

> POST a ScreenJSON document (JSON or YAML) and receive the exported screenplay as a binary download.

The response's `Content-Type` and `Content-Disposition` are set based on the requested output format.

Max request body: **50 MB**.



## OpenAPI

````yaml /api-reference/cli/openapi.json post /export
openapi: 3.1.0
info:
  title: screenjson-cli REST API
  description: >-
    REST API exposed by `screenjson serve`. Wraps the same conversion, export,
    validation, and schema engine as the CLI.


    Start locally with `screenjson serve --host 0.0.0.0 --port 8080`.
  version: 1.0.0
  contact:
    name: ScreenJSON
    url: https://screenjson.com
servers:
  - url: http://localhost:8080
    description: Local development
  - url: https://api.try.screenjson.com
    description: Public demo API
security: []
paths:
  /export:
    post:
      tags:
        - Conversion
      summary: Export a ScreenJSON document to a screenplay format
      description: >-
        POST a ScreenJSON document (JSON or YAML) and receive the exported
        screenplay as a binary download.


        The response's `Content-Type` and `Content-Disposition` are set based on
        the requested output format.


        Max request body: **50 MB**.
      operationId: export
      parameters:
        - name: format
          in: query
          required: true
          description: Target format.
          schema:
            type: string
            enum:
              - fdx
              - fadein
              - fountain
              - pdf
              - json
              - yaml
        - name: lang
          in: query
          required: false
          description: >-
            Primary language tag (BCP 47) used to pick text from each language
            map.
          schema:
            type: string
            default: en
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: ScreenJSON document.
          application/yaml:
            schema:
              type: string
          application/x-yaml:
            schema:
              type: string
      responses:
        '200':
          description: Exported file
          headers:
            Content-Type:
              schema:
                type: string
              description: MIME type of the exported format.
            Content-Disposition:
              schema:
                type: string
              description: '`attachment; filename="<id>.<ext>"`.'
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Missing or unsupported format, or invalid document JSON/YAML
        '500':
          description: Export error

````