secrets

Change secret name

Enables to edit the name of a secret. The name has to be unique to the user or team’s secrets.

Path Parameters
  • name
    string
    required

    The name of the secret.

    Examplemy-api-key
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

  • slug
    string

    The Team slug to perform the request on behalf of.

Body
application/json
name
string
max: 
100
required

The name of the new secret.

Examplemy-api-key
Responses
  • 400

    One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.

  • 401
  • 403

    You do not have permission to access this resource.

  • 410
PATCH/v2/secrets/{name}
fetch('https://api.vercel.com/v2/secrets/{name}', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'my-api-key'
  })
})
{
  "uid": "…",
  "name": "…",
  "created": "2025-04-02T04:18:45.334Z",
  "oldName": "…"
}

Create a new secret

Allows to create a new secret.

Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

  • slug
    string

    The Team slug to perform the request on behalf of.

Body
application/json
name
string
max: 
100
required

The name of the secret (max 100 characters).

Examplemy-api-key
value
string
required

The value of the new secret.

Examplesome secret value
decryptable
boolean

Whether the secret value can be decrypted after it has been created.

Exampletrue
projectId
deprecated
string

Associate a secret to a project.

Exampleprj_2WjyKQmM8ZnGcJsPWMrHRHrE
Responses
  • 400

    One of the provided values in the request body is invalid.

  • 401
  • 402

    The account was soft-blocked for an unhandled reason. The account is missing a payment so payment method must be updated

  • 403

    You do not have permission to access this resource.

  • 410
POST/v2/secrets/{name}
fetch('https://api.vercel.com/v2/secrets/{name}', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'my-api-key',
    value: 'some secret value',
    decryptable: true,
    projectId: 'prj_2WjyKQmM8ZnGcJsPWMrHRHrE'
  })
})
{
  "value": {
    "type": "Buffer",
    "data": [
      1
    ]
  },
  "created": "2021-02-10T13:11:49.180Z",
  "name": "my-api-key",
  "teamId": "team_LLHUOMOoDlqOp8wPE4kFo9pE",
  "uid": "sec_XCG7t7AIHuO2SBA8667zNUiM",
  "userId": "2qDDuGFTWXBLDNnqZfWPDp1A",
  "createdAt": 1609492210000,
  "projectId": "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
  "decryptable": true
}
v0.0.1
OAS 3.0.3

Vercel REST API

The Vercel REST API is a REST-styled API that gives you full control over the entire Vercel platform. You can use it with any programming language or framework that can send HTTP requests. You need to authenticate with a Vercel access token for every request.

Production API

No authentication selected
Client Libraries

api-experimentation

api-experimentation Endpoints

certs

projectMembers

Models