v13
latestOpenAPI 3.0.32026-07-31359869.4 MBprojects
Create one or more environment variables
Create 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.
post/v10/projects/{idOrName}/env
Path parameters
idOrNamestring required
The unique project identifier or the project name
Example:prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA
The unique project identifier or the project name
Query parameters
upsertstring
Allow override of environment variable if it already exists
Example:true
Allow override of environment variable if it already exists
teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team identifier to perform the request on behalf of.
slugstring
Example:my-team-url-slug
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