> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Convert

> Convert documents between formats.

## Supported Conversions
- **DOCX → PDF**: Convert Word documents to PDF
- **Markdown → DOCX**: Convert Markdown to Word documents
- **HTML → DOCX**: Convert HTML to Word documents

## Examples
```bash
# Convert DOCX to PDF
curl -X POST "https://api.superdoc.dev/v1/convert?from=docx&to=pdf" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.docx" \
  -o output.pdf

# Convert Markdown to DOCX
curl -X POST "https://api.superdoc.dev/v1/convert?from=md&to=docx" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.md" \
  -o output.docx

# Convert HTML to DOCX
curl -X POST "https://api.superdoc.dev/v1/convert?from=html&to=docx" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.html" \
  -o output.docx
```

## Limitations
- File size: 25MB maximum
- Concurrent requests: 10 per API key



## OpenAPI

````yaml /openapi.json post /v1/convert
openapi: 3.0.3
info:
  title: SuperDoc API
  version: 0.9.0
  description: >-
    ## Quick Start


    1 - **Register**:
    https://api.superdoc.dev/v1/auth/register?email=you@email.com


    2 - **Verify**: Check email, then
    https://api.superdoc.dev/v1/auth/verify?email=you@email.com&code=123456


    3 - **Convert**

    ```bash

    curl -X POST https://api.superdoc.dev/v1/convert?from=docx \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -F "file=@document.docx" \
      -o converted.pdf
    ```



    Or use our Playground:

    https://api.superdoc.dev/docs/#tag/documents/post/v1/convert


    That's it! Your DOCX is now a PDF.


    ---


    [Status](https://status.superdoc.dev) •
    [GitHub](https://github.com/superdoc-dev/superdoc)
  contact:
    name: Support
    email: api@superdoc.dev
    url: https://superdoc.dev/contact-us
  license:
    name: Commercial
    url: https://superdoc.dev
servers:
  - url: https://api.superdoc.dev
    description: Production
security: []
tags:
  - name: Documents
    description: Document conversion and transformation
  - name: Authentication
    description: Registration and API key management
  - name: System
    description: Health and service information
paths:
  /v1/convert:
    post:
      tags:
        - Documents
      summary: Convert
      description: |-
        Convert documents between formats.

        ## Supported Conversions
        - **DOCX → PDF**: Convert Word documents to PDF
        - **Markdown → DOCX**: Convert Markdown to Word documents
        - **HTML → DOCX**: Convert HTML to Word documents

        ## Examples
        ```bash
        # Convert DOCX to PDF
        curl -X POST "https://api.superdoc.dev/v1/convert?from=docx&to=pdf" \
          -H "Authorization: Bearer YOUR_API_KEY" \
          -F "file=@document.docx" \
          -o output.pdf

        # Convert Markdown to DOCX
        curl -X POST "https://api.superdoc.dev/v1/convert?from=md&to=docx" \
          -H "Authorization: Bearer YOUR_API_KEY" \
          -F "file=@document.md" \
          -o output.docx

        # Convert HTML to DOCX
        curl -X POST "https://api.superdoc.dev/v1/convert?from=html&to=docx" \
          -H "Authorization: Bearer YOUR_API_KEY" \
          -F "file=@document.html" \
          -o output.docx
        ```

        ## Limitations
        - File size: 25MB maximum
        - Concurrent requests: 10 per API key
      operationId: convertDocument
      parameters:
        - schema:
            type: string
            enum:
              - docx
              - md
              - html
          in: query
          name: from
          required: true
          description: Format of the uploaded file
        - schema:
            type: string
            enum:
              - pdf
              - docx
            default: pdf
          in: query
          name: to
          required: false
          description: >-
            Target format for conversion. Defaults to PDF for backward
            compatibility
      responses:
        '200':
          description: Converted file
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
        '400':
          description: Standard error format used across all API endpoints
          content:
            application/json:
              schema:
                type: object
                title: Error Response
                description: Standard error format used across all API endpoints
                required:
                  - code
                  - error
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code for programmatic handling
                    example: VALIDATION_ERROR
                  error:
                    type: string
                    description: HTTP error category
                    example: Bad Request
                  message:
                    type: string
                    description: Human-readable error description
                    example: The provided document format is not supported
                  requestId:
                    type: string
                    description: Unique request ID for support
                    example: req_abc123
                  details:
                    type: array
                    description: Additional error details for validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field that caused the error
                        issue:
                          type: string
                          description: Description of the issue
                example:
                  code: INVALID_FILE_FORMAT
                  error: Bad Request
                  message: File is not a valid DOCX
                  requestId: req_abc123
        '401':
          description: Standard error format used across all API endpoints
          content:
            application/json:
              schema:
                type: object
                title: Error Response
                description: Standard error format used across all API endpoints
                required:
                  - code
                  - error
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code for programmatic handling
                    example: VALIDATION_ERROR
                  error:
                    type: string
                    description: HTTP error category
                    example: Bad Request
                  message:
                    type: string
                    description: Human-readable error description
                    example: The provided document format is not supported
                  requestId:
                    type: string
                    description: Unique request ID for support
                    example: req_abc123
                  details:
                    type: array
                    description: Additional error details for validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field that caused the error
                        issue:
                          type: string
                          description: Description of the issue
                example:
                  code: INVALID_FILE_FORMAT
                  error: Bad Request
                  message: File is not a valid DOCX
                  requestId: req_abc123
        '413':
          description: Standard error format used across all API endpoints
          content:
            application/json:
              schema:
                type: object
                title: Error Response
                description: Standard error format used across all API endpoints
                required:
                  - code
                  - error
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code for programmatic handling
                    example: VALIDATION_ERROR
                  error:
                    type: string
                    description: HTTP error category
                    example: Bad Request
                  message:
                    type: string
                    description: Human-readable error description
                    example: The provided document format is not supported
                  requestId:
                    type: string
                    description: Unique request ID for support
                    example: req_abc123
                  details:
                    type: array
                    description: Additional error details for validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field that caused the error
                        issue:
                          type: string
                          description: Description of the issue
                example:
                  code: INVALID_FILE_FORMAT
                  error: Bad Request
                  message: File is not a valid DOCX
                  requestId: req_abc123
        '429':
          description: Standard error format used across all API endpoints
          content:
            application/json:
              schema:
                type: object
                title: Error Response
                description: Standard error format used across all API endpoints
                required:
                  - code
                  - error
                  - message
                properties:
                  code:
                    type: string
                    description: Machine-readable error code for programmatic handling
                    example: VALIDATION_ERROR
                  error:
                    type: string
                    description: HTTP error category
                    example: Bad Request
                  message:
                    type: string
                    description: Human-readable error description
                    example: The provided document format is not supported
                  requestId:
                    type: string
                    description: Unique request ID for support
                    example: req_abc123
                  details:
                    type: array
                    description: Additional error details for validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field that caused the error
                        issue:
                          type: string
                          description: Description of the issue
                example:
                  code: INVALID_FILE_FORMAT
                  error: Bad Request
                  message: File is not a valid DOCX
                  requestId: req_abc123
      security:
        - apiKey: []
      x-code-samples:
        - lang: cURL
          label: Basic conversion
          source: |-
            curl -X POST https://api.superdoc.dev/v1/convert?from=docx \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -F "file=@document.docx" \
              -o output.pdf
        - lang: JavaScript
          label: Browser upload
          source: >-
            const formData = new FormData();

            formData.append('file', fileInput.files[0]);


            const response = await
            fetch('https://api.superdoc.dev/v1/convert?from=docx', {
              method: 'POST',
              headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
              body: formData
            });


            const pdf = await response.blob();

            downloadBlob(pdf, 'converted.pdf');
        - lang: Python
          label: Python requests
          source: |-
            import requests

            with open('document.docx', 'rb') as f:
                response = requests.post(
                    'https://api.superdoc.dev/v1/convert?from=docx',
                    headers={'Authorization': 'Bearer YOUR_API_KEY'},
                    files={'file': f}
                )
                
            with open('converted.pdf', 'wb') as pdf:
                pdf.write(response.content)
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication. Keys start with `sd_`

````