> ## Documentation Index
> Fetch the complete documentation index at: https://signatureapi-daf4ee54.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a file (Deprecated)

> Registers a new temporary file and returns a URL for uploading the content.

<Warning>
  The File resource and the `/v1/files` endpoint have been replaced by the [Upload resource](/docs/api/resources/uploads/object). New integrations should use Uploads:

  * [Create an upload](/docs/api/resources/uploads/create)
  * [Upload object](/docs/api/resources/uploads/object)
</Warning>

Registers a new temporary file. The response includes a `put_url` you use to upload the file content in a second request.

<Note>Files are temporary and expire 24 hours after creation. To store files for reuse across multiple envelopes, use the [Library](https://dashboard.signatureapi.com/library) in your dashboard.</Note>

## How to upload a file

Creating a usable file requires two steps.

<Steps>
  <Step title="Create a file record">
    Send a POST request to `/v1/files`. No request body is needed.

    The response includes:

    * An `id` for the new file.
    * A `put_url` to upload the file content.
    * An `expires_at` timestamp indicating when the file will be deleted.

    The response also includes a `Location` header with the file's reference URL: `https://api.signatureapi.com/v1/files/{id}`.
  </Step>

  <Step title="Upload the file content">
    Send a PUT request to the `put_url` from the previous response. Set the request body to the raw binary content of your file.

    ```bash theme={null}
    curl -X PUT "{put_url}" \
      --data-binary "@/path/to/document.pdf" \
      -H "Content-Type: application/pdf"
    ```

    <Note>Upload the file as a binary stream. Multipart form uploads are not supported and will produce an invalid file.</Note>
  </Step>

  <Step title="Use the file URL in your envelope">
    After uploading, reference the file by its URL in other API calls. Use the `Location` header value from step 1, or construct the URL using the pattern `https://api.signatureapi.com/v1/files/{id}`.

    For example, to use the file as the source of a document:

    ```json theme={null}
    {
      "documents": [
        {
          "url": "https://api.signatureapi.com/v1/files/fil_0nZXZ8pYPByQ4XksJbDl4r",
          //...
        }
      ]
    }
    ```
  </Step>
</Steps>

## Returns

Returns a `201 Created` status code on success. The response body includes the following properties:

<ResponseField name="id" type="string">
  The unique identifier of the file.
</ResponseField>

<ResponseField name="put_url" type="string">
  A presigned URL. Send a PUT request to this URL with the raw file content to complete the upload. This URL is temporary and should be used immediately.
</ResponseField>

<ResponseField name="expires_at" type="string">
  The date and time when the file will expire, in <Tooltip tip="For example: 2025-12-31T23:59:59.999Z">ISO 8601</Tooltip> format.
</ResponseField>

<RequestExample>
  ```json Request theme={null}
  // POST https://api.signatureapi.com/v1/files
  // X-API-Key: key_test_...
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  // HTTP Status Code 201

  {
    "id": "fil_0nZXZ8pYPByQ4XksJbDl4r",
    "put_url": "https://s3.us-east-2.amazonaws.com/signatureapi-vault-dev/temp...",
    "expires_at": "2025-12-31T20:00:00.000Z"
  }
  ```
</ResponseExample>
