Environments
Environments provide logical isolation for resources within your organization.
Create Environment
POST /v1/environments
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Environment name (1-50 chars, lowercase alphanumeric, hyphens, underscores) |
Example:
curl -X POST https://api.embedd.to/v1/environments \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{"name": "production"}'
Response (201):
{
"id": "env_abc123",
"org_id": "org_xyz",
"name": "production",
"created_at": "2025-01-15T10:00:00Z"
}
List Environments
GET /v1/environments
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Items per page (1-100) |
cursor | string | null | Pagination cursor |
Response (200):
{
"data": [
{
"id": "env_abc123",
"org_id": "org_xyz",
"name": "production",
"created_at": "2025-01-15T10:00:00Z"
}
],
"pagination": {
"limit": 20,
"has_more": false,
"next_cursor": null
}
}
Get Environment
GET /v1/environments/{environment_id}
Response (200): Same as single environment object above.
Delete Environment
DELETE /v1/environments/{environment_id}
Fails with 409 Conflict if the environment has connections or vector tables attached.
Response: 204 No Content