Rename database

https://api.xata.io/workspaces/workspace_id/dbs/db_name/rename

Given a parameter db_name, this path allows you to rename your Xata database. When you rename a database all URLs accessing the database have to be updated.

Expected Parameters

NameDescriptionInRequiredSchema
workspace_idWorkspace IDpathstring
db_nameThe Database Namepathstring

Rename Database

POST
https://api.xata.io/workspaces/workspace_id/dbs/db_name/rename

Change the name of an existing database

Request Body Type Definition

1
2
3
4
5
6
type RenameDatabase = {
    /*
     * @minLength 1
     */
    newName: string;
};
Status CodeDescriptionExample Response/Type Definition
200OK
/**
 * Metadata of databases
 */
type RenameDatabase = {
    /*
     * The machine-readable name of a database
     */
    name: string;
    /*
     * Region where this database is hosted
     */
    region: string;
    /*
     * The time this database was created
     */
    createdAt: DateTime;
    /*
     * 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 RenameDatabase = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
422Example response
type RenameDatabase = {
    id?: string;
    message: string;
};
423Example response
type RenameDatabase = {
    id?: string;
    message: string;
};
5XXUnexpected Error