Pular para o conteúdo principal

Perfil, webhook e senha

Todas as rotas abaixo exigem JWT: Authorization: Bearer {{TOKEN}}.

GET /users/me

Dados do usuário autenticado (sem senha).

curl -s -X GET "{{BASE_URL}}/users/me" \
-H "Authorization: Bearer {{TOKEN}}"

PATCH /users/me

Atualiza perfil: nome, telefone, webhook_url, Telegram (telegram_bot_token, telegram_chat_id), etc.

Body (exemplo)

{
"full_name": "João da Silva",
"phone": "+5511888888888",
"webhook_url": "https://meusite.com/api/paychain-webhook",
"telegram_chat_id": "987654321",
"telegram_bot_token": "123456:ABC..."
}

cURL

curl -s -X PATCH "{{BASE_URL}}/users/me" \
-H "Authorization: Bearer {{TOKEN}}" \
-H "Content-Type: application/json" \
-d '{"full_name":"João da Silva","webhook_url":"https://meusite.com/webhook"}'

POST /users/me/password

curl -s -X POST "{{BASE_URL}}/users/me/password" \
-H "Authorization: Bearer {{TOKEN}}" \
-H "Content-Type: application/json" \
-d '{"current_password":"senha_atual","new_password":"nova_senha"}'