Projects API

Manage projects and their settings

The Projects API allows you to manage your Xata projects, including listing, creating, updating, and deleting projects. 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 project information and list projects
  • project:write: Create, update, and delete projects

List projects

Retrieves a list of all projects within an organization.

GET /organizations/{organizationID}/projects

Summary

Returns a paginated list of projects in an organization with basic metadata including ID, name, creation date, and update timestamp.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization

Response

Status: 200 OK

{
  "projects": [
    {
      "id": "proj_123",
      "name": "My Project",
      "createdAt": "2024-01-01T00:00:00Z",
      "updatedAt": "2024-01-01T00:00:00Z"
    }
  ]
}

Response schema

FieldTypeDescription
projectsarrayArray of project objects
idstringUnique identifier for the project
namestringHuman-readable name for the project
createdAtstring (date-time)Timestamp when the project was created
updatedAtstring (date-time)Timestamp when the project was last updated

Create project

Creates a new project within an organization.

POST /organizations/{organizationID}/projects

Summary

Creates a new project with the specified name. The project will be created in the organization's default region.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization

Request body

{
  "name": "New Project"
}

Request body parameters

ParameterTypeRequiredDescription
namestringYesHuman-readable name for the new project

Response

Status: 201 Created

{
  "id": "proj_123",
  "name": "New Project",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Response schema

FieldTypeDescription
idstringUnique identifier for the created project
namestringName of the project
createdAtstring (date-time)Timestamp when the project was created
updatedAtstring (date-time)Timestamp when the project was last updated

Get project

Retrieves detailed information about a specific project.

GET /organizations/{organizationID}/projects/{projectID}

Summary

Returns comprehensive information about a project including all metadata and settings.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization
projectIDstringYesUnique identifier for the project

Response

Status: 200 OK

{
  "id": "proj_123",
  "name": "My Project",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Response schema

FieldTypeDescription
idstringUnique identifier for the project
namestringHuman-readable name for the project
createdAtstring (date-time)Timestamp when the project was created
updatedAtstring (date-time)Timestamp when the project was last updated

Update project

Updates the configuration of a project.

PATCH /organizations/{organizationID}/projects/{projectID}

Summary

Updates project metadata such as name. Note that most project configuration changes require creating a new project.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization
projectIDstringYesUnique identifier for the project

Request body

{
  "name": "Updated Project Name"
}

Request body parameters

ParameterTypeRequiredDescription
namestringNoNew name for the project

Response

Status: 200 OK

{
  "id": "proj_123",
  "name": "Updated Project Name",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Response schema

FieldTypeDescription
idstringUnique identifier for the project
namestringUpdated name for the project
createdAtstring (date-time)Timestamp when the project was created
updatedAtstring (date-time)Timestamp when the project was last updated

Delete project

Permanently deletes a project and all its associated data.

DELETE /organizations/{organizationID}/projects/{projectID}

Summary

Permanently removes a project and all associated branches and data. This action cannot be undone and will terminate all active connections.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization
projectIDstringYesUnique identifier for the project

Response

Status: 204 No Content

No response body is returned on successful deletion.

Get available regions

Retrieves a list of all regions where new branches can be deployed within a project.

GET /organizations/{organizationID}/projects/{projectID}/regions

Summary

Returns a list of available geographic regions where new branches can be deployed within the specified project, along with information about public access capabilities for each region.

Path parameters

ParameterTypeRequiredDescription
organizationIDstringYesUnique identifier for the organization
projectIDstringYesUnique identifier for the project

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 or project does not exist
5XXGenericErrorServer error occurred

Schema Reference

Core Data Models

Project

Basic project information.

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

ProjectCreationRequest

Request body for creating a new project.

FieldTypeRequiredDescription
namestringYesHuman-readable name for the new project

ProjectUpdateRequest

Request body for updating project details.

FieldTypeRequiredDescription
namestringNoNew name for the project

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