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

# Files on a Surplus Lines Filing

> Upload a file, attach it to a filing as the policy document, a checklist item or an escalation reply, and download it back

A file gets onto a Surplus Lines filing in two calls: upload it with [Upload a Document](/api-reference/v2/file-documents/upload-document), then attach it to the filing by id. The same two calls cover the policy document, a checklist item and a reply to a Turris escalation.

The filing has to exist first. [Open a Surplus-Lines Filing](/api-reference/v2/surplus-lines-filings/open-filing) returns its `_id`.

<Steps>
  <Step title="Upload the file">
    Category **Surplus Lines**. PDF, DOC, DOCX, JPEG or PNG, up to 10 MB. Leave `downstreamEntityAssociationId` out: the file belongs to the filing, not to an agency, and sending it returns **400**.

    Uploading needs the Tools product feature as well as Surplus-Lines Filing. Without it, Upload a Document returns **403**.

    ```bash theme={null}
    curl -X POST "https://public.api.live.turrisfi.com/v2/upstream/file-documents" \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -H "Idempotency-Key: $(uuidgen)" \
      -F "category=Surplus Lines" \
      -F "file=@signed-diligent-effort.pdf"
    ```

    Use a new `Idempotency-Key` for every file. The key alone decides a replay, so reusing one within the hour returns the first file's id. See [Idempotency](/guides/idempotency).
  </Step>

  <Step title="Keep the id from the response">
    `data._id` is the new document's id. The attach calls take it as `fileDocumentId`.
  </Step>

  <Step title="Attach it to the filing">
    One call, depending on where the file belongs:

    * **As the policy document:** [Set the Policy Document](/api-reference/v2/surplus-lines-filings/set-policy-document), JSON body `{ "fileDocumentId": "..." }`.
    * **On a checklist item:** [Attach Uploaded Files to a Checklist Item](/api-reference/v2/surplus-lines-filings/attach-checklist-item-file-documents), JSON body with the item's `sourceCategoryId` and `sourceTaskId`, plus `fileDocumentIds`. The two item ids come from the filing's checklist in [Get a Surplus Lines Filing](/api-reference/v2/surplus-lines-filings/get-filing).
    * **In answer to a Turris escalation:** [Reply to a Checklist Item Escalation](/api-reference/v2/surplus-lines-filings/reply-to-escalation), JSON body with the item's `sourceCategoryId` and `sourceTaskId`, plus `fileDocumentIds`.
  </Step>
</Steps>

An uploaded file is on no filing until you attach it. Each file can be attached once; to put the same file on a second filing, upload it again.

## Getting files back

[Get a Surplus Lines Filing](/api-reference/v2/surplus-lines-filings/get-filing) returns short-lived download links for the policy document, checklist attachments and completion artifacts. To fetch any document by its id instead, use [Get a Download URL for a Document](/api-reference/v2/file-documents/get-download-url).


## Related topics

- [Files on a Surplus Lines Filing](/guides/downstream-surplus-lines-files.md)
- [Surplus Lines Filing](/api-reference/v2/surplus-lines-filings/get-filing.md)
- [Get a Surplus-Lines Filing](/api-reference/v2/downstream/surplus-lines-filings/get-filing.md)


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