Overview
POST
/auth/loginauthSign in (may require a second factor)
Create a record in login.
Request body
application/json · optional
- emailoptionalstring
Email address
- slugoptionalstring
User id (login handle)
- identifieroptionalstring
Email, user id, or a verified phone number (E.164) — classified server-side
- passwordstring
Example
{
"email": "string",
"slug": "string",
"identifier": "string",
"password": "string"
}Responses
200
token + refreshToken + user
- tokenstring
JWT access token (Bearer credential)
- refreshTokenstring
Opaque refresh token (rotated on use)
- userUser
Example
{
"token": "string",
"refreshToken": "string",
"user": {
"id": "string",
"email": "string",
"name": "string",
"avatarUrl": "string",
"slug": "string",
"publicProfileEnabled": true,
"capabilities": [
"string"
]
}
}202
second factor required
- mfaRequiredtrue
- tokenstring
Short-lived MFA pending token
- methods"sms" | "totp" | "webauthn" | "recovery"[]
Second factors the user can satisfy
Example
{
"mfaRequired": true,
"token": "string",
"methods": [
"sms"
]
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/auth/login" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"slug": "string",
"identifier": "string",
"password": "string"
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/auth/login", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"email\": \"string\",\n \"slug\": \"string\",\n \"identifier\": \"string\",\n \"password\": \"string\"\n}",
});
const data = await res.json();