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

FieldTypeDescription
organizationsarrayArray of organization objects
idstringUnique identifier for the organization
namestringHuman-readable name for the organization
createdAtstring (date-time)Timestamp when the organization was created
updatedAtstring (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

ParameterTypeRequiredDescription
organizationIDstringYesUnique 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

FieldTypeDescription
idstringUnique identifier for the organization
namestringHuman-readable name for the organization
createdAtstring (date-time)Timestamp when the organization was created
updatedAtstring (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

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization

Request body

{
  "name": "New Organization Name"
}

Request body parameters

ParameterTypeRequiredDescription
namestringYesNew 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

FieldTypeDescription
idstringUnique identifier for the organization
namestringUpdated name for the organization
createdAtstring (date-time)Timestamp when the organization was created
updatedAtstring (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

ParameterTypeRequiredDescription
organizationIDstringYesUnique 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

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization

Response

Status: 200 OK

{
  "regions": [
    {
      "id": "us-east-1",
      "publicAccess": false
    },
    {
      "id": "eu-west-1",
      "publicAccess": true
    }
  ]
}

Response schema

FieldTypeDescription
regionsarrayArray of available regions
idstringUnique identifier for the region
publicAccessbooleanWhether 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

StatusError TypeDescription
400GenericErrorRequest was malformed or contained invalid parameters
401AuthorizationErrorAuthentication failed or is missing
404GenericErrorRequested organization does not exist
5XXGenericErrorServer error occurred

Schema Reference

Core Data Models

Organization

Basic organization information.

FieldTypeRequiredDescription
idstringYesUnique identifier for the organization
namestringYesHuman-readable name for the organization
createdAtstring (date-time)YesTimestamp when the organization was created
updatedAtstring (date-time)YesTimestamp when the organization was last updated

OrganizationID

Unique identifier for an organization.

FieldTypeRequiredDescription
valuestringYesThe organization ID string

Region

Information about an available deployment region.

FieldTypeRequiredDescription
idstringYesUnique identifier for the region
publicAccessbooleanYesWhether data plane is public-facing to the internet in this region

OrganizationUpdateRequest

Request body for updating organization details.

FieldTypeRequiredDescription
namestringYesNew name for the organization