Add an environment to the list
const url = 'https://beta-api.plune.ai/v1/environments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"staging"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/environments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "staging" }'The project owner’s. The first one makes the project’s system field. «Add to list» of a seen value is this call with its name. A name the list already has by the same rule, an archived one too, is a 409, and so is the 101st environment (the archived ones count). An entry of the feed about the field.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Trimmed of spaces, tabs, carriage returns and line feeds at either end (a no-break space stays). The value a run is written with.
Example
{ "name": "staging"}Responses
Section titled “ Responses ”Added, at the end of the list, with its runs counted
An environment of the project’s list (#1252, ADR 0071): an option of its system field, whose name is the value a run carries in environment.
object
The option’s id: never changes and is never reused.
Set while archived: one not to offer for new runs. The runs keep it, and a run that reports it is still taken.
The live runs of the project whose environment is this name lower-cased and trimmed of spaces, tabs, carriage returns and line feeds: «Staging» and «staging » count as one.
When the newest of those runs started.
Example
{ "id": "opt_5e1a9c07d2", "name": "staging", "archivedAt": null, "runs": 48, "lastRunAt": "2026-09-16T09:12:04.151Z"}Invalid body: a name of 1 to 64 characters
object
Example
{ "error": "validation failed — name: an environment needs a name"}No / invalid token or session
You are in the project, but not as its owner
object
Example
{ "error": "project owner only"}The name is in the list already, or the list holds 100
object
Example
{ "error": "an environment named 'staging' is already in the list (an archived one counts)"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over