Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Timbrix Auth API
description: 'API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2 para gestionar organizaciones, miembros y webhooks. Compatible con agentes de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.
REST API with OAuth2 server for managing organizations, members, and webhooks.'
version: '1.0'
contact: {}
servers: []
tags:
- name: Auth
paths:
/auth/login:
post:
description: Autentica a un usuario contra Supabase Auth y devuelve un access token (JWT) y un refresh token. El access token se usa como Bearer token en el resto de endpoints autenticados por sesión de usuario.
operationId: AuthController_login
parameters: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginDto'
responses:
'200':
description: Autenticación exitosa
content:
application/json:
schema:
$ref: '#/components/schemas/LoginResponseDto'
'401':
description: Credenciales inválidas (email o contraseña incorrectos)
summary: Iniciar sesión con email y contraseña
tags:
- Auth
/auth/logout:
post:
description: 'Revoca el access token actual en Supabase Auth. Idempotente: si no se envía un header Authorization, responde éxito sin efecto.'
operationId: AuthController_logout
parameters:
- name: authorization
required: true
in: header
schema:
type: string
responses:
'204':
description: Sesión cerrada (o no había sesión activa)
security:
- bearer: []
summary: Cerrar sesión
tags:
- Auth
components:
schemas:
LoginDto:
type: object
properties:
email:
type: string
description: Correo electrónico del usuario
example: ana@empresa.mx
password:
type: string
description: Contraseña del usuario (mínimo 6 caracteres)
example: contraseña-segura
minLength: 6
required:
- email
- password
LoginUserDto:
type: object
properties:
id:
type: string
example: c2e6b1a4-9f2d-4b3a-8e6a-1f2b3c4d5e6f
description: ID del usuario en Supabase Auth
email:
type: string
example: ana@empresa.mx
description: Correo electrónico del usuario
required:
- id
- email
LoginResponseDto:
type: object
properties:
access_token:
type: string
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
description: Access token JWT — se envía como Bearer token en requests posteriores
refresh_token:
type: string
example: v1.MjM0NTY3ODkwMTIzNDU2Nzg5MA...
description: Refresh token para renovar el access token sin volver a autenticar
user:
$ref: '#/components/schemas/LoginUserDto'
required:
- access_token
- user
securitySchemes:
bearer:
scheme: bearer
bearerFormat: JWT
type: http
apiKey:
type: apiKey
in: header
name: X-API-Key
description: API Key for authentication (sk_test_... for sandbox, sk_live_... for production)
x-ai-agent-friendly: true