Skip to main content
POST
/
auth
/
tokens
Create Token (Login)
curl --request POST \
  --url https://api.petstoreapi.com/v1/auth/tokens \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "kylekinh",
  "password": "SecurePass123!"
}
'
{
  "token": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Body

application/json
username
string
required

Login username

Example:

"johndoe"

password
string
required

User password (never returned in responses)

Example:

"securePassword123"

Response

Login successful

token
string

Authentication token

expiresAt
string<date-time>

Token expiration time