diff --git a/docs/API.md b/docs/API.md index 4c23a2a..8551e71 100644 --- a/docs/API.md +++ b/docs/API.md @@ -8,23 +8,90 @@ Base URL: `http://localhost:8000` `GET /health` — Returns service status and dependency health. +```bash +curl http://localhost:8000/health +``` + +Example response: + +```json +{"status": "ok", "version": "0.1.0"} +``` + ### Authentication `POST /auth/register` — Create a new account. + +```bash +curl -X POST http://localhost:8000/auth/register \ + -H "Content-Type: application/json" \ + -d '{"email": "dev@example.com", "password": "s3cret"}' +``` + `POST /auth/login` — Obtain a JWT access token. +```bash +curl -X POST http://localhost:8000/auth/login \ + -H "Content-Type: application/json" \ + -d '{"email": "dev@example.com", "password": "s3cret"}' +``` + +Example response (store the token for authenticated calls): + +```json +{"access_token": "", "token_type": "bearer"} +``` + ### Profiles `POST /profiles` — Create a profile with resume and GitHub username. + +```bash +curl -X POST http://localhost:8000/profiles \ + -H "Authorization: Bearer " \ + -H "Content-Type: application/json" \ + -d '{"resume": "Experienced Python developer...", "github_username": "octocat"}' +``` + `GET /profiles/{profile_id}` — Retrieve a profile. + +```bash +curl http://localhost:8000/profiles/1 \ + -H "Authorization: Bearer " +``` + `DELETE /profiles/{profile_id}` — Delete a profile and associated data. +```bash +curl -X DELETE http://localhost:8000/profiles/1 \ + -H "Authorization: Bearer " +``` + ### Reviews `POST /reviews` — Request a new portfolio review for a profile. + +```bash +curl -X POST http://localhost:8000/reviews \ + -H "Authorization: Bearer " \ + -H "Content-Type: application/json" \ + -d '{"profile_id": 1}' +``` + `GET /reviews/{review_id}` — Retrieve a completed review. + +```bash +curl http://localhost:8000/reviews/1 \ + -H "Authorization: Bearer " +``` + `GET /reviews` — List reviews for the authenticated user (paginated). +```bash +curl "http://localhost:8000/reviews?page=1&page_size=10" \ + -H "Authorization: Bearer " +``` + ## Interactive Docs When the API is running, visit: