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

# List documents legacy



## OpenAPI

````yaml api-reference/v01.18.00/openapi-v01.18.00.json get /documents
openapi: 3.0.3
info:
  title: Firma Partner API
  description: >-
    RESTful API for document signing and template management.


    **Authentication**: All endpoints require API key authentication via the
    `Authorization` header. Use your API key directly without any prefix (e.g.,
    `your-api-key`). The Bearer prefix is optional but not required.


    **Security Features**:

    - Input validation using Zod schemas with detailed field-level error
    messages

    - RSA-256 signed JWT tokens for embedded template access


    **Rate Limiting**: Rate limits are tiered based on operation type:

    - Read operations (GET): 200 requests per minute

    - Write operations (POST/PUT/PATCH/DELETE): 120 requests per minute

    - Webhook CRUD operations: 60 requests per minute

    - Webhook test: 10 requests per minute

    - API key regeneration/expiration: 1 request per minute

    - Webhook secret rotation: 1 request per minute


    When rate limits are exceeded, the API returns a `429 Too Many Requests`
    response with headers:

    - `X-RateLimit-Limit`: Maximum requests per minute for this endpoint

    - `X-RateLimit-Remaining`: Requests remaining in current window

    - `X-RateLimit-Reset`: Unix timestamp when limit resets

    - `Retry-After`: Seconds until retry is allowed


    **Error Handling**: All errors return structured JSON responses with `error`
    (human-readable message), `code` (machine-readable identifier), and
    `details` (field-level validation errors when applicable).


    **Embedded Template Integration**: The Firma Template Editor can be embedded
    in your application using a standalone JavaScript library.


    ```html

    <!-- Load the Firma Template Editor library -->

    <script
    src="https://api.firma.dev/functions/v1/embed-proxy/template-editor.js"></script>


    <script>

    // Generate JWT token via API first

    fetch('https://api.firma.dev/functions/v1/signing-request-api/generate-template-token',
    {
      method: 'POST',
      headers: {
        'Authorization': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        companies_workspaces_templates_id: 'template-id'
      })
    })

    .then(res => res.json())

    .then(data => {
      // Initialize editor with JWT token
      window.FirmaTemplateEditor.init({
        container: '#firma-editor-container',
        jwt: data.token,
        templateId: 'template-id',
        theme: 'dark',
        readOnly: false,
        onSave: (savedData) => {
          console.log('Template saved:', savedData);
        },
        onError: (error) => {
          console.error('Editor error:', error);
        },
        onLoad: (template) => {
          console.log('Template loaded:', template);
        }
      });
    });

    ```
  version: 01.00.01
  contact:
    name: API Support
    url: https://firma.com/support
servers:
  - url: https://api.firma.dev/functions/v1/signing-request-api
    description: Production API - Recommended (Current)
  - url: https://api.firma.dev/api/v1
    description: Production API - Planned
security:
  - ApiKeyAuth: []
tags:
  - name: Company
    description: Company information and settings
  - name: Workspaces
    description: Workspace management operations
  - name: Templates
    description: Template management operations
  - name: Signing Requests
    description: Document signing request operations
  - name: Webhooks
    description: Webhook configuration and management
  - name: JWT Management
    description: JWT token generation and revocation for embedded templates
  - name: Workspace Settings
    description: Workspace configuration and settings
  - name: Legacy
    description: Deprecated endpoints maintained for backward compatibility
paths:
  /documents:
    get:
      tags:
        - Legacy
      summary: List documents (Legacy)
      description: >-
        **DEPRECATED**: Use `/signing-requests` instead. Legacy endpoint for
        listing signing requests.
      parameters:
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: Number of items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Documents retrieved successfully
          headers:
            X-Legacy-Endpoint:
              schema:
                type: string
              description: Indicates this is a legacy endpoint
            X-Deprecated:
              schema:
                type: string
              description: Deprecation notice
            X-RateLimit-Limit:
              schema:
                type: integer
              description: 'Rate limit: 200 requests per minute'
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining requests in current window
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix timestamp when rate limit resets
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/SigningRequest'
                  pagination:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
                      total_pages:
                        type: integer
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '429':
          $ref: '#/components/responses/RateLimitError'
      deprecated: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SigningRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the signing request
        name:
          type: string
          description: Signing request name
          maxLength: 255
        description:
          type: string
          nullable: true
          description: Signing request description
        document_url:
          type: string
          format: uri
          description: >-
            Pre-signed URL to the PDF document. This is a time-limited signed
            URL for secure access - see document_url_expires_at for expiration
            time. Initial URLs are valid for 7 days; refreshed URLs are valid
            for 1 hour. Request a new signing request retrieval to get a fresh
            URL if expired.
        document_url_expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 timestamp when the document_url will expire. After this
            time, the URL will return an access denied error. Fetch the signing
            request again to receive a fresh signed URL.
        document_page_count:
          type: integer
          minimum: 1
          description: Number of pages in the document
        status:
          type: string
          enum:
            - not_sent
            - in_progress
            - finished
            - cancelled
            - deleted
            - expired
          description: Current status of the signing request
        expiration_hours:
          type: integer
          minimum: 1
          default: 168
          description: 'Hours until signing request expires (default: 168 = 7 days)'
        settings:
          $ref: '#/components/schemas/SigningRequestSettings'
        template_id:
          type: string
          format: uuid
          nullable: true
          description: ID of template used to create this signing request
        date_created:
          type: string
          format: date-time
          description: Signing request creation timestamp
        date_sent:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the signing request was sent
        date_finished:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when all signatures were completed
        date_cancelled:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when signing request was cancelled
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: Expiration timestamp
        certificate:
          type: object
          nullable: true
          description: Certificate generation status information
          properties:
            generated:
              type: boolean
              description: Whether the final certificate PDF has been generated
            generated_on:
              type: string
              format: date-time
              nullable: true
              description: Timestamp when certificate was generated
            has_error:
              type: boolean
              description: Whether there was an error generating the certificate
        final_document_download_url:
          type: string
          format: uri
          nullable: true
          description: >-
            Signed URL to download the final signed document (PDF with
            certificate). Only available when signing request is finished and
            certificate has been generated. URL expires after 1 hour.
        final_document_download_error:
          type: string
          nullable: true
          enum:
            - file_not_accessible
            - null
          description: >-
            Error indicator if the final document exists but could not be
            accessed. Value is 'file_not_accessible' when the file path exists
            but the file is missing or inaccessible, otherwise null.
    SigningRequestSettings:
      type: object
      properties:
        allow_download:
          type: boolean
          description: Whether recipients can download the document
          default: true
        attach_pdf_on_finish:
          type: boolean
          description: Whether to attach PDF when signing is complete
          default: true
        allow_editing_before_sending:
          type: boolean
          description: Whether the signing request can be edited before sending
          default: false
        send_signing_email:
          type: boolean
          description: Whether to send signing request notification emails to signers
          default: true
        send_finish_email:
          type: boolean
          description: Whether to send completion email when all signers finish
          default: true
        send_expiration_email:
          type: boolean
          description: Whether to send expiration notification email when request expires
          default: true
        send_cancellation_email:
          type: boolean
          description: >-
            Whether to send cancellation notification email when request is
            cancelled
          default: true
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        message:
          type: string
          description: Detailed error description
        details:
          type: object
          description: Additional error details
          additionalProperties: true
  responses:
    UnauthorizedError:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
            message: Invalid API key
    RateLimitError:
      description: Too Many Requests - Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Maximum requests per minute
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests remaining
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix timestamp of reset
        Retry-After:
          schema:
            type: integer
          description: Seconds until retry allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Rate Limit Exceeded
            message: Too many requests. Please wait before retrying.
            details:
              retry_after: 45
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key for authentication. Use your API key directly without any prefix
        (e.g., 'your-api-key'). Bearer prefix is optional but not required.

````