PUT
/
v8
/
artifacts
/
{hash}
import { Vercel } from "@vercel/sdk";
import { openAsBlob } from "node:fs";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.artifacts.uploadArtifact({
    contentLength: 4504.13,
    xArtifactDuration: 400,
    xArtifactClientCi: "VERCEL",
    xArtifactClientInteractive: 0,
    xArtifactTag: "Tc0BmHvJYMIYJ62/zx87YqO0Flxk+5Ovip25NY825CQ=",
    hash: "12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: await openAsBlob("example.file"),
  });

  // Handle the result
  console.log(result);
}

run();
{
  "urls": [
    "https://api.vercel.com/v2/now/artifact/12HKQaOmR5t5Uy6vdcQsNIiZgHGB"
  ]
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Headers

Content-Length
number
required

The artifact size in bytes

x-artifact-duration
number

The time taken to generate the uploaded artifact in milliseconds.

Example:

400

x-artifact-client-ci
string

The continuous integration or delivery environment where this artifact was generated.

Maximum length: 50
Example:

"VERCEL"

x-artifact-client-interactive
integer

1 if the client is an interactive shell. Otherwise 0

Required range: 0 <= x <= 1
Example:

0

x-artifact-tag
string

The base64 encoded tag for this artifact. The value is sent back to clients when the artifact is downloaded as the header x-artifact-tag

Maximum length: 600
Example:

"Tc0BmHvJYMIYJ62/zx87YqO0Flxk+5Ovip25NY825CQ="

Path Parameters

hash
string
required

The artifact hash

Example:

"12HKQaOmR5t5Uy6vdcQsNIiZgHGB"

Query Parameters

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Body

application/octet-stream · file

The body is of type file.

Response

202
application/json
File successfully uploaded
urls
string[]
required

Array of URLs where the artifact was updated

Example:
[
  "https://api.vercel.com/v2/now/artifact/12HKQaOmR5t5Uy6vdcQsNIiZgHGB"
]