chore: update document API
This commit is contained in:
parent
96b7d7fee4
commit
49f18ca694
@ -708,22 +708,17 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- email
|
- email
|
||||||
- password
|
|
||||||
- full_name
|
- full_name
|
||||||
- role
|
- role
|
||||||
properties:
|
properties:
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
format: email
|
format: email
|
||||||
description: Email do usuário (deve ser único)
|
description: >-
|
||||||
|
Email do usuário (deve ser único). Um magic link será enviado para
|
||||||
|
este email.
|
||||||
examples:
|
examples:
|
||||||
- usuario@mediconnect.com
|
- usuario@mediconnect.com
|
||||||
password:
|
|
||||||
type: string
|
|
||||||
minLength: 6
|
|
||||||
description: Senha temporária para o usuário
|
|
||||||
examples:
|
|
||||||
- senha123!
|
|
||||||
full_name:
|
full_name:
|
||||||
type: string
|
type: string
|
||||||
minLength: 1
|
minLength: 1
|
||||||
@ -744,15 +739,42 @@ components:
|
|||||||
- medico
|
- medico
|
||||||
- secretaria
|
- secretaria
|
||||||
- user
|
- user
|
||||||
|
- paciente
|
||||||
description: Papel do usuário no sistema
|
description: Papel do usuário no sistema
|
||||||
examples:
|
examples:
|
||||||
- medico
|
- medico
|
||||||
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- admin
|
||||||
|
- gestor
|
||||||
|
- medico
|
||||||
|
- secretaria
|
||||||
|
- user
|
||||||
|
- paciente
|
||||||
|
description: Múltiplos papéis do usuário (opcional, alternativa ao campo 'role')
|
||||||
|
examples:
|
||||||
|
- - medico
|
||||||
|
- gestor
|
||||||
|
redirect_url:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
description: >-
|
||||||
|
URL de redirecionamento após clicar no Magic Link (opcional).
|
||||||
|
Permite que aplicativos externos redirecionem para suas próprias
|
||||||
|
URLs.
|
||||||
|
examples:
|
||||||
|
- https://app.exemplo.com/dashboard
|
||||||
|
nullable: true
|
||||||
x-apidog-orders:
|
x-apidog-orders:
|
||||||
- email
|
- email
|
||||||
- password
|
|
||||||
- full_name
|
- full_name
|
||||||
- phone
|
- phone
|
||||||
- role
|
- role
|
||||||
|
- roles
|
||||||
|
- redirect_url
|
||||||
x-apidog-ignore-properties: []
|
x-apidog-ignore-properties: []
|
||||||
x-apidog-folder: ''
|
x-apidog-folder: ''
|
||||||
CreateUserResponse:
|
CreateUserResponse:
|
||||||
@ -763,6 +785,13 @@ components:
|
|||||||
description: Indica se a operação foi bem-sucedida
|
description: Indica se a operação foi bem-sucedida
|
||||||
examples:
|
examples:
|
||||||
- true
|
- true
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
description: Mensagem de confirmação incluindo informação sobre o magic link
|
||||||
|
examples:
|
||||||
|
- >-
|
||||||
|
Usuário criado com sucesso. Magic link enviado para
|
||||||
|
usuario@mediconnect.com
|
||||||
user:
|
user:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@ -789,20 +818,23 @@ components:
|
|||||||
examples:
|
examples:
|
||||||
- (11) 99999-9999
|
- (11) 99999-9999
|
||||||
nullable: true
|
nullable: true
|
||||||
role:
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
type: string
|
type: string
|
||||||
description: Papel atribuído ao usuário
|
description: Papéis atribuídos ao usuário
|
||||||
examples:
|
examples:
|
||||||
- medico
|
- - medico
|
||||||
x-apidog-orders:
|
x-apidog-orders:
|
||||||
- id
|
- id
|
||||||
- email
|
- email
|
||||||
- full_name
|
- full_name
|
||||||
- phone
|
- phone
|
||||||
- role
|
- roles
|
||||||
x-apidog-ignore-properties: []
|
x-apidog-ignore-properties: []
|
||||||
x-apidog-orders:
|
x-apidog-orders:
|
||||||
- success
|
- success
|
||||||
|
- message
|
||||||
- user
|
- user
|
||||||
x-apidog-ignore-properties: []
|
x-apidog-ignore-properties: []
|
||||||
x-apidog-folder: ''
|
x-apidog-folder: ''
|
||||||
@ -812,19 +844,331 @@ components:
|
|||||||
scheme: bearer
|
scheme: bearer
|
||||||
bearerFormat: JWT
|
bearerFormat: JWT
|
||||||
description: Token JWT obtido no login
|
description: Token JWT obtido no login
|
||||||
bearer:
|
|
||||||
type: http
|
|
||||||
scheme: bearer
|
|
||||||
servers:
|
servers:
|
||||||
- url: https://yuanqfswhberkoevtmfr.supabase.co
|
- url: https://yuanqfswhberkoevtmfr.supabase.co
|
||||||
description: Prod Env
|
description: Prod Env
|
||||||
- url: ''
|
- url: ''
|
||||||
description: Cloud Mock
|
description: Cloud Mock
|
||||||
security:
|
security: []
|
||||||
- bearer: []
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Criar novo usuário
|
||||||
|
|
||||||
|
## OpenAPI Specification
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
openapi: 3.0.1
|
||||||
|
info:
|
||||||
|
title: ''
|
||||||
|
description: ''
|
||||||
|
version: 1.0.0
|
||||||
|
paths:
|
||||||
|
/create-user:
|
||||||
|
post:
|
||||||
|
summary: Criar novo usuário
|
||||||
|
deprecated: false
|
||||||
|
description: >
|
||||||
|
Cria um novo usuário no sistema com papel específico.
|
||||||
|
|
||||||
|
Apenas usuários com papel de admin, gestor ou secretaria podem criar
|
||||||
|
novos usuários.
|
||||||
|
|
||||||
|
Um magic link será enviado automaticamente para o email do novo usuário.
|
||||||
|
|
||||||
|
O parâmetro redirect_url permite que aplicativos externos redirecionem
|
||||||
|
para suas próprias URLs.
|
||||||
|
operationId: createUser
|
||||||
|
tags:
|
||||||
|
- Usuários
|
||||||
|
- Usuários
|
||||||
|
parameters: []
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CreateUserRequest'
|
||||||
|
examples:
|
||||||
|
admin_user:
|
||||||
|
value:
|
||||||
|
email: admin@mediconnect.com
|
||||||
|
full_name: João Silva
|
||||||
|
phone: (11) 99999-9999
|
||||||
|
role: admin
|
||||||
|
summary: Criar administrador
|
||||||
|
doctor_user:
|
||||||
|
value:
|
||||||
|
email: dr.maria@mediconnect.com
|
||||||
|
full_name: Dra. Maria Santos
|
||||||
|
phone: (11) 98888-8888
|
||||||
|
role: medico
|
||||||
|
summary: Criar médico
|
||||||
|
secretary_user:
|
||||||
|
value:
|
||||||
|
email: secretaria@mediconnect.com
|
||||||
|
full_name: Ana Costa
|
||||||
|
phone: (11) 97777-7777
|
||||||
|
role: secretaria
|
||||||
|
summary: Criar secretária
|
||||||
|
patient_user:
|
||||||
|
value:
|
||||||
|
email: paciente@email.com
|
||||||
|
full_name: João Paciente
|
||||||
|
phone: (11) 98888-8888
|
||||||
|
role: paciente
|
||||||
|
summary: Criar paciente
|
||||||
|
external_app:
|
||||||
|
value:
|
||||||
|
email: usuario@externo.com
|
||||||
|
full_name: Usuário Externo
|
||||||
|
phone: (11) 99999-9999
|
||||||
|
role: paciente
|
||||||
|
redirect_url: https://app-parceiro.com/auth/callback
|
||||||
|
summary: Criação via app externo com redirect personalizado
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Usuário criado com sucesso
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/CreateUserResponse'
|
||||||
|
example:
|
||||||
|
success: true
|
||||||
|
user:
|
||||||
|
id: 123e4567-e89b-12d3-a456-426614174000
|
||||||
|
email: novo.usuario@mediconnect.com
|
||||||
|
full_name: Novo Usuário
|
||||||
|
phone: (11) 99999-9999
|
||||||
|
roles:
|
||||||
|
- medico
|
||||||
|
message: >-
|
||||||
|
Usuário criado com sucesso. Magic link enviado para
|
||||||
|
novo.usuario@mediconnect.com
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: OK
|
||||||
|
'400':
|
||||||
|
description: Dados inválidos ou erro de validação
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: &ref_0
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
examples:
|
||||||
|
'2':
|
||||||
|
summary: Campos obrigatórios faltando
|
||||||
|
value:
|
||||||
|
error: 'Missing required fields: email, full_name, role'
|
||||||
|
'3':
|
||||||
|
summary: Papel inválido
|
||||||
|
value:
|
||||||
|
error: >-
|
||||||
|
Invalid role: must be one of admin, gestor, medico,
|
||||||
|
secretaria, user, paciente
|
||||||
|
'4':
|
||||||
|
summary: URL de redirect inválida
|
||||||
|
value:
|
||||||
|
error: redirect_url inválido
|
||||||
|
'5':
|
||||||
|
summary: Email já existe
|
||||||
|
value:
|
||||||
|
error: User with this email already registered
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Bad Request
|
||||||
|
'401':
|
||||||
|
description: Token de autenticação inválido ou ausente
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: *ref_0
|
||||||
|
example:
|
||||||
|
error: Unauthorized
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Unauthorized
|
||||||
|
'403':
|
||||||
|
description: Permissões insuficientes
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: *ref_0
|
||||||
|
example:
|
||||||
|
error: Insufficient permissions
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Forbidden
|
||||||
|
'500':
|
||||||
|
description: Erro interno do servidor
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: *ref_0
|
||||||
|
example:
|
||||||
|
error: Internal server error
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Internal Server Error
|
||||||
|
security: []
|
||||||
|
x-apidog-folder: Usuários
|
||||||
|
x-apidog-status: released
|
||||||
|
x-run-in-apidog: https://app.apidog.com/web/project/1053378/apis/api-22659572-run
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
CreateUserRequest:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- full_name
|
||||||
|
- role
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
description: >-
|
||||||
|
Email do usuário (deve ser único). Um magic link será enviado para
|
||||||
|
este email.
|
||||||
|
examples:
|
||||||
|
- usuario@mediconnect.com
|
||||||
|
full_name:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
|
description: Nome completo do usuário
|
||||||
|
examples:
|
||||||
|
- João da Silva
|
||||||
|
phone:
|
||||||
|
type: string
|
||||||
|
description: Telefone do usuário (opcional)
|
||||||
|
examples:
|
||||||
|
- (11) 99999-9999
|
||||||
|
nullable: true
|
||||||
|
role:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- admin
|
||||||
|
- gestor
|
||||||
|
- medico
|
||||||
|
- secretaria
|
||||||
|
- user
|
||||||
|
- paciente
|
||||||
|
description: Papel do usuário no sistema
|
||||||
|
examples:
|
||||||
|
- medico
|
||||||
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- admin
|
||||||
|
- gestor
|
||||||
|
- medico
|
||||||
|
- secretaria
|
||||||
|
- user
|
||||||
|
- paciente
|
||||||
|
description: Múltiplos papéis do usuário (opcional, alternativa ao campo 'role')
|
||||||
|
examples:
|
||||||
|
- - medico
|
||||||
|
- gestor
|
||||||
|
redirect_url:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
description: >-
|
||||||
|
URL de redirecionamento após clicar no Magic Link (opcional).
|
||||||
|
Permite que aplicativos externos redirecionem para suas próprias
|
||||||
|
URLs.
|
||||||
|
examples:
|
||||||
|
- https://app.exemplo.com/dashboard
|
||||||
|
nullable: true
|
||||||
|
x-apidog-orders:
|
||||||
|
- email
|
||||||
|
- full_name
|
||||||
|
- phone
|
||||||
|
- role
|
||||||
|
- roles
|
||||||
|
- redirect_url
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
CreateUserResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
success:
|
||||||
|
type: boolean
|
||||||
|
description: Indica se a operação foi bem-sucedida
|
||||||
|
examples:
|
||||||
|
- true
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
description: Mensagem de confirmação incluindo informação sobre o magic link
|
||||||
|
examples:
|
||||||
|
- >-
|
||||||
|
Usuário criado com sucesso. Magic link enviado para
|
||||||
|
usuario@mediconnect.com
|
||||||
|
user:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
description: ID único do usuário criado
|
||||||
|
examples:
|
||||||
|
- 123e4567-e89b-12d3-a456-426614174000
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
description: Email do usuário
|
||||||
|
examples:
|
||||||
|
- usuario@mediconnect.com
|
||||||
|
full_name:
|
||||||
|
type: string
|
||||||
|
description: Nome completo do usuário
|
||||||
|
examples:
|
||||||
|
- João da Silva
|
||||||
|
phone:
|
||||||
|
type: string
|
||||||
|
description: Telefone do usuário
|
||||||
|
examples:
|
||||||
|
- (11) 99999-9999
|
||||||
|
nullable: true
|
||||||
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: Papéis atribuídos ao usuário
|
||||||
|
examples:
|
||||||
|
- - medico
|
||||||
|
x-apidog-orders:
|
||||||
|
- id
|
||||||
|
- email
|
||||||
|
- full_name
|
||||||
|
- phone
|
||||||
|
- roles
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-orders:
|
||||||
|
- success
|
||||||
|
- message
|
||||||
|
- user
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
ErrorResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
description: Mensagem de erro descritiva
|
||||||
|
examples:
|
||||||
|
- 'Missing required fields: email, full_name, role'
|
||||||
|
x-apidog-orders:
|
||||||
|
- error
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
securitySchemes:
|
||||||
|
bearerAuth:
|
||||||
|
type: jwt
|
||||||
|
scheme: bearer
|
||||||
|
bearerFormat: JWT
|
||||||
|
description: Token JWT obtido no login
|
||||||
|
servers:
|
||||||
|
- url: https://yuanqfswhberkoevtmfr.supabase.co
|
||||||
|
description: Prod Env
|
||||||
|
- url: ''
|
||||||
|
description: Cloud Mock
|
||||||
|
security: []
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Obter dados do usuário atual
|
# Obter dados do usuário atual
|
||||||
|
|
||||||
## OpenAPI Specification
|
## OpenAPI Specification
|
||||||
@ -2563,3 +2907,292 @@ security:
|
|||||||
- bearer: []
|
- bearer: []
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Login do usuário
|
||||||
|
|
||||||
|
## OpenAPI Specification
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
openapi: 3.0.1
|
||||||
|
info:
|
||||||
|
title: ''
|
||||||
|
description: ''
|
||||||
|
version: 1.0.0
|
||||||
|
paths:
|
||||||
|
/auth/v1/signin:
|
||||||
|
post:
|
||||||
|
summary: Login do usuário
|
||||||
|
deprecated: false
|
||||||
|
description: Autentica o usuário e retorna token JWT
|
||||||
|
operationId: loginUser
|
||||||
|
tags:
|
||||||
|
- Autenticação
|
||||||
|
- Autenticação
|
||||||
|
parameters: []
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/LoginRequest'
|
||||||
|
example:
|
||||||
|
email: hugo@popcode.com.br
|
||||||
|
password: hdoria
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Login realizado com sucesso
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/LoginResponse'
|
||||||
|
example:
|
||||||
|
access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||||
|
token_type: bearer
|
||||||
|
expires_in: 3600
|
||||||
|
refresh_token: refreshtoken123
|
||||||
|
user:
|
||||||
|
id: 724bbb13-2d70-42e7-b05a-8ed6cc499800
|
||||||
|
email: hugo@popcode.com.br
|
||||||
|
email_confirmed_at: '2025-09-26T08:43:05.005937Z'
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: OK
|
||||||
|
'400':
|
||||||
|
description: Credenciais inválidas
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: &ref_0
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
example:
|
||||||
|
error: Invalid login credentials
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Bad Request
|
||||||
|
'422':
|
||||||
|
description: Dados inválidos
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: *ref_0
|
||||||
|
example:
|
||||||
|
error: Invalid email or password format
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Unprocessable Entity
|
||||||
|
security: []
|
||||||
|
x-apidog-folder: Autenticação
|
||||||
|
x-apidog-status: released
|
||||||
|
x-run-in-apidog: https://app.apidog.com/web/project/1053378/apis/api-22659547-run
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
LoginRequest:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
description: Email do usuário
|
||||||
|
examples:
|
||||||
|
- hugo@popcode.com.br
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
description: Senha do usuário
|
||||||
|
examples:
|
||||||
|
- hdoria
|
||||||
|
x-apidog-orders:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
LoginResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
access_token:
|
||||||
|
type: string
|
||||||
|
description: Token JWT de acesso
|
||||||
|
examples:
|
||||||
|
- eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||||
|
token_type:
|
||||||
|
type: string
|
||||||
|
description: Tipo do token
|
||||||
|
examples:
|
||||||
|
- bearer
|
||||||
|
expires_in:
|
||||||
|
type: integer
|
||||||
|
description: Tempo de expiração em segundos
|
||||||
|
examples:
|
||||||
|
- 3600
|
||||||
|
refresh_token:
|
||||||
|
type: string
|
||||||
|
description: Token para renovação
|
||||||
|
examples:
|
||||||
|
- refreshtoken123
|
||||||
|
user:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
description: ID do usuário
|
||||||
|
examples:
|
||||||
|
- 724bbb13-2d70-42e7-b05a-8ed6cc499800
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
description: Email do usuário
|
||||||
|
examples:
|
||||||
|
- hugo@popcode.com.br
|
||||||
|
email_confirmed_at:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
description: Data de confirmação do email
|
||||||
|
examples:
|
||||||
|
- '2025-09-26T08:43:05.005937Z'
|
||||||
|
x-apidog-orders:
|
||||||
|
- id
|
||||||
|
- email
|
||||||
|
- email_confirmed_at
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-orders:
|
||||||
|
- access_token
|
||||||
|
- token_type
|
||||||
|
- expires_in
|
||||||
|
- refresh_token
|
||||||
|
- user
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
ErrorResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
description: Mensagem de erro descritiva
|
||||||
|
examples:
|
||||||
|
- 'Missing required fields: email, full_name, role'
|
||||||
|
x-apidog-orders:
|
||||||
|
- error
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
securitySchemes:
|
||||||
|
bearerAuth:
|
||||||
|
type: jwt
|
||||||
|
scheme: bearer
|
||||||
|
bearerFormat: JWT
|
||||||
|
description: Token JWT obtido no login
|
||||||
|
servers:
|
||||||
|
- url: https://yuanqfswhberkoevtmfr.supabase.co
|
||||||
|
description: Prod Env
|
||||||
|
- url: ''
|
||||||
|
description: Cloud Mock
|
||||||
|
security: []
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Enviar Magic Link
|
||||||
|
|
||||||
|
## OpenAPI Specification
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
openapi: 3.0.1
|
||||||
|
info:
|
||||||
|
title: ''
|
||||||
|
description: ''
|
||||||
|
version: 1.0.0
|
||||||
|
paths:
|
||||||
|
/auth/v1/otp:
|
||||||
|
post:
|
||||||
|
summary: Enviar Magic Link
|
||||||
|
deprecated: false
|
||||||
|
description: Envia um link de autenticação sem senha por email
|
||||||
|
operationId: sendMagicLink
|
||||||
|
tags:
|
||||||
|
- Autenticação
|
||||||
|
- Autenticação
|
||||||
|
parameters: []
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/MagicLinkRequest'
|
||||||
|
example:
|
||||||
|
email: usuario@clinica.com
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Magic link enviado com sucesso
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
x-apidog-orders: []
|
||||||
|
properties: {}
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
example:
|
||||||
|
message: Magic link sent successfully
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: OK
|
||||||
|
'400':
|
||||||
|
description: Email inválido
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: &ref_0
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
example:
|
||||||
|
error: Invalid email format
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Bad Request
|
||||||
|
'429':
|
||||||
|
description: Muitas tentativas
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: *ref_0
|
||||||
|
example:
|
||||||
|
error: Email rate limit exceeded
|
||||||
|
headers: {}
|
||||||
|
x-apidog-name: Too Many Requests
|
||||||
|
security: []
|
||||||
|
x-apidog-folder: Autenticação
|
||||||
|
x-apidog-status: released
|
||||||
|
x-run-in-apidog: https://app.apidog.com/web/project/1053378/apis/api-22659548-run
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
MagicLinkRequest:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
description: Email do usuário para receber o magic link
|
||||||
|
examples:
|
||||||
|
- usuario@clinica.com
|
||||||
|
x-apidog-orders:
|
||||||
|
- email
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
ErrorResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
description: Mensagem de erro descritiva
|
||||||
|
examples:
|
||||||
|
- 'Missing required fields: email, full_name, role'
|
||||||
|
x-apidog-orders:
|
||||||
|
- error
|
||||||
|
x-apidog-ignore-properties: []
|
||||||
|
x-apidog-folder: ''
|
||||||
|
securitySchemes:
|
||||||
|
bearerAuth:
|
||||||
|
type: jwt
|
||||||
|
scheme: bearer
|
||||||
|
bearerFormat: JWT
|
||||||
|
description: Token JWT obtido no login
|
||||||
|
servers:
|
||||||
|
- url: https://yuanqfswhberkoevtmfr.supabase.co
|
||||||
|
description: Prod Env
|
||||||
|
- url: ''
|
||||||
|
description: Cloud Mock
|
||||||
|
security: []
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user