Check server health.
- Response:
200 OK(Text: "OK")
Get all chirps.
- Query Parameters:
sort:ascordesc(optional, defaults toasc)author_id: UUID of a specific user (optional)
- Response:
200 OK(JSON list of chirps)
Get a single chirp by ID.
- Response:
200 OK(JSON chirp object) or404 Not Found
Create a new user account.
- Body:
{ "email": "user@example.com", "password": "securepassword" } - Response:
201 Created(JSON user object withid,email,is_chirpy_red)
Login to get access and refresh tokens.
- Body:
{ "email": "user@example.com", "password": "securepassword" } - Response:
200 OK(JSON user object includingtokenandrefresh_token)
Note: Authenticated endpoints require the header Authorization: Bearer <access_token> unless specified otherwise.
Create a new chirp.
- Body:
{ "body": "This is my chirp!", "user_id": "uuid-here" // Must match the authenticated user } - Response:
201 Created(JSON chirp object)
Delete your own chirp.
- Response:
204 No Content
Update your email and password.
- Body:
{ "email": "new@example.com", "password": "newpassword" } - Response:
200 OK(Updated JSON user object)
Refresh your access token.
- Header:
Authorization: Bearer <refresh_token> - Response:
200 OK(JSON object with newtoken)
Revoke your refresh token.
- Header:
Authorization: Bearer <refresh_token> - Response:
204 No Content
Upgrade users to Chirpy Red status.
- Header:
X-API-Key: <POLKA_KEY> - Body:
{ "event": "user.upgraded", "data": { "user_id": "uuid-of-user-to-upgrade" } } - Response:
204 No Content