---
title: auth
full: true
---

import { Root, API, APIInfo, APIExample, Responses, Response, ResponseTypes, ExampleResponse, TypeScriptResponse, Property, ObjectCollapsible, Requests, Request } from "fumadocs-ui/components/api";

<Root>

<API>

<APIInfo method={"POST"} route={"/auth.createAdmin"}>

## auth-createAdmin

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"email"} type={"string"} required={true} deprecated={undefined}>

<span>Format: `"email"`</span>

</Property>

<Property name={"password"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `8`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.createAdmin" \
  -d '{
  "email": "user@example.com",
  "password": "stringst"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.createAdmin", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.createUser"}>

## auth-createUser

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"password"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `8`</span>

</Property>

<Property name={"id"} type={"string"} required={true} deprecated={undefined}>

</Property>

<Property name={"token"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `1`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.createUser" \
  -d '{
  "password": "stringst",
  "id": "string",
  "token": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.createUser", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.login"}>

## auth-login

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"email"} type={"string"} required={true} deprecated={undefined}>

<span>Format: `"email"`</span>

</Property>

<Property name={"password"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `8`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.login" \
  -d '{
  "email": "user@example.com",
  "password": "stringst"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.login", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"GET"} route={"/auth.get"}>

## auth-get

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X GET "http://localhost:3000/api/auth.get"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.get", {
  method: "GET"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.logout"}>

## auth-logout

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.logout"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.logout", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.update"}>

## auth-update

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"id"} type={"string"} required={false} deprecated={undefined}>

</Property>

<Property name={"email"} type={"string | null"} required={true} deprecated={undefined}>

</Property>

<Property name={"password"} type={"string | null"} required={true} deprecated={undefined}>

</Property>

<Property name={"rol"} type={"string"} required={false} deprecated={undefined}>

<span>Value in: `"admin" | "user"`</span>

</Property>

<Property name={"image"} type={"string"} required={false} deprecated={undefined}>

</Property>

<Property name={"secret"} type={"string | null"} required={false} deprecated={undefined}>

</Property>

<Property name={"token"} type={"string | null"} required={false} deprecated={undefined}>

</Property>

<Property name={"is2FAEnabled"} type={"boolean"} required={false} deprecated={undefined}>

</Property>

<Property name={"createdAt"} type={"string"} required={false} deprecated={undefined}>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.update" \
  -d '{
  "id": "string",
  "email": "string",
  "password": "string",
  "rol": "admin",
  "image": "string",
  "secret": "string",
  "token": "string",
  "is2FAEnabled": true,
  "createdAt": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.update", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.generateToken"}>

## auth-generateToken

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.generateToken"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.generateToken", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"GET"} route={"/auth.one"}>

## auth-one

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Query Parameters

<Property name={"id"} type={"string"} required={true} deprecated={false}>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X GET "http://localhost:3000/api/auth.one?id=string"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.one?id=string", {
  method: "GET"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.updateByAdmin"}>

## auth-updateByAdmin

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"id"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `1`</span>

</Property>

<Property name={"email"} type={"string | null"} required={true} deprecated={undefined}>

</Property>

<Property name={"password"} type={"string | null"} required={true} deprecated={undefined}>

</Property>

<Property name={"rol"} type={"string"} required={false} deprecated={undefined}>

<span>Value in: `"admin" | "user"`</span>

</Property>

<Property name={"image"} type={"string"} required={false} deprecated={undefined}>

</Property>

<Property name={"secret"} type={"string | null"} required={false} deprecated={undefined}>

</Property>

<Property name={"token"} type={"string | null"} required={false} deprecated={undefined}>

</Property>

<Property name={"is2FAEnabled"} type={"boolean"} required={false} deprecated={undefined}>

</Property>

<Property name={"createdAt"} type={"string"} required={false} deprecated={undefined}>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.updateByAdmin" \
  -d '{
  "id": "string",
  "email": "string",
  "password": "string",
  "rol": "admin",
  "image": "string",
  "secret": "string",
  "token": "string",
  "is2FAEnabled": true,
  "createdAt": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.updateByAdmin", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"GET"} route={"/auth.generate2FASecret"}>

## auth-generate2FASecret

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X GET "http://localhost:3000/api/auth.generate2FASecret"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.generate2FASecret", {
  method: "GET"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.verify2FASetup"}>

## auth-verify2FASetup

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"pin"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `6`</span>

</Property>

<Property name={"secret"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `1`</span>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.verify2FASetup" \
  -d '{
  "pin": "string",
  "secret": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.verify2FASetup", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.verifyLogin2FA"}>

## auth-verifyLogin2FA

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

### Request Body

<Property name={"pin"} type={"string"} required={true} deprecated={undefined}>

<span>Minimum length: `6`</span>

</Property>

<Property name={"id"} type={"string"} required={true} deprecated={undefined}>

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.verifyLogin2FA" \
  -d '{
  "pin": "string",
  "id": "string"
}'
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.verifyLogin2FA", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.disable2FA"}>

## auth-disable2FA

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.disable2FA"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.disable2FA", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

<API>

<APIInfo method={"POST"} route={"/auth.verifyToken"}>

## auth-verifyToken

### Authorization

<Property name={"Authorization"} type={"Bearer <token>"} required={true}>

In: `header`

</Property>

| Status code | Description |
| ----------- | ----------- |
| `200` | Successful response |
| `default` | Error response |

</APIInfo>

<APIExample>

<Requests items={["cURL","JavaScript"]}>

<Request value={"cURL"}>

```bash
curl -X POST "http://localhost:3000/api/auth.verifyToken"
```

</Request>

<Request value={"JavaScript"}>

```js
fetch("http://localhost:3000/api/auth.verifyToken", {
  method: "POST"
});
```

</Request>

</Requests>

<Responses items={["default"]}>

<Response value={"default"}>

<ResponseTypes>

<ExampleResponse>

```json
{
  "message": "string",
  "code": "string",
  "issues": [
    {
      "message": "string"
    }
  ]
}
```

</ExampleResponse>

<TypeScriptResponse>

```ts
export interface Response {
  message: string;
  code: string;
  issues?: {
    message: string;
  }[];
}
```

</TypeScriptResponse>

</ResponseTypes>

</Response>

</Responses>

</APIExample>

</API>

</Root>