---
title: "Update"
method: PATCH
path: "/external_storage_policies/{nameOrId}"
tags: ["externalStoragePolicies"]
---

# Update

`PATCH /external_storage_policies/{nameOrId}`

Updates an external storage policy by name or ID. Credentials can only be rotated by providing both `access_key_id` and `secret_access_key`.

## Path parameters

- `nameOrId` string, required

## Query parameters

- `project` string

## Headers

- `Authorization` string, required

## Request body

- UpdateExternalStoragePolicyRequest — Only the provided fields are updated. `access_key_id` and `secret_access_key` must be provided together.
  - `name` string — The name of the external storage policy. Must be snake_case, start with a lowercase letter and be unique within the project.
  - `endpoint_url` string — The S3-compatible endpoint URL that artifacts are uploaded to. Must be a publicly routable HTTPS URL without embedded credentials.
  - `bucket` string — The bucket that artifacts are uploaded to.
  - `region` string, nullable — The region of the bucket. Set to `null` when the endpoint doesn't require a region.
  - `key_prefix` string, nullable — Prefix prepended to every object key.
  - `addressing_style` 'auto' | 'virtual' | 'path' — How bucket names are addressed in requests to the endpoint.
  - `access_key_id` string — Access key ID used to authenticate with the endpoint. Must be provided together with `secret_access_key`.
  - `secret_access_key` string — Secret access key used to authenticate with the endpoint. Must be provided together with `access_key_id`.

## Response `200`

Success response

- ExternalStoragePoliciesUpdateResponse200
  - `success` boolean, required — Whether the external storage policy was updated successfully.

## Other responses

- `400` — Invalid parameters
- `401` — Unauthorized (authentication missing or invalid)
- `403` — Forbidden (resource belongs to a different organization)
- `404` — External storage policy not found
- `409` — External storage policy name already exists
- `500` — Internal server error

---

[API](https://skmtc.net/phonic/apis/api-reference.md) · [All operations](https://skmtc.net/phonic/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phonic/api-reference/revisions/7f8c81a5a990/schema)
