---
# @generated by sylphx-gen. Do not edit.
title: "Prepare upload on an artifact"
description: "`artifacts.artifacts.prepare_upload` (POST /v1/{parent}/artifacts:prepareUpload): Mints one short-lived registry credential and the unique image reference for an upload of this project."
type: reference
product: platform
summary: "Mints one short-lived registry credential and the unique image reference for an upload of this project."
updated: 2026-09-28
nav: false
---

Mints one short-lived registry credential and the unique image reference for an upload of this project. The repository is derived from the caller's grant and this parent, never from the caller; the tag is unique per call, so uploads of the same project never collide. Push to the reference, then register the pushed digest with CreateArtifact.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/artifacts:prepareUpload`
- **Scope** `artifacts:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [artifacts](/docs/api/artifacts)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `parent` | `string` | The project the image is uploaded to. Required. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `image_reference` | `string` | The repository and tag to push, `<registry>/<org>/<project>-image:<upload>`; the tag is unique per call. Output only. |
| `registry_auth` | `string` | A Docker config JSON whose `identitytoken` for the registry authenticates this upload; a push credential, never stored or logged. Output only. Never returned again. |
| `expires_at` | `timestamp` | When the credential stops authenticating. `expires_at` names the issuer credential's expiry, the credential protocol's field. Output only. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/artifacts:prepareUpload" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**TypeScript**

```ts
const response = await sylphx.artifacts.artifacts.prepareUpload({ parent: 'orgs/acme/projects/shop' })
```

**Rust**

```rust
let mut req = sylphx::artifacts::PrepareUploadRequest::default();
req.parent = "orgs/acme/projects/shop".to_string();
let response = sx.artifacts().artifacts().prepare_upload(req).await?;
```

**CLI**

```bash
sylphx artifacts artifacts prepare-upload orgs/acme/projects/shop
```

**MCP**

```json
{ "method_id": "artifacts.artifacts.prepare_upload", "args": {"parent":"orgs/acme/projects/shop"} }
```
