---
title: "Initiate a file upload process"
method: POST
path: "/api/fleet/uploads"
---

# Initiate a file upload process

`POST /api/fleet/uploads`

## Headers

- `X-Request-Id` string
- `Elastic-Api-Version` string

## Request body

- UploadBeginRequest
  - `file` object, required
    - `Compression` string — The algorithm used to compress the file. Valid values: br,gzip,deflate,none
    - `hash` object — Checksums on the file contents
      - `sha256` string — SHA256 of the contents
    - `name` string, required — Name of the file including the extension, without the directory
    - `mime_type` string, required — MIME type of the file
    - `size` integer, required — Size of the file contents, in bytes
  - `action_id` string, required — ID of the action that requested this file
  - `agent_id` string, required — Identifier of the agent uploading. Matches the ID usually found in agent.id
  - `src` 'endpoint' | 'agent', required — The source integration sending this file

## Response `200`

Information about the upload procedure

- UploadBeginResponse — Response to initiating a file upload
  - `upload_id` string, required — A unique identifier for the ensuing upload operation
  - `chunk_size` integer, required — The required size (in bytes) that the file must be segmented into for each chunk

## Other responses

- `400` — A 400 response for receiving an invalid User-Agent, Elastic-Api-Version header or version number (checkin and enroll endpoints). In the case where an invalid or unsupported Elastic-Api-Version header is requested, the response will contain the default version number. Or any other undefined error encounted by the fleet-server. May be returned by any endpoint except /api/fleet/status.
- `401` — 401 response when the API key is not enabled on any endpoint except /api/fleet/status. Or when there are issues updating an inactive agent on the ack endpoint.
- `408` — 408 request timeout.
- `500` — A 500 response for encountering not expected bahavior.
- `503` — 503 response when the server is not available for some reason. Such as if a context is cancelled or the connection (to ES) is refused. May be returned by any endpoint.

---

[API](https://skmtc.net/elastic/apis/fleet-server-api.md) · [All operations](https://skmtc.net/elastic/apis/fleet-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/fleet-server-api/versions/e1c8da877dd8/schema)
