Allows to create a new secret.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
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
Code | Description |
---|---|
200 | Successful response showing the created secret. |
400 | One of the provided values in the request body is invalid. |
401 | |
402 |
|
403 | You do not have permission to access this resource. |
410 |
Optional params
fetch-request
1await 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})
This deletes the user or team’s secret defined in the URL.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
idOrName | string requiredThe 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
Code | Description |
---|---|
200 | |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
410 |
Optional params
fetch-request
1await 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})
Retrieves the information for a specific secret by passing either the secret id or name in the URL.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
idOrName | string requiredThe 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.
Code | Description |
---|---|
200 | Successful response retrieving a secret. |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
404 | |
410 |
Optional params
fetch-request
1await 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})
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
1await 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 Parameter | Description |
---|---|
id | string deprecatedFilter out secrets based on comma separated secret ids. Example: sec_RKc5iV0rV3ZSrFrHiruRno7k,sec_fGc5iV0rV3ZSrFrHiruRnouQ |
projectId | string deprecatedFilter 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
Code | Description |
---|---|
200 | Successful response retrieving a list of secrets. |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
410 |
Optional params
fetch-request
1await 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})
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
1await 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 Parameter | Description |
---|---|
name | string requiredThe name of the secret. Example: my-api-key |
createdstring (date-time)Required namestringRequired oldNamestringRequired uidstringRequired
Code | Description |
---|---|
200 | |
400 |
|
401 | |
403 | You do not have permission to access this resource. |
410 |
Optional params
fetch-request
1await 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})
Was this helpful?