---
title: "Troca um Firebase ID token por sessão Arara"
method: POST
path: "/auth"
tags: ["auth"]
---

# Troca um Firebase ID token por sessão Arara

`POST /auth`

Recebe um Firebase ID token e retorna o `UserResponseDTO`, um token de
sessão e (eventualmente) uma API key inicial. Endpoint público — não
requer Authorization. IP do cliente é extraído de `X-Forwarded-For` /
`X-Real-IP` quando vindo via CDN.

## Request body

- FirebaseLoginRequest
  - `token` string, required — Firebase ID token.

## Response `200`

Login OK

- AuthResponse
  - `user` UserResponseDTO, required
    - `name` string, required
    - `email` string, email, required
    - `role` string, nullable
  - `token` string, required
  - `userId` string, uuid, nullable
  - `isAuthenticated` boolean, required
  - `apiKey` string, nullable

## Other responses

- `400` — Payload inválido
- `401` — Token ausente ou inválido
- `429` — Rate limit excedido — honre header `Retry-After`

---

[API](https://skmtc.net/ararahq/apis/ararahq-api.md) · [All operations](https://skmtc.net/ararahq/apis/ararahq-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ararahq/ararahq-api/revisions/174c89e36a13/schema)
