---
title: "Register a new patch artifact and obtain an upload URL."
method: POST
path: "/apps/{appId}/patches/{patchId}/artifacts"
tags: ["patches"]
---

# Register a new patch artifact and obtain an upload URL.

`POST /apps/{appId}/patches/{patchId}/artifacts`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/apps/{appId}/patches/{patchId}/artifacts`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Request body

- CreatePatchArtifactRequest: Metadata for a new patch artifact. POST to /apps/{appId}/patches/{patchId}/artifacts and use the returned signed upload URL to upload the artifact bytes separately.
  - `arch` string, required: The arch of the artifact.
  - `platform` 'android' | 'ios' | 'linux' | 'macos' | 'windows', required: A platform to which a Shorebird release can be deployed.
  - `hash` string, required: The hash of the artifact.
  - `hash_signature` string: The signature of the [hash], for a release whose binary embeds the customer's own key. Null for an unsigned patch. Refused (400) for a release whose binary embeds a managed key: the server signs those patches itself, and fails the request rather than store an unsigned one.
  - `podfile_lock_hash` string: The sha256 hash of the Podfile.lock file, if a Podfile.lock file was involved in the creation of the patch (iOS only).
  - `size` integer, required: The size of the artifact in bytes.

## Response `200`

The newly-registered patch artifact.

- CreatePatchArtifactResponse: The response body for registering a patch artifact.
  - `id` integer, required: The ID of the artifact.
  - `patch_id` integer, required: The ID of the patch.
  - `arch` string, required: The arch of the artifact.
  - `platform` 'android' | 'ios' | 'linux' | 'macos' | 'windows', required: A platform to which a Shorebird release can be deployed.
  - `hash` string, required: The hash of the artifact.
  - `size` integer, required: The size of the artifact in bytes.
  - `url` string, required: The upload URL for the artifact.
  - `upload_method` 'multipart' | 'resumable': How a client should upload an artifact's bytes to storage.

## Other responses

- `422`: The release's Flutter revision is marked bad at the block level for the artifact's platform (`flutter_revision_blocked`). The message names the revision, the platform, what is wrong and, when known, the Flutter revision to release with instead. A mark that only warns never refuses.
- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
