> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/002_company/011_documents/001__prepare_file_upload_as_company.md).

# Prepare File Upload (Company)

GraphQL endpoint: `/company`

Prepares a file upload by returning a presigned PUT URL together with the file key to save. Upload the file to the URL, then pass the file key to the mutation that records it.

## Query

```graphql
mutation (
  $fileName: String!
  $contentType: String!
) {
  prepareFileUpload (
    fileName: $fileName
    contentType: $contentType
  ) {
    uploadUrl
    fileKey
  }
}

```

## Variables

```json
{
  "contentType": "image/png",
  "fileName": "logo.png"
}
```

## Response

```json
{
  "data": {
    "prepareFileUpload": {
      "fileKey": "user_uploads/2026-01-15_examplekey1_logo.png",
      "uploadUrl": "http://localhost:4566/tnid-v2-uploads-local/user_uploads/2026-01-15_examplekey1_logo.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=SOME_RANDOM_ACCESS_KEY%2F20260115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260115T090000Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=0000000000000000000000000000000000000000000000000000000000000000"
    }
  }
}
```
