Create one or more environment variables
Changed onCreate one or more environment variables for a project by passing its key, value, type and target and by specifying the project by either passing the project id or name in the URL. If you include upsert=true as a query parameter, a new environment variable will not be created if it already exists but, the existing variable's value will be updated.
Request
- Base URL: https://api.vercel.com
- URL: https://api.vercel.com/v10/projects/{idOrName}/env
- Auth: HTTP bearer
Path parameters
The unique project identifier or the project name
Query parameters
Allow override of environment variable if it already exists
The Team identifier to perform the request on behalf of.
The Team slug to perform the request on behalf of.
Request body
Example request
[
{
"key": "API_URL",
"value": "https://api.vercel.com",
"type": "plain",
"target": [
"preview"
],
"gitBranch": "feature-1",
"comment": "database connection string for production",
"customEnvironmentIds": [
"env_1234567890"
]
}
]Response
The environment variable was created successfully
Changes
- breaking
added
subschema #1subschema #2to theresponse propertyoneOflist for the response status - info
removed
subschema #1subschema #2from theresponse propertyoneOflist for the response status
- breaking
- breaking
the response property
became optional for the status
- breaking