Skip to main content

Authentication

The Platzi demo API uses JWT for protected endpoints.

Login

curl -X POST "https://api.escuelajs.co/api/v1/auth/login" \
-H "content-type: application/json" \
-d '{"email":"john@mail.com","password":"changeme"}'

Response includes access_token and refresh_token.

Profile (requires bearer token)

curl "https://api.escuelajs.co/api/v1/auth/profile" \
-H "authorization: Bearer <access_token>"

Refresh token

curl -X POST "https://api.escuelajs.co/api/v1/auth/refresh-token" \
-H "content-type: application/json" \
-d '{"refreshToken":"<refresh_token>"}'

Use the API playground to run these flows interactively.