{
 "openapi": "3.0.3",
 "info": {
  "title": "SortSpoke API (public, draft)",
  "version": "v2",
  "description": "Draft — pending engineering. Built from the customer API reference, the product code and live calls on 2026-11-24. Use the server for the data center your SortSpoke account is on.",
  "contact": {
   "name": "SortSpoke Support",
   "url": "https://www.sortspoke.com",
   "email": "support@sortspoke.com"
  }
 },
 "servers": [
  {
   "url": "https://api.sortspoke.com",
   "description": "US"
  },
  {
   "url": "https://api.ca.sortspoke.com",
   "description": "Canada"
  },
  {
   "url": "https://api.c4.sortspoke.com",
   "description": "US (second)"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "tags": [
  {
   "name": "Projects",
   "description": "Projects, their document categories and fields."
  },
  {
   "name": "Uploads",
   "description": "Send files to SortSpoke."
  },
  {
   "name": "Source files",
   "description": "The files you uploaded and the documents made from them."
  },
  {
   "name": "Documents",
   "description": "Document status, search, assignment and review links."
  },
  {
   "name": "Batches",
   "description": "Named batches of documents."
  },
  {
   "name": "Submissions",
   "description": "Combined data for one submission, optionally in your format."
  },
  {
   "name": "Exports",
   "description": "Download extracted data and documents."
  },
  {
   "name": "TriageAI",
   "description": "Triage results and priority buckets."
  }
 ],
 "paths": {
  "/api/v2/projects": {
   "get": {
    "operationId": "listProjects",
    "summary": "List projects",
    "tags": [
     "Projects"
    ],
    "description": "See https://sortspoke.com/developers#ref-projects",
    "parameters": [
     {
      "name": "expanded",
      "in": "query",
      "required": false,
      "description": "`1` returns project objects instead of an array of IDs.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "projectId": {
            "type": "string",
            "format": "uuid"
           },
           "acctId": {
            "type": "string",
            "format": "uuid"
           },
           "projectName": {
            "type": "string"
           },
           "dateCreated": {
            "type": "string",
            "format": "date-time"
           },
           "defaultStreamId": {
            "type": "string",
            "format": "uuid"
           },
           "defaultLanguage": {
            "type": "string"
           }
          }
         }
        },
        "example": [
         {
          "projectId": "5f0c8a2e-0000-4000-a000-000000000001",
          "acctId": "5f0c8a2e-0000-4000-a000-000000000002",
          "projectName": "Commercial Intake",
          "dateCreated": "2026-11-20T09:30:00.000Z",
          "defaultStreamId": "5f0c8a2e-0000-4000-a000-000000000003",
          "defaultLanguage": "en-US"
         }
        ]
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/labels": {
   "get": {
    "operationId": "listCategories",
    "summary": "List categories",
    "tags": [
     "Projects"
    ],
    "description": "See https://sortspoke.com/developers#ref-categories",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "projectId": {
           "type": "string",
           "format": "uuid"
          },
          "acctId": {
           "type": "string",
           "format": "uuid"
          },
          "labels": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "labelId": {
              "type": "string",
              "format": "uuid"
             },
             "name": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "example": {
         "projectId": "5f0c8a2e-0000-4000-a000-000000000005",
         "acctId": "5f0c8a2e-0000-4000-a000-000000000006",
         "labels": [
          {
           "labelId": "5f0c8a2e-0000-4000-a000-000000000007",
           "name": "Commercial Application"
          },
          {
           "labelId": "5f0c8a2e-0000-4000-a000-000000000008",
           "name": "Loss Run"
          },
          {
           "labelId": "5f0c8a2e-0000-4000-a000-000000000009",
           "name": "Statement of Values"
          }
         ]
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/labels/{labelId}/fields": {
   "get": {
    "operationId": "listFieldsInACategory",
    "summary": "List fields in a category",
    "tags": [
     "Projects"
    ],
    "description": "See https://sortspoke.com/developers#ref-fields",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "labelId",
      "in": "path",
      "required": true,
      "description": "Category ID from List categories.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "userId": {
           "type": "string",
           "nullable": true
          },
          "labelId": {
           "type": "string",
           "format": "uuid"
          },
          "acctId": {
           "type": "string",
           "format": "uuid"
          },
          "projectId": {
           "type": "string",
           "format": "uuid"
          },
          "fields": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "fieldId": {
              "type": "string",
              "format": "uuid"
             },
             "name": {
              "type": "string"
             },
             "fields": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "fieldId": {
                 "type": "string",
                 "format": "uuid"
                },
                "name": {
                 "type": "string"
                },
                "isRequired": {
                 "type": "boolean"
                },
                "isMulti": {
                 "type": "boolean"
                },
                "isColumn": {
                 "type": "boolean"
                },
                "validationType": {
                 "type": "string",
                 "nullable": true
                }
               }
              }
             }
            }
           }
          },
          "deletedFields": {
           "type": "array",
           "items": {}
          }
         }
        },
        "example": {
         "userId": null,
         "labelId": "5f0c8a2e-0000-4000-a000-000000000007",
         "acctId": "5f0c8a2e-0000-4000-a000-000000000006",
         "projectId": "5f0c8a2e-0000-4000-a000-000000000005",
         "fields": [
          {
           "fieldId": "5f0c8a2e-0000-4000-a000-00000000003e",
           "name": "Applicant",
           "fields": [
            {
             "fieldId": "5f0c8a2e-0000-4000-a000-00000000003f",
             "name": "Applicant Name",
             "isRequired": false,
             "isMulti": false,
             "isColumn": false,
             "validationType": null
            },
            {
             "fieldId": "5f0c8a2e-0000-4000-a000-000000000040",
             "name": "Applicant Phone",
             "isRequired": false,
             "isMulti": false,
             "isColumn": false,
             "validationType": null
            }
           ]
          },
          {
           "fieldId": "5f0c8a2e-0000-4000-a000-000000000041",
           "name": "Broker Name",
           "isRequired": false,
           "isMulti": false,
           "isColumn": false,
           "validationType": null
          }
         ],
         "deletedFields": []
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/upload": {
   "post": {
    "operationId": "uploadFilesToAProject",
    "summary": "Upload files to a project",
    "tags": [
     "Uploads"
    ],
    "description": "See https://sortspoke.com/developers#ref-upload",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "uploadPath",
      "in": "query",
      "required": false,
      "description": "Virtual folder, for example `/inbox/claims@example.com`. Without it, files go to the uploading user's queue.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "labelId",
      "in": "query",
      "required": false,
      "description": "Category to sort the document into. The document skips sorting and goes to Extracting.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "One or more files as `multipart/form-data`. Every file part is processed."
         }
        },
        "required": [
         "file"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "docId": {
            "type": "string",
            "format": "uuid"
           },
           "filename": {
            "type": "string"
           },
           "size": {
            "type": "integer"
           },
           "sourceFileId": {
            "type": "string",
            "format": "uuid"
           }
          }
         }
        },
        "example": [
         {
          "docId": "5f0c8a2e-0000-4000-a000-00000000000a",
          "filename": "/reviewer@example.com/application.pdf",
          "size": 482113,
          "sourceFileId": "5f0c8a2e-0000-4000-a000-00000000000b"
         }
        ]
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/streams/{streamId}/upload": {
   "post": {
    "operationId": "uploadFilesToAStream",
    "summary": "Upload files to a stream",
    "tags": [
     "Uploads"
    ],
    "description": "See https://sortspoke.com/developers#ref-upload-stream",
    "parameters": [
     {
      "name": "streamId",
      "in": "path",
      "required": true,
      "description": "Stream ID (a project's `defaultStreamId`, or a custom stream).",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "uploadPath",
      "in": "query",
      "required": false,
      "description": "Virtual folder, for example `/inbox/claims@example.com`. Without it, files go to the uploading user's queue.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "labelId",
      "in": "query",
      "required": false,
      "description": "Category to sort the document into. The document skips sorting and goes to Extracting.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "One or more files as `multipart/form-data`. Every file part is processed."
         }
        },
        "required": [
         "file"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/sourceFiles/{sourceFileId}/status": {
   "get": {
    "operationId": "getSourceFileStatus",
    "summary": "Get source file status",
    "tags": [
     "Source files"
    ],
    "description": "See https://sortspoke.com/developers#ref-sf-status",
    "parameters": [
     {
      "name": "sourceFileId",
      "in": "path",
      "required": true,
      "description": "Source file ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sourceFileId": {
           "type": "string",
           "format": "uuid"
          },
          "projectId": {
           "type": "string",
           "format": "uuid"
          },
          "state": {
           "type": "integer"
          },
          "sourceFileName": {
           "type": "string"
          },
          "pageCount": {
           "type": "integer"
          }
         }
        },
        "example": {
         "sourceFileId": "5f0c8a2e-0000-4000-a000-00000000000d",
         "projectId": "5f0c8a2e-0000-4000-a000-000000000005",
         "state": 300,
         "sourceFileName": "application.pdf",
         "pageCount": 3
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/sourceFiles/{sourceFileId}/docs": {
   "get": {
    "operationId": "listASourceFileSDocuments",
    "summary": "List a source file's documents",
    "tags": [
     "Source files"
    ],
    "description": "See https://sortspoke.com/developers#ref-sf-docs",
    "parameters": [
     {
      "name": "sourceFileId",
      "in": "path",
      "required": true,
      "description": "Source file ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "docId": {
            "type": "string",
            "format": "uuid"
           },
           "labelId": {
            "type": "string",
            "format": "uuid"
           },
           "predictedLabel": {
            "type": "object",
            "properties": {
             "labelId": {
              "type": "string",
              "format": "uuid"
             },
             "confidence": {
              "type": "number"
             },
             "datePredicted": {
              "type": "string",
              "format": "date-time"
             }
            }
           },
           "state": {
            "type": "integer"
           },
           "sourcePages": {
            "type": "array",
            "items": {
             "type": "object",
             "properties": {
              "docPageNum": {
               "type": "integer"
              },
              "sourceFileId": {
               "type": "string",
               "format": "uuid"
              },
              "sourceFilePageNum": {
               "type": "integer"
              }
             }
            }
           }
          }
         }
        },
        "example": [
         {
          "docId": "5f0c8a2e-0000-4000-a000-00000000000c",
          "labelId": "5f0c8a2e-0000-4000-a000-000000000007",
          "predictedLabel": {
           "labelId": "5f0c8a2e-0000-4000-a000-000000000007",
           "confidence": 0.91,
           "datePredicted": "2026-11-20T09:30:00.000Z"
          },
          "state": 7,
          "sourcePages": [
           {
            "docPageNum": 1,
            "sourceFileId": "5f0c8a2e-0000-4000-a000-00000000000d",
            "sourceFilePageNum": 1
           },
           {
            "docPageNum": 2,
            "sourceFileId": "5f0c8a2e-0000-4000-a000-00000000000d",
            "sourceFilePageNum": 2
           },
           {
            "docPageNum": 3,
            "sourceFileId": "5f0c8a2e-0000-4000-a000-00000000000d",
            "sourceFilePageNum": 3
           }
          ]
         }
        ]
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/sourceFiles/{sourceFileId}/split": {
   "post": {
    "operationId": "splitASourceFile",
    "summary": "Split a source file",
    "tags": [
     "Source files"
    ],
    "description": "See https://sortspoke.com/developers#ref-sf-split",
    "parameters": [
     {
      "name": "sourceFileId",
      "in": "path",
      "required": true,
      "description": "Source file ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "docPageRanges": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "`[{ \"labelId\": \"…\", \"sourceFilePageNums\": [1, 2] }]`. Page numbers are 1-based."
         }
        },
        "required": [
         "docPageRanges"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/sourceFiles/deliver": {
   "post": {
    "operationId": "markSourceFilesDelivered",
    "summary": "Mark source files delivered",
    "tags": [
     "Source files"
    ],
    "description": "See https://sortspoke.com/developers#ref-sf-deliver",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "items": {
         "type": "string",
         "format": "uuid"
        },
        "description": "A bare JSON array of finished source file IDs."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/status": {
   "post": {
    "operationId": "getDocumentStatus",
    "summary": "Get document status",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-status",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "items": {
         "type": "string",
         "format": "uuid"
        },
        "description": "A bare JSON array of document IDs."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "docId": {
            "type": "string",
            "format": "uuid"
           },
           "documentState": {
            "type": "integer"
           },
           "autoAccepted": {
            "type": "boolean"
           }
          }
         }
        },
        "example": [
         {
          "docId": "5f0c8a2e-0000-4000-a000-00000000000c",
          "documentState": 7,
          "autoAccepted": false
         }
        ]
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/docs/list": {
   "post": {
    "operationId": "searchDocuments",
    "summary": "Search documents",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-doc-search",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "pageNumber": {
          "type": "integer",
          "description": "1-based page number."
         },
         "limit": {
          "type": "integer",
          "description": "Results per page. Default 25, maximum 1000."
         },
         "query": {
          "type": "string",
          "description": "Prefix match on the name."
         },
         "stateFilter": {
          "type": "object",
          "description": "States to include."
         },
         "sorting": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "`[{ \"fieldName\": \"FinishedDate\", \"type\": \"Descending\" }]`. `type` also accepts `0` (ascending) or `1` (descending)."
         },
         "labelFilter": {
          "type": "object",
          "description": "Categories to include."
         },
         "dateFilter": {
          "type": "object",
          "description": "One object with `fromCreationDate`, `toCreationDate`, `fromFinishedDate`, `toFinishedDate`, `fromExportedDate`, `toExportedDate`."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "itemCount": {
           "type": "integer"
          },
          "offset": {
           "type": "integer"
          },
          "pageSize": {
           "type": "integer"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "docId": {
              "type": "string",
              "format": "uuid"
             },
             "batchId": {
              "type": "string",
              "format": "uuid"
             },
             "state": {
              "type": "integer"
             },
             "stageName": {
              "type": "string",
              "nullable": true
             },
             "documentName": {
              "type": "string"
             },
             "pageCount": {
              "type": "integer"
             },
             "creationDate": {
              "type": "string",
              "format": "date-time"
             },
             "assignee": {
              "type": "string"
             },
             "documentSearchProjectLabel": {
              "type": "object",
              "properties": {
               "labelId": {
                "type": "string",
                "format": "uuid"
               },
               "name": {
                "type": "string"
               },
               "deleted": {
                "type": "boolean"
               }
              }
             },
             "rejectionReason": {
              "type": "string",
              "nullable": true
             },
             "finishedDate": {
              "type": "string",
              "format": "date-time"
             },
             "rejectedDate": {
              "type": "string",
              "format": "date-time"
             },
             "sourceFileId": {
              "type": "string",
              "format": "uuid"
             },
             "splitDate": {
              "type": "string",
              "format": "date-time"
             },
             "exportedDate": {
              "type": "string",
              "format": "date-time"
             },
             "virusScanFailed": {
              "type": "boolean"
             },
             "uploadedBy": {
              "type": "string",
              "nullable": true
             },
             "containerSourceFileId": {
              "type": "string",
              "nullable": true
             },
             "fieldPredictionFailure": {
              "type": "string",
              "nullable": true
             }
            }
           }
          },
          "pageCount": {
           "type": "integer"
          },
          "searchTooManyResults": {
           "type": "boolean"
          }
         }
        },
        "example": {
         "itemCount": 42,
         "offset": 0,
         "pageSize": 25,
         "data": [
          {
           "docId": "5f0c8a2e-0000-4000-a000-000000000031",
           "batchId": "5f0c8a2e-0000-4000-a000-00000000000f",
           "state": 7,
           "stageName": null,
           "documentName": "application.pdf",
           "pageCount": 1,
           "creationDate": "2026-11-24T14:52:00.000Z",
           "assignee": "reviewer@example.com",
           "documentSearchProjectLabel": {
            "labelId": "5f0c8a2e-0000-4000-a000-000000000032",
            "name": "Commercial Application",
            "deleted": false
           },
           "rejectionReason": null,
           "finishedDate": "2026-11-24T15:10:41.000Z",
           "rejectedDate": "0001-01-01T00:00:00Z",
           "sourceFileId": "5f0c8a2e-0000-4000-a000-000000000033",
           "splitDate": "0001-01-01T00:00:00Z",
           "exportedDate": "0001-01-01T00:00:00",
           "virusScanFailed": false,
           "uploadedBy": null,
           "containerSourceFileId": null,
           "fieldPredictionFailure": null
          },
          {
           "docId": "5f0c8a2e-0000-4000-a000-000000000034",
           "batchId": "5f0c8a2e-0000-4000-a000-00000000000f",
           "state": 7,
           "stageName": null,
           "documentName": "supplemental-application.pdf",
           "pageCount": 4,
           "creationDate": "2026-11-24T14:52:00.000Z",
           "assignee": "reviewer@example.com",
           "documentSearchProjectLabel": {
            "labelId": "5f0c8a2e-0000-4000-a000-000000000032",
            "name": "Commercial Application",
            "deleted": false
           },
           "rejectionReason": null,
           "finishedDate": "2026-11-24T15:10:41.000Z",
           "rejectedDate": "0001-01-01T00:00:00Z",
           "sourceFileId": "5f0c8a2e-0000-4000-a000-000000000035",
           "splitDate": "0001-01-01T00:00:00",
           "exportedDate": "0001-01-01T00:00:00",
           "virusScanFailed": false,
           "uploadedBy": null,
           "containerSourceFileId": null,
           "fieldPredictionFailure": null
          }
         ],
         "pageCount": 2,
         "searchTooManyResults": false
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/streams/{streamId}/docs/list": {
   "post": {
    "operationId": "searchDocumentsInAStream",
    "summary": "Search documents in a stream",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-doc-search",
    "parameters": [
     {
      "name": "streamId",
      "in": "path",
      "required": true,
      "description": "Stream ID (a project's `defaultStreamId`, or a custom stream).",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "pageNumber": {
          "type": "integer",
          "description": "1-based page number."
         },
         "limit": {
          "type": "integer",
          "description": "Results per page. Default 25, maximum 1000."
         },
         "query": {
          "type": "string",
          "description": "Prefix match on the name."
         },
         "stateFilter": {
          "type": "object",
          "description": "States to include."
         },
         "sorting": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "`[{ \"fieldName\": \"FinishedDate\", \"type\": \"Descending\" }]`. `type` also accepts `0` (ascending) or `1` (descending)."
         },
         "labelFilter": {
          "type": "object",
          "description": "Categories to include."
         },
         "dateFilter": {
          "type": "object",
          "description": "One object with `fromCreationDate`, `toCreationDate`, `fromFinishedDate`, `toFinishedDate`, `fromExportedDate`, `toExportedDate`."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/docs/{docId}/siblings": {
   "get": {
    "operationId": "listSiblingDocuments",
    "summary": "List sibling documents",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-doc-siblings",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "Document ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/documents/assign": {
   "patch": {
    "operationId": "assignDocuments",
    "summary": "Assign documents",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-doc-assign",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "userId": {
          "type": "string",
          "description": "User ID or username (email)."
         },
         "docIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          },
          "description": "Documents to assign."
         }
        },
        "required": [
         "userId",
         "docIds"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/docs/deliver": {
   "post": {
    "operationId": "markDocumentsDelivered",
    "summary": "Mark documents delivered",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-doc-deliver",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "items": {
         "type": "string",
         "format": "uuid"
        },
        "description": "A bare JSON array of finished document IDs."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/presigned/document/{docId}": {
   "post": {
    "operationId": "createAReviewLink",
    "summary": "Create a review link",
    "tags": [
     "Documents"
    ],
    "description": "See https://sortspoke.com/developers#ref-review-link",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "Document ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "embedConfig": {
          "type": "object",
          "description": "Options for the embedded screen. See the Embed guide."
         },
         "readOnly": {
          "type": "boolean",
          "description": "View-only link."
         },
         "fieldTarget": {
          "type": "object",
          "description": "Open at one field: `{ \"fieldId\" }`, `{ \"fieldId\", \"recordId\" }` or `{ \"valueId\" }`."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "generatedDate": {
           "type": "string",
           "format": "date-time"
          },
          "expiryDate": {
           "type": "string",
           "format": "date-time"
          },
          "returnUrl": {
           "type": "string"
          }
         }
        },
        "example": {
         "generatedDate": "2026-11-24T15:00:00.0000000Z",
         "expiryDate": "2026-11-24T16:00:00.0000000Z",
         "returnUrl": "https://auth.sortspoke.com/embed/launch?token=<encrypted>"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   },
   "get": {
    "operationId": "legacyReviewLinkGet",
    "summary": "Legacy review link (GET)",
    "tags": [
     "Documents"
    ],
    "description": "Deprecated. Use `POST /api/v2/presigned/document/{docId}`.",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "deprecated": true,
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/batches": {
   "post": {
    "operationId": "createABatch",
    "summary": "Create a batch",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-create",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "batchName": {
          "type": "string",
          "description": "Unique among active batches."
         },
         "assigneeUserIdOrUserName": {
          "type": "string",
          "description": "Leave out to create the batch unassigned."
         }
        },
        "required": [
         "batchName"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/streams/{streamId}/batches": {
   "post": {
    "operationId": "createABatchInAStream",
    "summary": "Create a batch in a stream",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-create",
    "parameters": [
     {
      "name": "streamId",
      "in": "path",
      "required": true,
      "description": "Stream ID (a project's `defaultStreamId`, or a custom stream).",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "batchName": {
          "type": "string",
          "description": "Unique among active batches."
         },
         "assigneeUserIdOrUserName": {
          "type": "string",
          "description": "Leave out to create the batch unassigned."
         }
        },
        "required": [
         "batchName"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/upload": {
   "post": {
    "operationId": "uploadFilesToABatch",
    "summary": "Upload files to a batch",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-upload",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "labelId",
      "in": "query",
      "required": false,
      "description": "Category to sort the document into. The document skips sorting and goes to Extracting.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "One or more files as `multipart/form-data`. Every file part is processed."
         }
        },
        "required": [
         "file"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/assign": {
   "post": {
    "operationId": "assignABatch",
    "summary": "Assign a batch",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-assign",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "string",
        "description": "A bare JSON string: the user ID."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}": {
   "patch": {
    "operationId": "updateABatch",
    "summary": "Update a batch",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-update",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "batchName": {
          "type": "string",
          "description": "The new name. It can't be empty."
         },
         "state": {
          "type": "integer",
          "description": "10, 20 or 30 only."
         }
        },
        "required": [
         "batchName"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/batches/list": {
   "post": {
    "operationId": "searchBatches",
    "summary": "Search batches",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-search",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "pageNumber": {
          "type": "integer",
          "description": "1-based page number."
         },
         "limit": {
          "type": "integer",
          "description": "Results per page. Default 25, maximum 1000."
         },
         "query": {
          "type": "string",
          "description": "Search text. Ask SortSpoke what it matches for batches."
         },
         "stateFilter": {
          "type": "object",
          "description": "States to include."
         },
         "sorting": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "`[{ \"fieldName\": \"…\", \"type\": \"Descending\" }]`. `type` also accepts `0` (ascending) or `1` (descending). Ask SortSpoke which fields batches sort on."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "itemCount": {
           "type": "integer"
          },
          "pageSize": {
           "type": "integer"
          },
          "offset": {
           "type": "integer"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "batchId": {
              "type": "string",
              "format": "uuid"
             },
             "batchName": {
              "type": "string"
             },
             "docCount": {
              "type": "integer"
             },
             "sortingDocCount": {
              "type": "integer"
             },
             "extractingDocCount": {
              "type": "integer"
             },
             "state": {
              "type": "integer"
             },
             "userId": {
              "type": "string",
              "format": "uuid"
             },
             "isCloudImportedBatch": {
              "type": "boolean"
             },
             "creationDate": {
              "type": "string",
              "format": "date-time"
             },
             "isDefault": {
              "type": "boolean"
             },
             "triageBucketId": {
              "type": "string",
              "format": "uuid"
             },
             "triageBucketName": {
              "type": "string"
             },
             "emailImportInfo": {
              "type": "string",
              "nullable": true
             },
             "customColumnData": {
              "type": "array",
              "items": {}
             }
            }
           }
          },
          "pageCount": {
           "type": "integer"
          },
          "customColumnInfos": {
           "type": "string",
           "nullable": true
          }
         }
        },
        "example": {
         "itemCount": 2,
         "pageSize": 10,
         "offset": 0,
         "data": [
          {
           "batchId": "5f0c8a2e-0000-4000-a000-00000000002e",
           "batchName": "Northwind Trucking - new business",
           "docCount": 3,
           "sortingDocCount": 0,
           "extractingDocCount": 0,
           "state": 10,
           "userId": "5f0c8a2e-0000-4000-a000-00000000002f",
           "isCloudImportedBatch": false,
           "creationDate": "2026-11-20T09:30:00.000Z",
           "isDefault": false,
           "triageBucketId": "00000000-0000-0000-0000-000000000000",
           "triageBucketName": "",
           "emailImportInfo": null,
           "customColumnData": []
          },
          {
           "batchId": "5f0c8a2e-0000-4000-a000-000000000030",
           "batchName": "Harbourview Marine - renewal",
           "docCount": 4,
           "sortingDocCount": 0,
           "extractingDocCount": 0,
           "state": 50,
           "userId": "5f0c8a2e-0000-4000-a000-00000000002f",
           "isCloudImportedBatch": false,
           "creationDate": "2026-11-20T09:30:00.000Z",
           "finishedDate": "2026-11-24T15:10:41.000Z",
           "isDefault": false,
           "triageBucketId": "00000000-0000-0000-0000-000000000000",
           "triageBucketName": "",
           "emailImportInfo": null,
           "customColumnData": []
          }
         ],
         "pageCount": 1,
         "customColumnInfos": null
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/streams/{streamId}/batches/list": {
   "post": {
    "operationId": "searchBatchesInAStream",
    "summary": "Search batches in a stream",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-search",
    "parameters": [
     {
      "name": "streamId",
      "in": "path",
      "required": true,
      "description": "Stream ID (a project's `defaultStreamId`, or a custom stream).",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "pageNumber": {
          "type": "integer",
          "description": "1-based page number."
         },
         "limit": {
          "type": "integer",
          "description": "Results per page. Default 25, maximum 1000."
         },
         "query": {
          "type": "string",
          "description": "Search text. Ask SortSpoke what it matches for batches."
         },
         "stateFilter": {
          "type": "object",
          "description": "States to include."
         },
         "sorting": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "`[{ \"fieldName\": \"…\", \"type\": \"Descending\" }]`. `type` also accepts `0` (ascending) or `1` (descending). Ask SortSpoke which fields batches sort on."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/docs": {
   "get": {
    "operationId": "listABatchSDocuments",
    "summary": "List a batch's documents",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-docs",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "description": "Document state to include.",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "fromFinishedDate",
      "in": "query",
      "required": false,
      "description": "",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "toFinishedDate",
      "in": "query",
      "required": false,
      "description": "",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "docId": {
            "type": "string",
            "format": "uuid"
           },
           "state": {
            "type": "integer"
           }
          }
         }
        },
        "example": [
         {
          "docId": "5f0c8a2e-0000-4000-a000-000000000014",
          "state": 7
         },
         {
          "docId": "5f0c8a2e-0000-4000-a000-000000000015",
          "state": 7
         },
         {
          "docId": "5f0c8a2e-0000-4000-a000-000000000016",
          "state": 7
         }
        ]
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/deliver": {
   "post": {
    "operationId": "markBatchesDelivered",
    "summary": "Mark batches delivered",
    "tags": [
     "Batches"
    ],
    "description": "See https://sortspoke.com/developers#ref-batch-deliver",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "items": {
         "type": "string",
         "format": "uuid"
        },
        "description": "A bare JSON array of finished batch IDs."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/summary": {
   "get": {
    "operationId": "getSubmissionData",
    "summary": "Get submission data",
    "tags": [
     "Submissions"
    ],
    "description": "See https://sortspoke.com/developers#ref-summary",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID. One batch is one submission. It arrives as `batchId` in the `batch.status_changed` webhook.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/summary/export": {
   "get": {
    "operationId": "exportSubmissionData",
    "summary": "Export submission data",
    "tags": [
     "Submissions"
    ],
    "description": "See https://sortspoke.com/developers#ref-summary-export",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID. One batch is one submission. It arrives as `batchId` in the `batch.status_changed` webhook.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "Leave it out to get the project's assigned format. `transform:{specName}` or `transform:{specName}@{version}` applies a named transformation. Only JSON is available.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "batch": {
           "type": "object",
           "properties": {
            "batchId": {
             "type": "string",
             "format": "uuid"
            },
            "name": {
             "type": "string"
            },
            "state": {
             "type": "string"
            },
            "dateCreated": {
             "type": "string",
             "format": "date-time"
            },
            "dateFinished": {
             "type": "string",
             "format": "date-time"
            },
            "ownedBy": {
             "type": "string",
             "format": "uuid"
            },
            "ownedByUserName": {
             "type": "string"
            },
            "acctId": {
             "type": "string",
             "format": "uuid"
            },
            "projectId": {
             "type": "string",
             "format": "uuid"
            },
            "projectName": {
             "type": "string"
            },
            "streamId": {
             "type": "string",
             "format": "uuid"
            },
            "streamName": {
             "type": "string"
            }
           }
          },
          "data": {
           "type": "object",
           "properties": {
            "uwScreeningDecision": {
             "type": "object",
             "properties": {
              "Name": {
               "type": "string"
              },
              "Status": {
               "type": "string"
              },
              "Value": {
               "type": "string"
              },
              "Sources": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "SourceType": {
                  "type": "string"
                 },
                 "DisplayValue": {
                  "type": "string"
                 },
                 "NormalizedValue": {
                  "type": "string"
                 },
                 "FieldId": {
                  "type": "string",
                  "format": "uuid"
                 },
                 "Tier": {
                  "type": "string"
                 }
                }
               }
              }
             }
            },
            "policyInformation": {
             "type": "object",
             "properties": {
              "proposedEffDate": {
               "type": "object",
               "properties": {
                "Name": {
                 "type": "string"
                },
                "Status": {
                 "type": "string"
                },
                "Value": {
                 "type": "string"
                },
                "Sources": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "SourceType": {
                    "type": "string"
                   },
                   "DisplayValue": {
                    "type": "string"
                   },
                   "NormalizedValue": {
                    "type": "string"
                   },
                   "DocId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "FieldId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "ValueId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "RecordId": {
                    "type": "string",
                    "nullable": true
                   },
                   "RowId": {
                    "type": "string",
                    "nullable": true
                   },
                   "TableInstanceId": {
                    "type": "string",
                    "nullable": true
                   },
                   "Tier": {
                    "type": "string"
                   }
                  }
                 }
                }
               }
              }
             }
            },
            "applicationInformation": {
             "type": "object",
             "properties": {
              "agency": {
               "type": "object",
               "properties": {
                "Name": {
                 "type": "string"
                },
                "Status": {
                 "type": "string"
                },
                "Value": {
                 "type": "string"
                },
                "Sources": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "SourceType": {
                    "type": "string"
                   },
                   "DisplayValue": {
                    "type": "string"
                   },
                   "NormalizedValue": {
                    "type": "string"
                   },
                   "DocId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "FieldId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "ValueId": {
                    "type": "string",
                    "format": "uuid"
                   },
                   "RecordId": {
                    "type": "string",
                    "nullable": true
                   },
                   "RowId": {
                    "type": "string",
                    "nullable": true
                   },
                   "TableInstanceId": {
                    "type": "string",
                    "nullable": true
                   },
                   "Tier": {
                    "type": "string"
                   }
                  }
                 }
                }
               }
              }
             }
            },
            "vehicle": {
             "type": "array",
             "items": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "vin": {
                 "type": "object",
                 "properties": {
                  "Name": {
                   "type": "string"
                  },
                  "Status": {
                   "type": "string"
                  },
                  "Value": {
                   "type": "string"
                  },
                  "Sources": {
                   "type": "array",
                   "items": {
                    "type": "object",
                    "properties": {
                     "SourceType": {
                      "type": "string"
                     },
                     "DisplayValue": {
                      "type": "string"
                     },
                     "NormalizedValue": {
                      "type": "string"
                     },
                     "DocId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "FieldId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "ValueId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "RecordId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "RowId": {
                      "type": "string",
                      "nullable": true
                     },
                     "TableInstanceId": {
                      "type": "string",
                      "nullable": true
                     },
                     "Tier": {
                      "type": "string"
                     }
                    }
                   }
                  }
                 }
                },
                "year": {
                 "type": "object",
                 "properties": {
                  "Name": {
                   "type": "string"
                  },
                  "Status": {
                   "type": "string"
                  },
                  "Value": {
                   "type": "string"
                  },
                  "Sources": {
                   "type": "array",
                   "items": {
                    "type": "object",
                    "properties": {
                     "SourceType": {
                      "type": "string"
                     },
                     "DisplayValue": {
                      "type": "string"
                     },
                     "NormalizedValue": {
                      "type": "string"
                     },
                     "DocId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "FieldId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "ValueId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "RecordId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "RowId": {
                      "type": "string",
                      "nullable": true
                     },
                     "TableInstanceId": {
                      "type": "string",
                      "nullable": true
                     },
                     "Tier": {
                      "type": "string"
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            },
            "premisesInsurance": {
             "type": "array",
             "items": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "amount": {
                 "type": "object",
                 "properties": {
                  "Name": {
                   "type": "string"
                  },
                  "Status": {
                   "type": "string"
                  },
                  "Value": {
                   "type": "string"
                  },
                  "Sources": {
                   "type": "array",
                   "items": {
                    "type": "object",
                    "properties": {
                     "SourceType": {
                      "type": "string"
                     },
                     "DisplayValue": {
                      "type": "string"
                     },
                     "NormalizedValue": {
                      "type": "string"
                     },
                     "DocId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "FieldId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "ValueId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "RecordId": {
                      "type": "string",
                      "nullable": true
                     },
                     "RowId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "TableInstanceId": {
                      "type": "string",
                      "format": "uuid"
                     },
                     "Tier": {
                      "type": "string"
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        },
        "example": {
         "batch": {
          "batchId": "5f0c8a2e-0000-4000-a000-000000000017",
          "name": "Northwind Trucking - new business",
          "state": "Finished",
          "dateCreated": "2026-11-24T14:52:00.000Z",
          "dateFinished": "2026-11-24T15:10:41.000Z",
          "ownedBy": "5f0c8a2e-0000-4000-a000-000000000018",
          "ownedByUserName": "underwriter@example.com",
          "acctId": "5f0c8a2e-0000-4000-a000-000000000019",
          "projectId": "5f0c8a2e-0000-4000-a000-00000000001a",
          "projectName": "Commercial Intake",
          "streamId": "5f0c8a2e-0000-4000-a000-00000000001b",
          "streamName": "Default"
         },
         "data": {
          "uwScreeningDecision": {
           "Name": "UW Screening Decision",
           "Status": "Resolved",
           "Value": "Refer",
           "Sources": [
            {
             "SourceType": "Submission",
             "DisplayValue": "Refer",
             "NormalizedValue": "Refer",
             "FieldId": "5f0c8a2e-0000-4000-a000-00000000001c",
             "Tier": "HumanVerified"
            }
           ]
          },
          "policyInformation": {
           "proposedEffDate": {
            "Name": "Proposed Eff Date",
            "Status": "Resolved",
            "Value": "2027-01-01",
            "Sources": [
             {
              "SourceType": "Document",
              "DisplayValue": "01/01/2027",
              "NormalizedValue": "2027-01-01",
              "DocId": "5f0c8a2e-0000-4000-a000-000000000015",
              "FieldId": "5f0c8a2e-0000-4000-a000-00000000001d",
              "ValueId": "5f0c8a2e-0000-4000-a000-00000000001e",
              "RecordId": null,
              "RowId": null,
              "TableInstanceId": null,
              "Tier": "HumanVerified"
             },
             {
              "SourceType": "Document",
              "DisplayValue": "01/01/2027",
              "NormalizedValue": "2027-01-01",
              "DocId": "5f0c8a2e-0000-4000-a000-000000000014",
              "FieldId": "5f0c8a2e-0000-4000-a000-00000000001d",
              "ValueId": "5f0c8a2e-0000-4000-a000-00000000001f",
              "RecordId": null,
              "RowId": null,
              "TableInstanceId": null,
              "Tier": "AutoVerified"
             }
            ]
           }
          },
          "applicationInformation": {
           "agency": {
            "Name": "Agency",
            "Status": "Resolved",
            "Value": "Harbourview Insurance Brokers",
            "Sources": [
             {
              "SourceType": "Document",
              "DisplayValue": "HARBOURVIEW INS. BROKERS",
              "NormalizedValue": "Harbourview Insurance Brokers",
              "DocId": "5f0c8a2e-0000-4000-a000-000000000015",
              "FieldId": "5f0c8a2e-0000-4000-a000-000000000020",
              "ValueId": "5f0c8a2e-0000-4000-a000-000000000021",
              "RecordId": null,
              "RowId": null,
              "TableInstanceId": null,
              "Tier": "AutoVerified"
             },
             {
              "SourceType": "Document",
              "DisplayValue": "HARBOURVIEW INS. BROKERS",
              "NormalizedValue": "Harbourview Insurance Brokers",
              "DocId": "5f0c8a2e-0000-4000-a000-000000000014",
              "FieldId": "5f0c8a2e-0000-4000-a000-000000000020",
              "ValueId": "5f0c8a2e-0000-4000-a000-000000000022",
              "RecordId": null,
              "RowId": null,
              "TableInstanceId": null,
              "Tier": "AutoVerified"
             }
            ]
           }
          },
          "vehicle": [
           [
            {
             "vin": {
              "Name": "VIN",
              "Status": "Resolved",
              "Value": "1FTFW1E50PFA00000",
              "Sources": [
               {
                "SourceType": "Document",
                "DisplayValue": "1FTFW1E50PFA00000",
                "NormalizedValue": "1FTFW1E50PFA00000",
                "DocId": "5f0c8a2e-0000-4000-a000-000000000023",
                "FieldId": "5f0c8a2e-0000-4000-a000-000000000024",
                "ValueId": "5f0c8a2e-0000-4000-a000-000000000025",
                "RecordId": "5f0c8a2e-0000-4000-a000-000000000026",
                "RowId": null,
                "TableInstanceId": null,
                "Tier": "HumanVerified"
               }
              ]
             },
             "year": {
              "Name": "Year",
              "Status": "Resolved",
              "Value": "2023",
              "Sources": [
               {
                "SourceType": "Document",
                "DisplayValue": "2023",
                "NormalizedValue": "2023",
                "DocId": "5f0c8a2e-0000-4000-a000-000000000023",
                "FieldId": "5f0c8a2e-0000-4000-a000-000000000027",
                "ValueId": "5f0c8a2e-0000-4000-a000-000000000028",
                "RecordId": "5f0c8a2e-0000-4000-a000-000000000026",
                "RowId": null,
                "TableInstanceId": null,
                "Tier": "AutoVerified"
               }
              ]
             }
            }
           ]
          ],
          "premisesInsurance": [
           [
            {
             "amount": {
              "Name": "Amount",
              "Status": "Resolved",
              "Value": "1250000",
              "Sources": [
               {
                "SourceType": "Document",
                "DisplayValue": "$1,250,000",
                "NormalizedValue": "1250000",
                "DocId": "5f0c8a2e-0000-4000-a000-000000000029",
                "FieldId": "5f0c8a2e-0000-4000-a000-00000000002a",
                "ValueId": "5f0c8a2e-0000-4000-a000-00000000002b",
                "RecordId": null,
                "RowId": "5f0c8a2e-0000-4000-a000-00000000002c",
                "TableInstanceId": "5f0c8a2e-0000-4000-a000-00000000002d",
                "Tier": "HumanVerified"
               }
              ]
             }
            }
           ]
          ]
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/downloads/docs/{docId}/export_file": {
   "get": {
    "operationId": "exportADocumentJson",
    "summary": "Export a document (JSON)",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-export",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "Document ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The export file as a download. For JsonV2 projects the file body is JSON; see the example in the docs.",
      "content": {
       "application/octet-stream": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/downloads/ExportFinishedDoc/{docId}": {
   "get": {
    "operationId": "exportADocumentExcel",
    "summary": "Export a document (Excel)",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-export-excel",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "Document ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/downloads/export_files": {
   "post": {
    "operationId": "bulkExport",
    "summary": "Bulk export",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-export-bulk",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "docIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          },
          "description": "Repeat the `docIds` form field once per document."
         }
        },
        "required": [
         "docIds"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/downloads/export_files/Excel": {
   "post": {
    "operationId": "bulkExportAsExcel",
    "summary": "Bulk export as Excel",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-export-bulk",
    "parameters": [],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "docIds": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "uuid"
          },
          "description": "Repeat the `docIds` form field once per document."
         }
        },
        "required": [
         "docIds"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/downloads/doc/{docId}": {
   "get": {
    "operationId": "downloadADocumentAsPdf",
    "summary": "Download a document as PDF",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-pdf",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "Document ID from the upload response.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/export_file": {
   "get": {
    "operationId": "exportABatchJson",
    "summary": "Export a batch (JSON)",
    "tags": [
     "Exports"
    ],
    "description": "See https://sortspoke.com/developers#ref-export-batch",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/batch/{batchId}/triageResults": {
   "get": {
    "operationId": "getTriageResults",
    "summary": "Get triage results",
    "tags": [
     "TriageAI"
    ],
    "description": "See https://sortspoke.com/developers#ref-triage-results",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/batch/{batchId}/triage": {
   "post": {
    "operationId": "reRunTriage",
    "summary": "Re-run triage",
    "tags": [
     "TriageAI"
    ],
    "description": "See https://sortspoke.com/developers#ref-triage-rerun",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/projects/{projectId}/triage/buckets": {
   "get": {
    "operationId": "listPriorityBuckets",
    "summary": "List priority buckets",
    "tags": [
     "TriageAI"
    ],
    "description": "See https://sortspoke.com/developers#ref-triage-buckets",
    "parameters": [
     {
      "name": "projectId",
      "in": "path",
      "required": true,
      "description": "Project ID from List projects.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/batches/{batchId}/bucket/{bucketId}": {
   "patch": {
    "operationId": "setABatchSBucket",
    "summary": "Set a batch's bucket",
    "tags": [
     "TriageAI"
    ],
    "description": "See https://sortspoke.com/developers#ref-triage-set-bucket",
    "parameters": [
     {
      "name": "batchId",
      "in": "path",
      "required": true,
      "description": "Batch ID.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "bucketId",
      "in": "path",
      "required": true,
      "description": "Bucket ID from List priority buckets.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  },
  "/api/v2/presigned/document/{docId}/extract": {
   "post": {
    "operationId": "legacyEditableReviewLink",
    "summary": "Legacy editable review link",
    "tags": [
     "Documents"
    ],
    "description": "Deprecated. Use `POST /api/v2/presigned/document/{docId}`.",
    "parameters": [
     {
      "name": "docId",
      "in": "path",
      "required": true,
      "description": "",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "deprecated": true,
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     },
     "400": {
      "$ref": "#/components/responses/Error"
     },
     "401": {
      "$ref": "#/components/responses/Error"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "description": "API token from Admin → Users → API Tokens."
   }
  },
  "schemas": {
   "ErrorEnvelope": {
    "type": "object",
    "properties": {
     "status": {
      "type": "integer"
     },
     "traceId": {
      "type": "string"
     },
     "description": {
      "type": "string"
     }
    }
   }
  },
  "responses": {
   "Error": {
    "description": "Error. Most failures, including no access and not found, return 400.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorEnvelope"
      },
      "example": {
       "status": 400,
       "traceId": "00-00000000000000000000000000000000-0000000000000000-00",
       "description": "Something went wrong with this request"
      }
     }
    }
   }
  }
 }
}