POST/v1/variables

Create a project variable

Creates a project variable with a name and value, with optional metadata. Supply projectId, name, and value; variable names must use only letters, numbers, and underscores, and names must be unique within the project.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

4 body fields

Project variable details. projectId, name, and value are required.

metadataobjectoptional
Optional key-value metadata, with string property names.
namestringrequired
The variable name. Must contain at least one character and use only letters, numbers, and underscores.
projectIdstringrequired
The identifier of the project to add the variable to.
valuestringrequired
The variable value. Must contain at least one character.

1 status code
201Returns the created project variable, including its identifier, name, project, and platform.
createdstringrequired
idstringrequired
metadataobjectoptional
namestringrequired
ownerobjectoptional
ownerIdstringoptional
platformIdstringrequired
projectIdstringrequired
updatedstringrequired

Error handling

The body must include projectId, name, and value, and name and value must each contain at least one character. name may contain only letters, numbers, and underscores, and a variable with the same name must not already exist in the project.