> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/api/api-reference/environments.md).

# Environments

Environments partition a Celigo account into separate, isolated spaces. Each environment has its own users, integrations, connections, and flows, functioning like independent accounts under a single license.

Requires the environments feature to be enabled. Every account with the feature starts with a Production environment that cannot be disabled.

### Environment schema

## The Environment object

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"components":{"schemas":{"Environment":{"type":"object","required":["_id","_envUserId","name","enabled","createdAt","lastModified"],"description":"Environment object as returned by the API.","allOf":[{"$ref":"#/components/schemas/EnvironmentBase"},{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_envUserId":{"type":"string","format":"objectId","readOnly":true,"description":"Account user ID that owns this environment."},"enabled":{"type":"boolean","readOnly":true,"description":"When true, the environment is currently enabled. Controlled via the toggle endpoint, not create/update."},"isMigrated":{"type":"boolean","readOnly":true,"description":"When true, the environment has been migrated from legacy sandbox. Present only on enterprise accounts."}}}]},"EnvironmentBase":{"type":"object","description":"Writable fields shared by the request and response schemas.","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the environment. Must be unique within the account."},"description":{"type":["string","null"],"description":"Free-text description of the environment's purpose. Null on environments\nprovisioned automatically by the platform; descriptions set through the\nUI or API are strings. When writing, send a string or omit the field."},"apim":{"type":"object","description":"API Management metadata linking this environment to its APIM counterpart. Typically managed by APIM workflows.","properties":{"environmentId":{"type":"string","description":"APIM environment identifier."},"environmentHRID":{"type":"string","description":"Human-readable APIM environment slug used in URLs."},"groupId":{"type":"string","description":"APIM group identifier for access control."}}}}},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]}}}}
```

## List environments

> Returns all environments in the account. Requires the environments\
> feature to be enabled -- accounts without it receive\
> \`feature\_not\_enabled\`. Every account with the feature has at least\
> one environment (Production). The full list is returned in a single\
> unpaginated response.

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"tags":[{"name":"Environments","description":"Environments partition a Celigo account into separate, isolated spaces.\nEach environment has its own users, integrations, connections, and flows,\nfunctioning like independent accounts under a single license.\n\nRequires the environments feature to be enabled. Every account with the\nfeature starts with a Production environment that cannot be disabled.\n\n## Environment schema\n\n{% openapi-schemas spec=\"environment\" schemas=\"Environment\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Environment":{"type":"object","required":["_id","_envUserId","name","enabled","createdAt","lastModified"],"description":"Environment object as returned by the API.","allOf":[{"$ref":"#/components/schemas/EnvironmentBase"},{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_envUserId":{"type":"string","format":"objectId","readOnly":true,"description":"Account user ID that owns this environment."},"enabled":{"type":"boolean","readOnly":true,"description":"When true, the environment is currently enabled. Controlled via the toggle endpoint, not create/update."},"isMigrated":{"type":"boolean","readOnly":true,"description":"When true, the environment has been migrated from legacy sandbox. Present only on enterprise accounts."}}}]},"EnvironmentBase":{"type":"object","description":"Writable fields shared by the request and response schemas.","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the environment. Must be unique within the account."},"description":{"type":["string","null"],"description":"Free-text description of the environment's purpose. Null on environments\nprovisioned automatically by the platform; descriptions set through the\nUI or API are strings. When writing, send a string or omit the field."},"apim":{"type":"object","description":"API Management metadata linking this environment to its APIM counterpart. Typically managed by APIM workflows.","properties":{"environmentId":{"type":"string","description":"APIM environment identifier."},"environmentHRID":{"type":"string","description":"Human-readable APIM environment slug used in URLs."},"groupId":{"type":"string","description":"APIM group identifier for access control."}}}}},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/environments":{"get":{"summary":"List environments","operationId":"listEnvironments","tags":["Environments"],"description":"Returns all environments in the account. Requires the environments\nfeature to be enabled -- accounts without it receive\n`feature_not_enabled`. Every account with the feature has at least\none environment (Production). The full list is returned in a single\nunpaginated response.","responses":{"200":{"description":"List of environments.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}}}}},"204":{"description":"No environments exist in the account"},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Create an environment

> Creates a new environment. The environment starts disabled; use the\
> toggle endpoint to enable it. \`name\` is the only required field and\
> must be unique within the account.

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"tags":[{"name":"Environments","description":"Environments partition a Celigo account into separate, isolated spaces.\nEach environment has its own users, integrations, connections, and flows,\nfunctioning like independent accounts under a single license.\n\nRequires the environments feature to be enabled. Every account with the\nfeature starts with a Production environment that cannot be disabled.\n\n## Environment schema\n\n{% openapi-schemas spec=\"environment\" schemas=\"Environment\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Request":{"type":"object","description":"Fields for creating or updating an environment.","required":["name"],"allOf":[{"$ref":"#/components/schemas/EnvironmentBase"}]},"EnvironmentBase":{"type":"object","description":"Writable fields shared by the request and response schemas.","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the environment. Must be unique within the account."},"description":{"type":["string","null"],"description":"Free-text description of the environment's purpose. Null on environments\nprovisioned automatically by the platform; descriptions set through the\nUI or API are strings. When writing, send a string or omit the field."},"apim":{"type":"object","description":"API Management metadata linking this environment to its APIM counterpart. Typically managed by APIM workflows.","properties":{"environmentId":{"type":"string","description":"APIM environment identifier."},"environmentHRID":{"type":"string","description":"Human-readable APIM environment slug used in URLs."},"groupId":{"type":"string","description":"APIM group identifier for access control."}}}}},"Environment":{"type":"object","required":["_id","_envUserId","name","enabled","createdAt","lastModified"],"description":"Environment object as returned by the API.","allOf":[{"$ref":"#/components/schemas/EnvironmentBase"},{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_envUserId":{"type":"string","format":"objectId","readOnly":true,"description":"Account user ID that owns this environment."},"enabled":{"type":"boolean","readOnly":true,"description":"When true, the environment is currently enabled. Controlled via the toggle endpoint, not create/update."},"isMigrated":{"type":"boolean","readOnly":true,"description":"When true, the environment has been migrated from legacy sandbox. Present only on enterprise accounts."}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/environments":{"post":{"summary":"Create an environment","operationId":"createEnvironment","tags":["Environments"],"description":"Creates a new environment. The environment starts disabled; use the\ntoggle endpoint to enable it. `name` is the only required field and\nmust be unique within the account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"201":{"description":"Environment created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Get an environment

> Retrieves a single environment by ID.

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"tags":[{"name":"Environments","description":"Environments partition a Celigo account into separate, isolated spaces.\nEach environment has its own users, integrations, connections, and flows,\nfunctioning like independent accounts under a single license.\n\nRequires the environments feature to be enabled. Every account with the\nfeature starts with a Production environment that cannot be disabled.\n\n## Environment schema\n\n{% openapi-schemas spec=\"environment\" schemas=\"Environment\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Environment":{"type":"object","required":["_id","_envUserId","name","enabled","createdAt","lastModified"],"description":"Environment object as returned by the API.","allOf":[{"$ref":"#/components/schemas/EnvironmentBase"},{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_envUserId":{"type":"string","format":"objectId","readOnly":true,"description":"Account user ID that owns this environment."},"enabled":{"type":"boolean","readOnly":true,"description":"When true, the environment is currently enabled. Controlled via the toggle endpoint, not create/update."},"isMigrated":{"type":"boolean","readOnly":true,"description":"When true, the environment has been migrated from legacy sandbox. Present only on enterprise accounts."}}}]},"EnvironmentBase":{"type":"object","description":"Writable fields shared by the request and response schemas.","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the environment. Must be unique within the account."},"description":{"type":["string","null"],"description":"Free-text description of the environment's purpose. Null on environments\nprovisioned automatically by the platform; descriptions set through the\nUI or API are strings. When writing, send a string or omit the field."},"apim":{"type":"object","description":"API Management metadata linking this environment to its APIM counterpart. Typically managed by APIM workflows.","properties":{"environmentId":{"type":"string","description":"APIM environment identifier."},"environmentHRID":{"type":"string","description":"Human-readable APIM environment slug used in URLs."},"groupId":{"type":"string","description":"APIM group identifier for access control."}}}}},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/environments/{_id}":{"get":{"summary":"Get an environment","operationId":"getEnvironment","tags":["Environments"],"description":"Retrieves a single environment by ID.","parameters":[{"name":"_id","in":"path","required":true,"description":"Environment ID.","schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Environment details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Update an environment

> Replaces an environment's mutable fields (\`name\`, \`description\`,\
> \`apim\`). To enable or disable an environment, use the toggle\
> endpoint instead.

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"tags":[{"name":"Environments","description":"Environments partition a Celigo account into separate, isolated spaces.\nEach environment has its own users, integrations, connections, and flows,\nfunctioning like independent accounts under a single license.\n\nRequires the environments feature to be enabled. Every account with the\nfeature starts with a Production environment that cannot be disabled.\n\n## Environment schema\n\n{% openapi-schemas spec=\"environment\" schemas=\"Environment\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Request":{"type":"object","description":"Fields for creating or updating an environment.","required":["name"],"allOf":[{"$ref":"#/components/schemas/EnvironmentBase"}]},"EnvironmentBase":{"type":"object","description":"Writable fields shared by the request and response schemas.","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the environment. Must be unique within the account."},"description":{"type":["string","null"],"description":"Free-text description of the environment's purpose. Null on environments\nprovisioned automatically by the platform; descriptions set through the\nUI or API are strings. When writing, send a string or omit the field."},"apim":{"type":"object","description":"API Management metadata linking this environment to its APIM counterpart. Typically managed by APIM workflows.","properties":{"environmentId":{"type":"string","description":"APIM environment identifier."},"environmentHRID":{"type":"string","description":"Human-readable APIM environment slug used in URLs."},"groupId":{"type":"string","description":"APIM group identifier for access control."}}}}},"Environment":{"type":"object","required":["_id","_envUserId","name","enabled","createdAt","lastModified"],"description":"Environment object as returned by the API.","allOf":[{"$ref":"#/components/schemas/EnvironmentBase"},{"$ref":"#/components/schemas/ResourceResponse"},{"type":"object","properties":{"_envUserId":{"type":"string","format":"objectId","readOnly":true,"description":"Account user ID that owns this environment."},"enabled":{"type":"boolean","readOnly":true,"description":"When true, the environment is currently enabled. Controlled via the toggle endpoint, not create/update."},"isMigrated":{"type":"boolean","readOnly":true,"description":"When true, the environment has been migrated from legacy sandbox. Present only on enterprise accounts."}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/environments/{_id}":{"put":{"summary":"Update an environment","operationId":"updateEnvironment","tags":["Environments"],"description":"Replaces an environment's mutable fields (`name`, `description`,\n`apim`). To enable or disable an environment, use the toggle\nendpoint instead.","parameters":[{"name":"_id","in":"path","required":true,"description":"Environment ID.","schema":{"type":"string","format":"objectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"200":{"description":"Updated environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Toggle an environment on or off

> Toggles the enabled state of an environment -- a disabled environment\
> becomes enabled and vice versa. The Production environment cannot be\
> disabled, and pending user invitations must be resolved before\
> disabling any environment.\
> \
> Requires a \`Content-Type: application/json\` header even though no\
> request body is needed.

```json
{"openapi":"3.2.0","info":{"title":"Environments","version":"1.0.0"},"tags":[{"name":"Environments","description":"Environments partition a Celigo account into separate, isolated spaces.\nEach environment has its own users, integrations, connections, and flows,\nfunctioning like independent accounts under a single license.\n\nRequires the environments feature to be enabled. Every account with the\nfeature starts with a Production environment that cannot be disabled.\n\n## Environment schema\n\n{% openapi-schemas spec=\"environment\" schemas=\"Environment\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/environments/{_id}/enable":{"put":{"operationId":"toggleEnvironment","tags":["Environments"],"summary":"Toggle an environment on or off","description":"Toggles the enabled state of an environment -- a disabled environment\nbecomes enabled and vice versa. The Production environment cannot be\ndisabled, and pending user invitations must be resolved before\ndisabling any environment.\n\nRequires a `Content-Type: application/json` header even though no\nrequest body is needed.","parameters":[{"name":"_id","in":"path","required":true,"description":"Environment ID.","schema":{"type":"string","format":"objectId"}}],"responses":{"204":{"description":"Environment state toggled."},"400":{"description":"The Production environment cannot be disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"description":"Pending user invitations must be resolved before disabling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/api/api-reference/environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
