# Get an environment

`GET /logic/v1/environments/{id}`

Endpoints:

- `https://api.test.neobits.ai/logic/v1/environments/{id}`
- `https://api.prod.neobits.ai/logic/v1/environments/{id}`

Authentication: one of the following alternatives:

- `bearer`

- `bearer`: Bearer token authentication using OAuth 2.0 client credentials flow.

Retrieves one environment in the active workspace. Returns 404 when it is not found in that workspace.

Required service-token scope: `environment:read`. End-user access is checked against workspace policies. Send a Bearer token and the `X-Workspace-Id` header.

## Parameters

| Name | In | Required | Schema | Description |
| --- | --- | --- | --- | --- |
| `X-Workspace-Id` | header | yes | string (uuid); example `019991b1-0000-7000-8000-000000000001` | Active workspace UUID. The authenticated principal must have access to this workspace. |
| `id` | path | yes | string (uuid); example `019991b1-0000-7000-8000-000000000002` | Environment identifier. |

Parameter definitions (including all schema constraints and serialization options):

```json
[
  {
    "name": "X-Workspace-Id",
    "in": "header",
    "required": true,
    "description": "Active workspace UUID. The authenticated principal must have access to this workspace.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000001"
  },
  {
    "name": "id",
    "in": "path",
    "required": true,
    "description": "Environment identifier.",
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "example": "019991b1-0000-7000-8000-000000000002"
  }
]
```

## Responses

### 200 Environment details.

Content type: `application/json`

```json
{
  "title": "LogicEnvironment",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "description",
    "color",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Environment identifier.",
      "example": "019991b1-0000-7000-8000-000000000002"
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "Workspace containing this resource.",
      "example": "019991b1-0000-7000-8000-000000000001"
    },
    "name": {
      "type": "string",
      "description": "Nonempty name without leading or trailing whitespace.",
      "example": "Test",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description. Use null or an empty string to clear it.",
      "example": "Integration testing"
    },
    "color": {
      "type": "string",
      "description": "A six-digit hex color or one of the supported theme colors. If omitted on creation, a random theme color is persisted.",
      "pattern": "^(#[0-9a-fA-F]{6}|var\\(--color-(blue|purple|pink|yellow|aqua|cyan)-500\\))$",
      "example": "#2563eb"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "example": "2026-09-30T10:00:00.000Z"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Last update time.",
      "example": "2026-09-30T10:00:00.000Z"
    }
  },
  "example": {
    "id": "019991b1-0000-7000-8000-000000000002",
    "workspaceId": "019991b1-0000-7000-8000-000000000001",
    "name": "Test",
    "description": "Integration testing",
    "color": "#2563eb",
    "createdAt": "2026-09-30T10:00:00.000Z",
    "updatedAt": "2026-09-30T10:00:00.000Z"
  }
}
```

### 400 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "BadRequestResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "BadRequest"
            ],
            "example": "BadRequest"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "400-000",
              "400-001",
              "400-002",
              "400-003",
              "400-004",
              "400-005",
              "400-006",
              "400-007",
              "400-008",
              "400-100",
              "400-101",
              "400-102",
              "400-103",
              "400-104",
              "400-105",
              "400-106",
              "400-107",
              "400-108",
              "400-109",
              "400-110",
              "400-111",
              "400-112"
            ],
            "example": "400-001"
          },
          "message": {
            "type": "string",
            "example": "Field 'ssn' is required"
          }
        }
      }
    }
  }
}
```

### 401 Unauthorized

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "UnauthorizedResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Unauthorized"
            ],
            "example": "Unauthorized"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "401-000",
              "401-001",
              "401-002",
              "401-003",
              "401-004",
              "401-005",
              "401-006",
              "401-007"
            ],
            "example": "401-000"
          },
          "message": {
            "type": "string",
            "example": "Client is not authenticated"
          }
        }
      }
    }
  }
}
```

### 403 Bad Request

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ForbiddenResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Forbidden"
            ],
            "example": "Forbidden"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "403-000",
              "403-001"
            ],
            "example": "403-000"
          },
          "message": {
            "type": "string",
            "example": "Client does not have access to this resource"
          }
        }
      }
    }
  }
}
```

### 404 Not Found

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "NotFoundResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "NotFound"
            ],
            "example": "NotFound"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "404-000",
              "404-001",
              "404-002"
            ],
            "example": "404-000"
          },
          "message": {
            "type": "string",
            "example": "The requested resource was not found"
          }
        }
      }
    }
  }
}
```

### 429 Too Many Requests. When the rate limit rejects a request, the response carries `Retry-After` and only the `errors` field: no `timestamp`, `moreInfo` or `X-Request-ID`, as the request never reached the API.

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "Retry-After": {
      "description": "Seconds to wait before retrying. Sent when the rate limit rejects a request.",
      "schema": {
        "type": "integer",
        "example": 60
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TooManyRequestsResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "TooManyRequests"
            ],
            "example": "TooManyRequests"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "429-000"
            ],
            "example": "429-000"
          },
          "message": {
            "type": "string",
            "example": "Too many requests. Please try again later."
          }
        }
      }
    }
  }
}
```

### 500 Internal Server Error

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "InternalServerErrorResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "InternalServerError"
            ],
            "example": "InternalServerError"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "500-000",
              "500-001"
            ],
            "example": "500-000"
          },
          "message": {
            "type": "string",
            "example": "An unexpected internal error occurred"
          }
        }
      }
    }
  }
}
```

### 503 Service Unavailable

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "ServiceUnavailableResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "ServiceUnavailable"
            ],
            "example": "ServiceUnavailable"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "503-000"
            ],
            "example": "503-000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred while interacting with a third party service"
          }
        }
      }
    }
  }
}
```

### 504 Gateway Timeout

Response headers and links:

```json
{
  "headers": {
    "Content-Type": {
      "description": "The content type of the response.",
      "example": "application/json; charset=utf-8",
      "schema": {
        "type": "string",
        "enum": [
          "application/json; charset=utf-8"
        ]
      }
    },
    "X-Request-ID": {
      "description": "UUID generated on each request. Provide this id to customer support if an error occurs.",
      "schema": {
        "type": "string",
        "format": "uuid",
        "example": "0679c533-5061-496e-8dc5-df786f04a209"
      }
    }
  }
}
```

Content type: `application/json`

```json
{
  "title": "TimeoutResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "example": "2019-09-16T22:14:45.624Z"
    },
    "moreInfo": {
      "type": "string",
      "format": "url",
      "example": "https://docs.neobits.ai/"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "GatewayTimeout"
            ],
            "example": "GatewayTimeout"
          },
          "code": {
            "type": "string",
            "description": "Unique error code in format HTTP_STATUS-SEQUENCE",
            "enum": [
              "504-000"
            ],
            "example": "504-000"
          },
          "message": {
            "type": "string",
            "example": "The request timed out"
          }
        }
      }
    }
  }
}
```