Body object Required
POST
/auth/token
curl \
-X POST https://api.wan-host.com/auth/token \
-H "Content-Type: application/json" \
-d '{"grant_type":"password","email":"victor@splrge.dev","password":"secret"}'
Request examples
Password
{
"grant_type": "password",
"email": "victor@splrge.dev",
"password": "secret"
}
{
"grant_type": "oauth_code",
"code": "mv4u3mi6o463uhunlp4g96jx"
}
{
"grant_type": "refresh_token",
"token": "whr_NTA.UmVhOHNmRXVFS1JuNklHYVhiU2cwUVMtank3UWQ2cmpGUHcyRWloVDE4MDUxODg5NjI"
}
Response examples (422)
[
{
"message": "The email has already been taken",
"rule": "database.unique",
"field": "email"
},
{
"message": "The passwordConfirmation field and password field must be the same",
"rule": "confirmed",
"field": "passwordConfirmation",
"meta": {
"otherField": "password"
}
}
]
Response examples (200)
{
"accessToken": {
"type": "bearer",
"name": "null",
"token": "whu_NDk.SlU2YXBCWkVfU0hmLThVWXR1WXZGeG0xd25SbkNCUm5VZ3hDWWZGUjQxNjc3NDczNjU",
"abilities": [
"*"
],
"lastUsedAt": "2024-03-06T09:34:59.403Z",
"expiresAt": "2024-03-06T09:34:59.403Z"
},
"refreshToken": {
"type": "bearer",
"name": "null",
"token": "whr_NTA.UmVhOHNmRXVFS1JuNklHYVhiU2cwUVMtank3UWQ2cmpGUHcyRWloVDE4MDUxODg5NjI",
"abilities": [
"*"
],
"lastUsedAt": "2024-03-06T09:34:59.403Z",
"expiresAt": "2024-03-06T09:34:59.403Z"
}
}