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 namepathstring

Get an Existing Workspace

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

Retrieve workspace info from a workspace ID

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

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"
}
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
type UpdateWorkspace = WorkspaceMeta;

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

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"
}
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

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