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

# Rework a request

> Create a new `pending` request for the same matter, pre-filled from an approved (`completed`) request, typically one whose document quality control rejected (`workflowStatus: qc_rejected`). The new request carries over the source's templates, exhibits, entered field values, notes and priority, so rework starts where you left off. The firm, legal matter and redaction payload come from the account's current state, as they do for a new request. The source request is not changed.

Only template requests can be reworked, and only while the source's document has not finished its workflow: a request whose `workflowStatus` is `completed` or `rejected` returns `FILE_REQUEST_NOT_REWORKABLE`. If the matter already has a pending request, nothing is created and `DUPLICATE_FILE_REQUEST` is returned. The new request belongs to the source request's owner, and your token must be allowed to create requests for that owner.




## OpenAPI

````yaml /api-reference/files/openapi.yaml post /v1/requests/{requestId}/rework
openapi: 3.0.0
info:
  title: Files & Requests API
  version: 1.2.0
  description: >
    Manage evidence and claims requests, attach exhibits, fill state-specific
    templates, generate PDF files, run PDF redaction jobs, and store and
    retrieve a matter's files and media.
  contact:
    name: Slate API Support
    email: api-support@slate.inc
    url: https://slate.inc
servers:
  - url: https://api.slate.inc/files
    description: Production
  - url: https://api.uat.slate.inc/files
    description: UAT (staging)
security:
  - bearerAuth: []
tags:
  - name: Requests
    description: Create, read, update, and generate evidence and claims requests
  - name: Exhibits
    description: Upload, download, and delete exhibits
  - name: Files
    description: Files and media associated with a matter
  - name: Redactions
    description: Asynchronous PDF redaction jobs
  - name: Bulk Downloads
    description: Asynchronous bulk download jobs
paths:
  /v1/requests/{requestId}/rework:
    parameters:
      - $ref: '#/components/parameters/requestId'
    post:
      tags:
        - Requests
      summary: Rework a request
      description: >
        Create a new `pending` request for the same matter, pre-filled from an
        approved (`completed`) request, typically one whose document quality
        control rejected (`workflowStatus: qc_rejected`). The new request
        carries over the source's templates, exhibits, entered field values,
        notes and priority, so rework starts where you left off. The firm, legal
        matter and redaction payload come from the account's current state, as
        they do for a new request. The source request is not changed.


        Only template requests can be reworked, and only while the source's
        document has not finished its workflow: a request whose `workflowStatus`
        is `completed` or `rejected` returns `FILE_REQUEST_NOT_REWORKABLE`. If
        the matter already has a pending request, nothing is created and
        `DUPLICATE_FILE_REQUEST` is returned. The new request belongs to the
        source request's owner, and your token must be allowed to create
        requests for that owner.
      operationId: reworkRequest
      responses:
        '201':
          description: The new pending request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Request'
        '400':
          description: >
            The request cannot be reworked (`FILE_REQUEST_NOT_REWORKABLE`), the
            matter already has a pending request (`DUPLICATE_FILE_REQUEST`), or
            the account no longer has a valid matter (`INVALID_MATTER_ID`,
            `MATTER_NOT_FOUND`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized or invalid permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Request not found or you do not have permission to access it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    requestId:
      in: path
      name: requestId
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Request:
      type: object
      required:
        - id
        - matterId
        - owner
        - exhibits
        - templates
        - status
      properties:
        id:
          type: string
          format: uuid
        state:
          type: string
        matterId:
          type: string
        crid:
          type: string
        owner:
          type: string
        status:
          $ref: '#/components/schemas/FileRequestStatus'
        priority:
          type: integer
        createdOn:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        completedBy:
          type: string
          minLength: 1
        completedOn:
          type: string
          format: date-time
        rejectedBy:
          type: string
          minLength: 1
        rejectedOn:
          type: string
          format: date-time
        processingBy:
          type: string
          minLength: 1
        processingStartedOn:
          type: string
          format: date-time
        firmCode:
          type: string
          deprecated: true
          description: >
            Deprecated: use firmId going forward. The snapshotted service firm
            code for the firm handling this matter, taken at creation time.
        firmId:
          type: string
          description: >
            The snapshotted service firm UUID for the firm handling this matter,
            taken at creation time.
        workflowStatus:
          $ref: '#/components/schemas/FileRequestWorkflowStatus'
        signatureRequestId:
          type: string
          format: uuid
          description: >
            The signature request raised for this file request, once one exists.
            Use it with `GET /v2/requests/{signatureRequestId}` on the
            Signatures API.
        qualityCheckRequestId:
          type: string
          format: uuid
          description: >
            The quality check request raised for this file request, once one
            exists. Use it with `GET /v2/qc/requests/{qcrID}` on the Quality
            Control API.
        signedFileId:
          type: string
          format: uuid
          description: >
            The signed document saved to the CRID, once Slate has created it.
            Its presence alone does not mean the workflow finished — read
            `workflowStatus` for that.
        signedOn:
          type: string
          format: date-time
          description: >
            When the document was signed, by whichever route: an e-signature
            ceremony completing, a wet-ink mark where QC comes before signing,
            or a signed wet-ink scan being uploaded where QC comes after
            signing.
        qcApprovedOn:
          type: string
          format: date-time
          description: When quality control approved the document.
        requestedFields:
          type: array
          items:
            type: object
            properties:
              templateId:
                type: string
              fields:
                type: array
                items:
                  $ref: '#/components/schemas/RequestedField'
        filledFields:
          type: array
          description: >
            The effective value of every template field, resolved when the
            request is read: an override if one was set, otherwise the account's
            current value, otherwise the template's default. This is what the
            generated document will render.
          items:
            type: object
            properties:
              templateId:
                type: string
              fields:
                type: array
                items:
                  type: object
                  properties:
                    key:
                      type: string
                    value:
                      type: string
        exhibits:
          type: array
          items:
            $ref: '#/components/schemas/Exhibit'
        generatedFile:
          $ref: '#/components/schemas/File'
        notes:
          type: string
        templates:
          type: array
          items:
            $ref: '#/components/schemas/Template'
    Error:
      type: object
      required:
        - message
        - reason
      properties:
        message:
          type: string
          description: A human readable error message
        reason:
          $ref: '#/components/schemas/ErrorReason'
    FileRequestStatus:
      type: string
      enum:
        - pending
        - completed
        - rejected
    FileRequestWorkflowStatus:
      type: string
      description: >
        Where the document has reached across the whole workflow, which carries
        on after the request's own `status` is `completed`. A document is done
        once it has been both signed and reviewed, and workflows run those two
        steps in either order, so this is derived from those two facts rather
        than from a position in a sequence.


        | Value | Meaning |

        | --- | --- |

        | `draft` | The request is open and not yet approved. |

        | `prepared` | Approved, with the document saved to the CRID. Nothing
        downstream has started. |

        | `awaiting_signature` | Still unsigned, whether or not it has been
        reviewed. |

        | `wet_ink_pending` | Marked for wet-ink signing in a workflow where QC
        comes after signing, and the signed scan has not been uploaded yet. |

        | `awaiting_qc` | Signed, not yet reviewed. |

        | `qc_rejected` | Quality control rejected the document. Template
        requests can be
        [reworked](/docs/files-and-requests#reworking-a-rejected-request). |

        | `signature_rejected` | The signature request was rejected. |

        | `completed` | Signed and reviewed. |

        | `rejected` | The file request itself was rejected, deleted, or closed
        out. Terminal. |
      enum:
        - draft
        - prepared
        - awaiting_signature
        - wet_ink_pending
        - awaiting_qc
        - qc_rejected
        - signature_rejected
        - completed
        - rejected
    RequestedField:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        label:
          type: string
        required:
          type: boolean
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
            - enum
        enumValues:
          type: array
          items:
            type: string
        description:
          type: string
        displayed:
          type: boolean
    Exhibit:
      type: object
      required:
        - id
        - exhibitOrder
        - fileId
        - templateId
      properties:
        id:
          type: string
          format: uuid
        description:
          type: string
        exhibitOrder:
          type: integer
        key:
          type: string
        fileId:
          type: string
          format: uuid
        templateId:
          type: string
          format: uuid
        templateIndex:
          type: integer
        fileName:
          type: string
    File:
      type: object
      required:
        - id
        - matterId
        - owner
        - status
        - uploadStatus
        - crid
        - fileName
      properties:
        id:
          type: string
          format: uuid
        matterId:
          type: string
          format: uuid
        key:
          type: string
        description:
          type: string
        owner:
          type: string
        status:
          $ref: '#/components/schemas/FileStatus'
        uploadStatus:
          $ref: '#/components/schemas/FileUploadStatus'
        uploadedOn:
          type: string
          format: date-time
        downloadUrl:
          type: string
          format: uri
        fileName:
          type: string
        creditorCreationDate:
          type: string
          format: date-time
        crid:
          type: string
        uploadedBy:
          type: string
        lastViewed:
          type: string
          format: date-time
        lastViewedBy:
          type: string
        lastDownloaded:
          type: string
          format: date-time
        lastDownloadedBy:
          type: string
        fileType:
          type: string
        metadata:
          $ref: '#/components/schemas/FileMetadata'
        fileAttributes:
          $ref: '#/components/schemas/FileAttributes'
        redactionSummary:
          $ref: '#/components/schemas/RedactionSummary'
    Template:
      type: object
      required:
        - id
        - displayName
        - templateReference
        - labelingMode
        - index
      properties:
        id:
          type: string
          description: The template ID that was used to generate the document
          format: uuid
        displayName:
          type: string
          description: The user-friendly display name for the template
        templateReference:
          type: string
          description: The template file name
        index:
          type: integer
          description: >-
            The instance of the template, typically used for borrower and
            coborrower specific templates
        labelingMode:
          $ref: '#/components/schemas/LabelingMode'
        templateContext:
          $ref: '#/components/schemas/TemplateContext'
        pendingDelete:
          type: boolean
          description: >-
            Whether this template is pending deletion. Pending-delete templates
            are excluded from bundle generation but can be restored by returning
            to the bundle selection step.
        triggerContext:
          $ref: '#/components/schemas/TriggerContext'
    ErrorReason:
      type: string
      enum:
        - MISSING_TOKEN_OR_PERMISSIONS
        - NO_MATCHING_TRIGGER
        - OWNER_REQUIRED
        - FILE_REQUEST_NOT_PENDING
        - FILE_REQUEST_NOT_REWORKABLE
        - DUPLICATE_FILE_REQUEST
        - TEMPLATE_TYPE_REQUIRED
        - TEMPLATE_INDEX_REQUIRED
        - INVALID_MATTER_ID
        - MATTER_ID_REQUIRED
        - MATTER_NOT_FOUND
        - FILES_LIST_EMPTY
        - TOO_MANY_FILES
        - FILE_NAME_REQUIRED
        - FILE_NAME_MUST_BE_PDF
        - INVALID_FILE_TYPE
        - INVALID_TEMPLATE_IDENTIFIER
        - GENERATION_FAILED
        - EXHIBIT_ORDER_REQUIRED
        - CRID_REQUIRED
        - INVALID_FILE_NAME
        - ARTIFACT_TAG_NOT_FOUND
        - INVALID_LIMIT
        - INVALID_CURSOR
        - INVALID_ORDER_BY
        - MISSING_FILTER_DEPENDENCY
        - INVALID_FILTER
        - REQUEST_BODY_REQUIRED
        - INVALID_LABEL_RANGE
        - INVALID_REDACTION_RULE
        - REDACTION_NOT_FOUND
        - REDACTION_NOT_READY
        - FILE_UPLOAD_PENDING
        - BULK_DOWNLOAD_NOT_FOUND
        - BULK_DOWNLOAD_NOT_READY
    FileStatus:
      type: string
      enum:
        - active
        - archived
    FileUploadStatus:
      type: string
      enum:
        - pending
        - uploaded
    FileMetadata:
      type: object
      nullable: true
      description: Optional metadata associated with the file
      properties:
        fileRequest:
          type: object
          properties:
            totalSize:
              type: integer
              description: Total size of the file in bytes
            outputDocuments:
              type: array
              items:
                type: object
                properties:
                  fileSize:
                    type: integer
                    description: Size of this document segment in bytes
                  isExhibit:
                    type: boolean
                    description: Whether this document is an exhibit
                  pageOffset:
                    type: integer
                    description: >-
                      Page offset where this document starts in the combined
                      file
    FileAttributes:
      type: object
      description: >
        Per-file statistics computed asynchronously after upload. Absent until
        the file has been analyzed. PDF-structural stats nest under the
        `application/pdf` key; `sizeBytes` and `contentType` are general and
        apply to any analyzed file.
      properties:
        application/pdf:
          $ref: '#/components/schemas/PdfStats'
        sizeBytes:
          type: integer
          format: int64
        contentType:
          type: string
    RedactionSummary:
      type: object
      required:
        - latestId
        - latestStatus
        - count
      description: >
        Per-file aggregate of redaction jobs. Only present on `File` responses
        when `?redactionSummary=true` is set and the file has at least one
        redaction. `latestStatus` reflects the most recently created job.
      properties:
        latestId:
          type: string
          format: uuid
        latestStatus:
          $ref: '#/components/schemas/RedactionStatus'
        latestCreatedOn:
          type: string
          format: date-time
        latestErrorMessage:
          type: string
          nullable: true
          description: >
            Failure reason for the latest job, when `latestStatus` is `failed`.
            Null in every other status.
        count:
          type: integer
          minimum: 1
    LabelingMode:
      type: string
      enum:
        - numbers
        - letters
        - pageNumbers
        - none
    TemplateContext:
      type: object
      nullable: true
      properties:
        debtor:
          type: string
          enum:
            - borrower
            - coborrower
    TriggerContext:
      type: object
      properties:
        templateType:
          type: string
          description: >-
            Template type (e.g. affidavit, msa, payment_plan, settlement,
            noa_letter)
        lifecycleStep:
          type: string
        lineOfBusiness:
          type: string
    PdfStats:
      type: object
      description: >
        PDF-structural statistics for a file: page-class counts and the DPI
        range over image-bearing pages. Files analyzed before page
        classification was available carry only `pageCount`.
      properties:
        pageCount:
          type: integer
          description: Number of pages in the PDF.
        textOnlyPageCount:
          type: integer
        imageOnlyPageCount:
          type: integer
        mixedPageCount:
          type: integer
        dpiMin:
          type: integer
        dpiMax:
          type: integer
    RedactionStatus:
      type: string
      description: Current status of an asynchronous redaction job
      enum:
        - pending
        - processing
        - completed
        - failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Cognito-issued JWT access token. Send it as `Authorization: Bearer
        <token>`.

````

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