# Onboarding

Onboarding checkpoint tracking for email nudge campaigns (internal, requires API key)

## Record an onboarding checkpoint

> Records that a user has reached or completed an onboarding checkpoint.\
> \
> Called by events-notifier after validating a Segment webhook. Not intended to be called directly from the browser.\
> \
> \*\*Checkpoints (1–7):\*\*\
> 1\. Authentication Started\
> 2\. Auth Method Selected\
> 3\. Profile Creation\
> 4\. Avatar Creator Started\
> 5\. Download Page Viewed\
> 6\. Download Clicked\
> 7\. Launcher Ready\
> \
> \*\*Implicit completion:\*\* Recording checkpoint N automatically marks checkpoint N-1 as completed.<br>

```json
{"openapi":"3.1.0","info":{"title":"Auth Server API","version":"1.0.0"},"tags":[{"name":"Onboarding","description":"Onboarding checkpoint tracking for email nudge campaigns (internal, requires API key)"}],"servers":[{"url":"https://auth-api.decentraland.org","description":"Production server"},{"url":"https://auth-api.decentraland.zone","description":"Development server"},{"url":"http://localhost:{port}","description":"Local development server (replace {port} with your local port, typically 3000)","variables":{"port":{"default":"3000","description":"Local development server port"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key passed as Bearer token. Required for onboarding endpoints."}}},"paths":{"/onboarding/checkpoint":{"post":{"tags":["Onboarding"],"summary":"Record an onboarding checkpoint","description":"Records that a user has reached or completed an onboarding checkpoint.\n\nCalled by events-notifier after validating a Segment webhook. Not intended to be called directly from the browser.\n\n**Checkpoints (1–7):**\n1. Authentication Started\n2. Auth Method Selected\n3. Profile Creation\n4. Avatar Creator Started\n5. Download Page Viewed\n6. Download Clicked\n7. Launcher Ready\n\n**Implicit completion:** Recording checkpoint N automatically marks checkpoint N-1 as completed.\n","operationId":"recordCheckpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkpointId":{"type":"integer","minimum":1,"maximum":7,"description":"Onboarding checkpoint identifier (1–7)"},"userIdentifier":{"type":"string","description":"User identifier (email address or wallet address)"},"identifierType":{"type":"string","enum":["email","wallet"],"description":"Type of user identifier"},"action":{"type":"string","enum":["reached","completed"],"description":"Whether the user reached or completed this checkpoint"},"email":{"type":"string","format":"email","description":"User's email address (used for nudge emails)"},"source":{"type":"string","description":"Source of the checkpoint event (e.g. \"auth\", \"website\", \"launcher\")"},"metadata":{"type":"object","additionalProperties":true,"description":"Additional context (e.g. loginMethod)"}},"required":["checkpointId","userIdentifier","identifierType","action"]}}}},"responses":{"200":{"description":"Checkpoint recorded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Invalid payload (missing fields, invalid checkpointId, invalid identifierType)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message describing what went wrong"}},"required":["error"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message describing what went wrong"}},"required":["error"]}}}},"500":{"description":"Internal server error (e.g. database failure)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message describing what went wrong"}},"required":["error"]}}}}}}}}}
```
