TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Logs in and sets the apibee_session cookie

POSThttps://api.testingapis.com/api/cookies/loginSign in to see this endpoint's URL

Logs in and sets the apibee_session cookie.

Test accounts: test / test123 (role user) and admin / admin123 (role admin). The cookie is HttpOnly, SameSite=Lax, Path=/, valid for one hour, and Secure only over HTTPS.

Request body

Optional. application/json, text/json, application/*+json, application/xml, text/xml, application/*+xml. Model: CookiesControllerLoginBody. Username and password.

Example body
{"username": "test", "password": "test123"}

Responses

200
Logged in; the session cookie is set.
400
Missing or malformed body.
401
Wrong username or password.

Example

Request
curl -X POST "https://api.testingapis.com/api/cookies/login" \
  -H "Content-Type: application/json" \
  -d '{"username": "test", "password": "test123"}' \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Set-Cookie: apibee_session=f997b2a740419847f105b6b322e857dd; max-age=3600; path=/; samesite=lax; httponly

{
  "message": "Logged in. The session cookie is sent automatically on later requests.",
  "username": "test",
  "cookie": "apibee_session",
  "expiresAt": "2026-09-30T19:26:44Z"
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.