Databases

https://{your-workspace-slug}.xata.sh/dbs/

This path contains operations that can be performed on databases within Xata.

List Databases

GET  https://{your-workspace-slug}.xata.sh/dbs/

List all databases available in your Workspace.

Possible Responses
Status CodeDescriptionExample Response/Type Definition
200OK
type GetDatabaseList = {
    /*
     * A list of databases in a Xata workspace
     */
    databases?: DatabaseMetadata[];
};

/**
 * Metadata of databases
 */
type DatabaseMetadata = {
    /*
     * The machine-readable name of a database
     */
    name: string;
    /*
     * The human-readable name of a database
     */
    displayName: string;
    /*
     * The time this database was created
     */
    createdAt: DateTime;
    /*
     * The number of branches the database has
     */
    numberOfBranches: number;
    /*
     * Metadata about the database for display in Xata user interfaces
     */
    ui?: {
        /*
         * The user-selected color for this database across interfaces
         */
        color?: string;
    };
};

/**
 * @format date-time
 */
type DateTime = string;
400Bad Request
type GetDatabaseList = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
5XXUnexpected Error