Organizations API
Manage organizations and their settings
The Organizations API allows you to manage your Xata organizations, including listing, creating, updating, and deleting organizations. All endpoints require authentication via API key or OIDC.
Authentication
All endpoints require authentication. You can authenticate using:
- API Key: Include your API key in the
Authorization
header:Authorization: Bearer <your-api-key>
- OIDC: Use OIDC tokens for authentication
Required scopes for different operations:
- project:read: Read organization information and list available regions
List organizations
Retrieves a list of all organizations you have access to.
GET /organizations
Summary
Returns a list of all organizations that the authenticated user has access to, including basic metadata such as ID, name, and creation/update timestamps.
Response
Status: 200 OK
{
"organizations": [
{
"id": "org_123",
"name": "My Organization",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
Response schema
Field | Type | Description |
---|---|---|
organizations | array | Array of organization objects |
id | string | Unique identifier for the organization |
name | string | Human-readable name for the organization |
createdAt | string (date-time) | Timestamp when the organization was created |
updatedAt | string (date-time) | Timestamp when the organization was last updated |
Get organization
Retrieves detailed information about a specific organization.
GET /organizations/{organizationID}
Summary
Returns comprehensive information about a specific organization by its ID, including all metadata and settings.
Path parameters
Parameter | Type | Required | Description |
---|---|---|---|
organizationID | string | Yes | Unique identifier for the organization |
Response
Status: 200 OK
{
"id": "org_123",
"name": "My Organization",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
Response schema
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the organization |
name | string | Human-readable name for the organization |
createdAt | string (date-time) | Timestamp when the organization was created |
updatedAt | string (date-time) | Timestamp when the organization was last updated |
Update organization
Updates the name of an organization.
PATCH /organizations/{organizationID}
Summary
Updates the organization's name. This is the only field that can be modified for an existing organization.
Path parameters
Parameter | Type | Required | Description |
---|---|---|---|
organizationID | string | Yes | Unique identifier for the organization |
Request body
{
"name": "New Organization Name"
}
Request body parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Yes | New name for the organization |
Response
Status: 200 OK
{
"id": "org_123",
"name": "New Organization Name",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
Response schema
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the organization |
name | string | Updated name for the organization |
createdAt | string (date-time) | Timestamp when the organization was created |
updatedAt | string (date-time) | Timestamp when the organization was last updated |
Delete organization
Permanently deletes an organization and all its associated data. This action cannot be undone.
DELETE /organizations/{organizationID}
Summary
Permanently removes an organization and all associated projects, branches, and data. This is a destructive operation that cannot be reversed.
Path parameters
Parameter | Type | Required | Description |
---|---|---|---|
organizationID | string | Yes | Unique identifier for the organization |
Response
Status: 204 No Content
No response body is returned on successful deletion.
Get available regions
Retrieves a list of all regions where new projects can be deployed within an organization.
GET /organizations/{organizationID}/regions
Summary
Returns a list of available geographic regions where new projects and branches can be deployed, along with information about public access capabilities for each region.
Path parameters
Parameter | Type | Required | Description |
---|---|---|---|
organizationID | string | Yes | Unique identifier for the organization |
Response
Status: 200 OK
{
"regions": [
{
"id": "us-east-1",
"publicAccess": false
},
{
"id": "eu-west-1",
"publicAccess": true
}
]
}
Response schema
Field | Type | Description |
---|---|---|
regions | array | Array of available regions |
id | string | Unique identifier for the region |
publicAccess | boolean | Whether data plane is public-facing to the internet in this region |
Error Handling
The API uses standard HTTP status codes and returns error responses in the following format:
{
"id": "error_identifier",
"message": "Human-readable error message explaining the issue"
}
Common error responses
Status | Error Type | Description |
---|---|---|
400 | GenericError | Request was malformed or contained invalid parameters |
401 | AuthorizationError | Authentication failed or is missing |
404 | GenericError | Requested organization does not exist |
5XX | GenericError | Server error occurred |
Schema Reference
Core Data Models
Organization
Basic organization information.
Field | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the organization |
name | string | Yes | Human-readable name for the organization |
createdAt | string (date-time) | Yes | Timestamp when the organization was created |
updatedAt | string (date-time) | Yes | Timestamp when the organization was last updated |
OrganizationID
Unique identifier for an organization.
Field | Type | Required | Description |
---|---|---|---|
value | string | Yes | The organization ID string |
Region
Information about an available deployment region.
Field | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the region |
publicAccess | boolean | Yes | Whether data plane is public-facing to the internet in this region |
OrganizationUpdateRequest
Request body for updating organization details.
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | New name for the organization |