---
title: "Upload a Dockerfile build context (gzip tarball)"
method: POST
path: "/platform/deployments/custom/contexts"
tags: ["Platform"]
---

# Upload a Dockerfile build context (gzip tarball)

`POST /platform/deployments/custom/contexts`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/deployments/custom/contexts`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Used by the Dockerfile-via-tarball deploy mode. Send the gzipped
tar of your project as the raw request body. The response
returns a `context_id` you reference in a follow-up
`POST /platform/deployments/custom` body.

Maximum 100 MiB per context (operator may lower). Default quotas are
10 unexpired/referenced uploads and 300 MiB per account. Referenced
retained sources count toward quota. Quota exhaustion returns 429.
Without retain=true, uploads remain temporary, one-use, with a
24-hour default TTL. With retain=true, an archive remains while an
app references it; otherwise expires seven days after upload or last
deployment request (not after detachment). The sweep removes file and
row. Immutable IDs and SHA256 identify source bytes, not mutable build
dependencies. See https://docs.imprezahost.com/source-uploads.html.

The CLI (`impreza deploy`) automates this two-step flow and
bakes in a default exclude list (`.git`, `node_modules`,
`__pycache__`, `.venv`, `vendor`, `.impreza`, `*.pyc`,
`.DS_Store`).

## Query parameters

- `retain` boolean
- `label` string

## Response `201`

Context staged on disk

## Other responses

- `400`: Validation failed on the request body or query parameters
- `413`: Payload too large

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
