Create a new environment
POST
/api/v1/environment
const url = 'https://app.prefactorai.com/api/v1/environment';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"account_id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","description":null,"id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","name":"example","purpose":"development"}'};
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://app.prefactorai.com/api/v1/environment \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "description": null, "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "name": "example", "purpose": "development" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Environment_DetailsForCreate
object
account_id
Account_Id
A valid account ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyid
One of:
Environment_Id
A valid environment ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Null
string
name
string
purpose
Environment purpose
string
Example
developmentResponses
Section titled “Responses”Success
Media typeapplication/json
object
details
Environment_Details
status
string
Example
{ "details": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "description": null, "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "name": "Development", "purpose": "development", "type": "environment" }, "status": "success"}default
Section titled “default”Error