curl -X POST https://api.thalbank.com/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "sua_senha"
}'
const response = await fetch("https://api.thalbank.com/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: "[email protected]",
password: "sua_senha",
}),
});
const data = await response.json();
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Nome do Usuario",
"email": "[email protected]",
"role": "SELLER"
}
}
{
"statusCode": 401,
"message": "Invalid credentials",
"error": "Unauthorized"
}
Authentication
Login
Autentica o usuario e retorna tokens de acesso
POST
/
login
curl -X POST https://api.thalbank.com/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "sua_senha"
}'
const response = await fetch("https://api.thalbank.com/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: "[email protected]",
password: "sua_senha",
}),
});
const data = await response.json();
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Nome do Usuario",
"email": "[email protected]",
"role": "SELLER"
}
}
{
"statusCode": 401,
"message": "Invalid credentials",
"error": "Unauthorized"
}
Descricao
Autentica com email e senha, retornando umaccessToken (JWT, 1h) e um refreshToken (UUID, 7 dias).
Para integracao server-to-server, prefira usar API Keys em vez de JWT.
Request
string
required
Email do usuario cadastrado.
string
required
Senha do usuario.
curl -X POST https://api.thalbank.com/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "sua_senha"
}'
const response = await fetch("https://api.thalbank.com/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: "[email protected]",
password: "sua_senha",
}),
});
const data = await response.json();
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Nome do Usuario",
"email": "[email protected]",
"role": "SELLER"
}
}
{
"statusCode": 401,
"message": "Invalid credentials",
"error": "Unauthorized"
}
Was this page helpful?