Single User API Key

https://api.xata.io/user/keys/key_name

This endpoint allows operations on a single API key for a given user.

Expected Parameters

NameDescriptionInRequiredSchema
key_nameAPI Key namepathstring

Create and Return New API Key

POST
https://api.xata.io/user/keys/key_name

Create and return new API key

Status CodeDescriptionExample Response/Type Definition
201OK
type CreateUserAPIKey = {
    name: string;
    key: string;
    createdAt: DateTime;
};

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

Delete an Existing API Key

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

Delete an existing API key

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