> ## 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.

# Convert a screenplay file to ScreenJSON

> Upload a screenplay in a supported writer format. The server returns the resulting ScreenJSON document as JSON.

Accepts either **multipart/form-data** with a `file` field, or a raw body with the format specified via query parameter.

Max request body: **50 MB**.



## OpenAPI

````yaml /api-reference/cli/openapi.json post /convert
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:
  /convert:
    post:
      tags:
        - Conversion
      summary: Convert a screenplay file to ScreenJSON
      description: >-
        Upload a screenplay in a supported writer format. The server returns the
        resulting ScreenJSON document as JSON.


        Accepts either **multipart/form-data** with a `file` field, or a raw
        body with the format specified via query parameter.


        Max request body: **50 MB**.
      operationId: convert
      parameters:
        - name: format
          in: query
          required: false
          description: >-
            Input format. Required when sending a raw body; auto-detected from
            filename when using multipart.
          schema:
            type: string
            enum:
              - fdx
              - fadein
              - fountain
              - pdf
              - json
              - yaml
        - name: lang
          in: query
          required: false
          description: Primary language tag (BCP 47). Defaults to `en`.
          schema:
            type: string
            default: en
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Screenplay source file.
                format:
                  type: string
                  enum:
                    - fdx
                    - fadein
                    - fountain
                    - pdf
                    - json
                    - yaml
                  description: Optional — auto-detected from filename.
                lang:
                  type: string
                  default: en
                  description: Primary BCP 47 language tag.
              required:
                - file
          application/octet-stream:
            schema:
              type: string
              format: binary
          text/plain:
            schema:
              type: string
              description: Raw Fountain text.
      responses:
        '200':
          description: ScreenJSON document
          content:
            application/json:
              schema:
                type: object
                description: A ScreenJSON document. See the Specification tab.
        '400':
          description: >-
            Bad request — missing file, unknown format, empty body, or payload
            too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Conversion error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error

````