> For the complete documentation index, see [llms.txt](https://docs.eseye.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eseye.com/api-reference/bulk-operations-api/files/upload-or-download-file.md).

# Upload or Download File

Returns the AWS credentials you need to upload a file to S3, or a URL that downloads a file from S3. The `action` query parameter controls which one you get.

Set `action` to `upload` to generate presigned values for the file upload. The response includes `key`, `AWSAccessKeyId`, `x-amz-security-token`, `policy`, and `signature`. After this call, open **Upload File to S3**, go to **Body > form-data**, and choose the CSV file that matches your operation.

Set `action` to `download` to generate a URL that downloads the requested file. Pass the `responseFileId` returned by **Get ResponseFile** as the `fileId`. If the response includes a `url` or `fileUrl`, pass it to **Download via Pre-signed URL**.

```json
{"openapi":"3.1.0","info":{"title":"Bulk Operations API","version":"2.0.0"},"tags":[{"name":"Files"}],"servers":[{"url":"https://{fileUrl}","variables":{"fileUrl":{"default":"files.api.example.com","description":"Base URL of the File service (provided by Eseye)."}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Send `Bearer {token}`, where `{token}` is the `access_token` returned by Request a token."}}},"paths":{"/api/v2/file/{fileId}":{"get":{"summary":"Upload or Download File","operationId":"upload-download-file","tags":["Files"],"description":"Returns the AWS credentials you need to upload a file to S3, or a URL that downloads a file from S3. The `action` query parameter controls which one you get.\n\nSet `action` to `upload` to generate presigned values for the file upload. The response includes `key`,\n`AWSAccessKeyId`, `x-amz-security-token`, `policy`, and `signature`. After this call, open **Upload\nFile to S3**, go to **Body > form-data**, and choose the CSV file that matches your operation.\n\nSet `action` to `download` to generate a URL that downloads the requested file. Pass the\n`responseFileId` returned by **Get ResponseFile** as the `fileId`. If the response includes a `url` or\n`fileUrl`, pass it to **Download via Pre-signed URL**.\n","parameters":[{"name":"fileId","in":"path","required":true,"description":"The ID of the file. For an upload, enter the `fileId` returned by Create File. For a download, enter the `responseFileId` returned by Get ResponseFile.","schema":{"type":"string"}},{"name":"action","in":"query","required":true,"description":"Whether you are uploading a file or downloading one.","schema":{"type":"string","enum":["upload","download"]}}],"responses":{"200":{"description":"For `action=upload`, returns the presigned values for the S3 upload. For `action=download`, returns a presigned download URL."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eseye.com/api-reference/bulk-operations-api/files/upload-or-download-file.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
