post/v2/secrets/{name}

Allows to create a new secret.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/secrets/name?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"name": "my-api-key",
4
"value": "some secret value",
5
"decryptable": true,
6
"projectId": "prj_2WjyKQmM8ZnGcJsPWMrHRHrE"
7
},
8
"headers": {
9
"Authorization": "Bearer <TOKEN>"
10
},
11
"method": "post"
12
})
Query Params
Body Params
Query ParameterDescription

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • createdstring (date-time)Required
    The date when the secret was created.

    Example: 2021-02-10T13:11:49.180Z

  • createdAtnumber
    Timestamp for when the secret was created.

    Example: 1609492210000

  • decryptableboolean
    Indicates whether the secret value can be decrypted after it has been created.

    Example: true

  • namestringRequired
    The name of the secret.

    Example: my-api-key

  • projectIdstring
    The unique identifier of the project which the secret belongs to.

    Example: prj_2WjyKQmM8ZnGcJsPWMrHRHrE

  • teamIdstring or null
    The unique identifier of the team the secret was created for.

    Example: team_LLHUOMOoDlqOp8wPE4kFo9pE

  • uidstringRequired
    The unique identifier of the secret.

    Example: sec_XCG7t7AIHuO2SBA8667zNUiM

  • userIdstring
    The unique identifier of the user who created the secret.

    Example: 2qDDuGFTWXBLDNnqZfWPDp1A

  • valueobjectRequired
  • Properties
CodeDescription
200Successful response showing the created secret.
400One 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

403You do not have permission to access this resource.
410
delete/v2/secrets/{idOrName}

This deletes the user or team’s secret defined in the URL.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/secrets/sec_RKc5iV0rV3ZSrFrHiruRno7k?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "delete"
6
})
Path Params
Query Params
Path ParameterDescription

idOrName

string

required
The name or the unique identifier to which the secret belongs to.
Example:sec_RKc5iV0rV3ZSrFrHiruRno7k
  • creatednumberRequired
    The date when the secret was created.

    Example: 2021-02-10T13:11:49.180Z

  • namestringRequired
    The name of the deleted secret.

    Example: my-api-key

  • uidstringRequired
    The unique identifier of the deleted secret.

    Example: sec_XCG7t7AIHuO2SBA8667zNUiM

CodeDescription
200
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
410
get/v3/secrets/{idOrName}

Retrieves the information for a specific secret by passing either the secret id or name in the URL.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v3/secrets/sec_RKc5iV0rV3ZSrFrHiruRno7k?decrypt=true&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

idOrName

string

required
The name or the unique identifier to which the secret belongs to.
Example:sec_RKc5iV0rV3ZSrFrHiruRno7k

Data representing a secret.

  • createdstring (date-time)Required
    The date when the secret was created.

    Example: 2021-02-10T13:11:49.180Z

  • createdAtnumber
    Timestamp for when the secret was created.

    Example: 1609492210000

  • decryptableboolean
    Indicates whether the secret value can be decrypted after it has been created.

    Example: true

  • namestringRequired
    The name of the secret.

    Example: my-api-key

  • projectIdstring
    The unique identifier of the project which the secret belongs to.

    Example: prj_2WjyKQmM8ZnGcJsPWMrHRHrE

  • teamIdstring or null
    The unique identifier of the team the secret was created for.

    Example: team_LLHUOMOoDlqOp8wPE4kFo9pE

  • uidstringRequired
    The unique identifier of the secret.

    Example: sec_XCG7t7AIHuO2SBA8667zNUiM

  • userIdstring
    The unique identifier of the user who created the secret.

    Example: 2qDDuGFTWXBLDNnqZfWPDp1A

  • valuestring
    The value of the secret.
CodeDescription
200Successful response retrieving a secret.
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
410
get/v3/secrets

Retrieves the active Vercel secrets for the authenticated user or team. By default it returns 20 secrets. The rest can be retrieved using the pagination options. The body will contain an entry for each secret.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v3/secrets?id=sec_RKc5iV0rV3ZSrFrHiruRno7k,sec_fGc5iV0rV3ZSrFrHiruRnouQ&projectId=prj_2WjyKQmM8ZnGcJsPWMrHRHrE&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Query Params
Query ParameterDescription

id

string

deprecated
Filter out secrets based on comma separated secret ids.
Example:sec_RKc5iV0rV3ZSrFrHiruRno7k,sec_fGc5iV0rV3ZSrFrHiruRnouQ

projectId

string

deprecated
Filter out secrets that belong to a project.
Example:prj_2WjyKQmM8ZnGcJsPWMrHRHrE

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • paginationRequired
  • secretsarrayRequired
  • Properties
CodeDescription
200Successful response retrieving a list of secrets.
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
410
patch/v2/secrets/{name}

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

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/secrets/my-api-key?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"name": "my-api-key"
4
},
5
"headers": {
6
"Authorization": "Bearer <TOKEN>"
7
},
8
"method": "patch"
9
})
Path Params
Query Params
Body Params
Path ParameterDescription

name

string

required
The name of the secret.
Example:my-api-key
  • createdstring (date-time)Required
  • namestringRequired
  • oldNamestringRequired
  • uidstringRequired
CodeDescription
200
400
  • One of the provided values in the request body is invalid.

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

401
403You do not have permission to access this resource.
410
Last updated on November 14, 2024