Admiral

Environments

Create an environment

POST
/v1/environments

Scope: env:write

Authorization

bearerAuth
AuthorizationBearer <token>

An API key, or an access token minted from one. Pass it in the Authorization header: Bearer admp_...

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

CreateEnvironmentRequest creates an environment under an application.

Response Body

application/json

curl -X POST "https://example.com/v1/environments" \  -H "Content-Type: application/json" \  -d '{    "application_id": "string",    "environment": {}  }'
{  "environment": {    "id": "string",    "application_id": "string",    "name": "string",    "description": "string",    "labels": {      "property1": "string",      "property2": "string"    },    "created_by": {      "id": "string",      "display_name": "string",      "email": "string"    },    "created_at": "2023-01-15T01:30:15.01Z",    "updated_at": "2023-01-15T01:30:15.01Z",    "agents": [      {        "agent_id": "string",        "id": "string",        "kubernetes": {          "default_namespace": "string",          "create_namespaces": true,          "prune": true        }      }    ],    "approval": {      "required_approvals": 0,      "groups": [        {          "group_id": "string",          "approvals": 1        }      ]    },    "generation": "string",    "hold": {      "change_set_id": "string",      "held_at": "2023-01-15T01:30:15.01Z"    },    "last_apply": {      "change_set_id": "string",      "revision_id": "string",      "applied_at": "2023-01-15T01:30:15.01Z"    },    "infra_backend": {      "type": "string",      "config": {        "property1": null,        "property2": null      }    },    "infra_engine": {      "engine": "INFRA_ENGINE_UNSPECIFIED",      "version": "string"    },    "tracking": {      "kind": "KIND_UNSPECIFIED",      "pattern": "string"    }  }}