Workspace by ID

https://api.xata.io/workspaces/workspace_id

This endpoint contains operations for a specific workspace, referenced by ID.

Expected Parameters

NameDescriptionInRequiredSchema
workspace_idWorkspace IDpathstring

Get an Existing Workspace

GET
https://api.xata.io/workspaces/workspace_id

Retrieve workspace info from a workspace ID

Status CodeDescriptionExample Response/Type Definition
200OK
type GetWorkspace = WorkspaceMeta & {
    id: WorkspaceID;
    memberCount: number;
    plan: "free" | "pro";
};

type WorkspaceMeta = {
    name: string;
    slug?: string;
};

/**
 * @pattern ^([a-zA-Z0-9][a-zA-Z0-9_\-~]+-)?[a-zA-Z0-9]{6}
 */
type WorkspaceID = string;
400Bad Request
type GetWorkspace = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
403Authentication Error
{
  "message": "invalid API key"
}
404Example response
type GetWorkspace = {
    id?: string;
    message: string;
};
5XXUnexpected Error

Update an Existing Workspace

PUT
https://api.xata.io/workspaces/workspace_id

Update workspace info

Request Body Type Definition

1
2
3
4
5
6
type UpdateWorkspace = WorkspaceMeta;

type WorkspaceMeta = {
    name: string;
    slug?: string;
};
Status CodeDescriptionExample Response/Type Definition
200OK
type UpdateWorkspace = WorkspaceMeta & {
    id: WorkspaceID;
    memberCount: number;
    plan: "free" | "pro";
};

type WorkspaceMeta = {
    name: string;
    slug?: string;
};

/**
 * @pattern ^([a-zA-Z0-9][a-zA-Z0-9_\-~]+-)?[a-zA-Z0-9]{6}
 */
type WorkspaceID = string;
400Bad Request
type UpdateWorkspace = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
403Authentication Error
{
  "message": "invalid API key"
}
404Example response
type UpdateWorkspace = {
    id?: string;
    message: string;
};
5XXUnexpected Error

Delete an Existing Workspace

DELETE
https://api.xata.io/workspaces/workspace_id

Delete the workspace with the provided ID

Status CodeDescriptionExample Response/Type Definition
204No Content
400Bad Request
type DeleteWorkspace = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
403Authentication Error
{
  "message": "invalid API key"
}
404Example response
type DeleteWorkspace = {
    id?: string;
    message: string;
};
5XXUnexpected Error