Projects Environments
Create a new environment on the current project
POST
project_id*integerThe ID of the project.
Range
1 <= valueAccept*stringapplication/json
Content-Type*stringapplication/json
A JSON object containing the resource data
application/json- body
type*EnvironmentTypeEnvironment's type
Value in
"development""production""staging"name*stringThe environment's name. Must not be greater than 60 characters.
description?stringThe environment's description. Must not be greater than 255 characters.
Created
application/json- response
id*integerUnique id of the given record
type*EnvironmentTypeEnvironment's type
Value in
"development""production""staging"type_human_readable*stringThe human readable version of the type
name*stringEnvironment's name
description*|Environment's description
is_archived*booleanIndicates whether the record was archived
resource_summary?array<>Summary of the resource
teams*array<|null>current_user_permissions*RolePermissionsThe list of permissions granted for this role
created_by_user*|nullcreated_at*stringThe date and time when the record was created
updated_at*stringThe date and time when the record was last updated
curl -X POST 'https://api.devopness.com/projects/123/environments' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer <your_api_token>' \ -H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \ -d '{ "type": "staging", "name": "My staging"}'Example Response
{ "id": 16523, "type": "staging", "type_human_readable": "Staging", "name": "My staging", "description": "My staging environment", "is_archived": false, "resource_summary": [ { "resource_type": "environment", "resource_type_plural": "environments", "resource_type_human_readable": "Environment", "resource_type_human_readable_plural": "Environments", "summary": { "count": 1 } } ], "teams": [ { "id": 137, "name": "Some Development Team", "photo_url": "https://example.com/images/my_team.png", "organization": { "id": 16523, "name": "My Organization", "url_slug": "MyOrganization", "resource_summary": [ { "resource_type": "environment", "resource_type_plural": "environments", "resource_type_human_readable": "Environment", "resource_type_human_readable_plural": "Environments", "summary": { "count": 1 } } ], "owner": { "id": 1, "name": "string", "email": "user@example.com", "url_slug": "someone", "language": "en", "active": true, "created_at": "2019-09-25T15:50:48.000000Z", "updated_at": "2019-09-25T13:52:04.000000Z" }, "created_at": "2019-09-25T15:50:48.000000Z", "updated_at": "2019-09-25T13:52:04.000000Z" }, "created_by_user": { "id": 1, "name": "string", "email": "user@example.com", "url_slug": "someone", "language": "en", "active": true, "created_at": "2019-09-25T15:50:48.000000Z", "updated_at": "2019-09-25T13:52:04.000000Z" }, "created_at": "2019-09-25T13:22:37.000000Z", "updated_at": "2019-09-25T13:22:37.000000Z" } ], "current_user_permissions": [ "application:read", "application:create", "server:read" ], "created_by_user": { "id": 1, "name": "string", "email": "user@example.com", "url_slug": "someone", "language": "en", "active": true, "created_at": "2019-09-25T15:50:48.000000Z", "updated_at": "2019-09-25T13:52:04.000000Z" }, "created_at": "2019-09-25T15:50:48.000000Z", "updated_at": "2019-09-25T13:52:04.000000Z"}