Skip to Content
Projects Environments

Create a new environment on the current project

POST
/projects/{project_id}/environments

Path Parameters

project_id*integer

The ID of the project.

Range1 <= value

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Request Body

A JSON object containing the resource data

application/json
  1. body
type*EnvironmentType

Environment's type

Value in"development""production""staging"
name*string

The environment's name. Must not be greater than 60 characters.

description?string

The environment's description. Must not be greater than 255 characters.

Response Body

Created

application/json
  1. response
id*integer

Unique id of the given record

type*EnvironmentType

Environment's type

Value in"development""production""staging"
type_human_readable*string

The human readable version of the type

name*string

Environment's name

description*|

Environment's description

is_archived*boolean

Indicates whether the record was archived

resource_summary?array<>

Summary of the resource

teams*array<|null>
current_user_permissions*RolePermissions

The list of permissions granted for this role

created_by_user*|null
created_at*string

The date and time when the record was created

updated_at*string

The date and time when the record was last updated

Example Request
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"}