---
search:
  tags:
    - Environments
    - POST
seo:
  description: >-
    Reference for the POST /v1/environments endpoint in the Carton API
    reference.
sidebar:
  label: POST /v1/environments
  badge: POST
title: POST /v1/environments
type: openapi-operation
---
`POST /v1/environments`

**Request body** (`application/json`, required)

- `labels` (object)
- `name` (Text)
- `source` (EnvironmentSource, required)

Request body example:

```json
{
  "labels": {
    "property1": "string",
    "property2": "string"
  },
  "name": "string",
  "source": {
    "image": "string",
    "type": "image"
  }
}
```

**Responses**

- `201` — Success
- `400` — Typed error; Retry-After is present when retryable
- `401` — Typed error; Retry-After is present when retryable
- `403` — Typed error; Retry-After is present when retryable
- `409` — Idempotency request in progress, expired response, or conflicting state
- `413` — Request exceeds policy body limit
- `415` — Expected application/json
- `422` — Typed error; Retry-After is present when retryable
- `429` — Typed error; Retry-After is present when retryable
- `500` — Typed error; Retry-After is present when retryable
- `503` — Typed error; Retry-After is present when retryable

Response example, 201:

```json
{
  "created_at": "2019-08-24T14:15:22Z",
  "id": "string",
  "labels": {
    "property1": "string",
    "property2": "string"
  },
  "latest_revision": "string",
  "name": "string"
}
```
