User info

https://api.xata.io/user

This endpoint allows retrieving or updating a given user by their user ID.

Get User Details

GET
https://api.xata.io/user

Return details of the user making the request

Status CodeDescriptionExample Response/Type Definition
200OK
type GetUser = User & {
    id: UserID;
};

type User = {
    /*
     * @format email
     */
    email: string;
    fullname: string;
    image: string;
};

/**
 * @pattern [a-zA-Z0-9_-~:]+
 */
type UserID = string;
400Bad Request
type GetUser = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type GetUser = {
    id?: string;
    message: string;
};
5XXUnexpected Error

Update User Info

PUT
https://api.xata.io/user

Update user info

Request Body Type Definition

1
2
3
4
5
6
7
8
9
10
type UpdateUser = User;

type User = {
    /*
     * @format email
     */
    email: string;
    fullname: string;
    image: string;
};
Status CodeDescriptionExample Response/Type Definition
200OK
type UpdateUser = User & {
    id: UserID;
};

type User = {
    /*
     * @format email
     */
    email: string;
    fullname: string;
    image: string;
};

/**
 * @pattern [a-zA-Z0-9_-~:]+
 */
type UserID = string;
400Bad Request
type UpdateUser = {
    id?: string;
    message: string;
};
401Authentication Error
{
  "message": "invalid API key"
}
404Example response
type UpdateUser = {
    id?: string;
    message: string;
};
5XXUnexpected Error

Delete User

DELETE
https://api.xata.io/user

Delete the user making the request

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