---
# @generated by sylphx-gen. Do not edit.
title: "Update an artifact reference"
description: "`artifacts.artifact_references.update` (PATCH /v1/{artifact_reference.name}): Updates a holder's retention reference, or creates it with allow_missing."
type: reference
product: platform
summary: "Updates a holder's retention reference, or creates it with allow_missing."
updated: 2026-09-28
nav: false
---

Updates a holder's retention reference, or creates it with allow_missing. Existing expiry is only extended, never shortened. The exact repository and digest must have an owned Artifact receipt. Success means the registry protection tag has been written and read back; a failed pin attempt commits no reference. Concurrent updates never shorten retention.

- **Path** `PATCH https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference`
- **Scope** `artifacts:retain`
- **Effect** `write` — a successful call changes state.
- **Collection** [artifact_references](/docs/api/artifact_references)
- **Query** `update_mask`, `allow_missing`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `artifact_reference` | `ArtifactReference` | The reference to update; name identifies its immutable image and holder. Required. |
| `update_mask` | `field_mask` | Only expires_at is mutable. Unset or * writes populated fields. |
| `allow_missing` | `bool` | Create this reference when absent, after verifying ownership and pinning. |

### ArtifactReference

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The canonical reference name; derived from the image and holder identity. |
| `repository` | `string` | The exact managed registry repository, without host, tag or digest. |
| `digest` | `string` | The exact algorithm-qualified SHA-256 image digest. |
| `holder_kind` | `string` | The kind of holding resource, for example `device_state`. |
| `holder_id` | `string` | The holding resource's stable identity within this environment. |
| `expires_at` | `timestamp` | Keep this image until this instant. Repeating Update only extends it. Required. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The canonical reference name; derived from the image and holder identity. |
| `uid` | `string` | The immutable reference identity. Output only. |
| `meta` | `ResourceMeta` | Creation metadata. Output only. |
| `repository` | `string` | The exact managed registry repository, without host, tag or digest. |
| `digest` | `string` | The exact algorithm-qualified SHA-256 image digest. |
| `holder_kind` | `string` | The kind of holding resource, for example `device_state`. |
| `holder_id` | `string` | The holding resource's stable identity within this environment. |
| `expires_at` | `timestamp` | Keep this image until this instant. Repeating Update only extends it. Required. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `generation` | `int64` | Increases by one on every change to `spec`. Output only. |
| `etag` | `string` | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as `If-Match` or `etag` to make Update and Delete conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`. Output only. |
| `create_time` | `timestamp` | When the Resource was created. Output only. |
| `update_time` | `timestamp` | When the Resource last changed. Output only. |
| `delete_time` | `timestamp` | Set while the Resource is being deleted. Output only. |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |
| `creator` | `string` | The principal that created the Resource. 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.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`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 PATCH "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expires_at":{},"name":"orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference"}'
```

**TypeScript**

```ts
const response = await sylphx.artifacts.artifactReferences.update({ artifactReference: { expiresAt: {}, name: 'orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference' } })
```

**Rust**

```rust
let mut req = sylphx::artifacts::UpdateArtifactReferenceRequest::default();
req.artifact_reference = Some(sylphx::artifacts::ArtifactReference {
    expires_at: Some(Default::default()),
    name: "orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference".to_string(),
    ..Default::default()
});
let response = sx.artifacts().artifact_references().update(req).await?;
```

**CLI**

```bash
sylphx artifacts artifact-references update orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference
```

**MCP**

```json
{ "method_id": "artifacts.artifact_references.update", "args": {"artifact_reference":{"expires_at":{},"name":"orgs/acme/projects/shop/envs/production/artifact_references/artifact-reference"}} }
```
