> For the complete documentation index, see [llms.txt](https://developers.trooply.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.trooply.co.uk/users.md).

# Users

## Record email verification

> Called immediately after OTP verification succeeds. Fires an email\_verified analytics event and touches last\_seen. Best-effort — callers should proceed even if this returns an error.

```json
{"openapi":"3.1.1","info":{"title":"Trooply API","version":"1.0"},"servers":[{"url":"https://api.trooply.co.uk/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"description":"Bearer access token. Generate one from the **Developer** area of your Trooply account and send it as `Authorization: Bearer <token>`.","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"data":{},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"ResponseMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"request_id":{"type":"string","format":"uuid"},"total":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","properties":{"code":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"},"status":{"type":"integer"}}}}},"paths":{"/v1/auth/verify":{"post":{"description":"Called immediately after OTP verification succeeds. Fires an email_verified analytics event and touches last_seen. Best-effort — callers should proceed even if this returns an error.","tags":["users"],"summary":"Record email verification","responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"boolean"}}}}]}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get the current user

> Returns the authenticated user's profile and their group memberships. For a brand-new user who has not yet completed onboarding, \`data.profile\` is \`null\` and \`data.memberships\` is empty — the client should route them into onboarding.

```json
{"openapi":"3.1.1","info":{"title":"Trooply API","version":"1.0"},"servers":[{"url":"https://api.trooply.co.uk/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"description":"Bearer access token. Generate one from the **Developer** area of your Trooply account and send it as `Authorization: Bearer <token>`.","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"data":{},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"ResponseMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"request_id":{"type":"string","format":"uuid"},"total":{"type":"integer"}}},"Me":{"type":"object","properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/UsersMembership"}},"profile":{"$ref":"#/components/schemas/Profile"}}},"UsersMembership":{"type":"object","properties":{"group_id":{"type":"string","format":"uuid"},"role":{"type":"string"},"section_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"user_id":{"type":"string","format":"uuid"}}},"Profile":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"first_name":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_name":{"type":"string"},"onboarding_completed_at":{"type":"string","format":"date-time"},"onboarding_step":{"type":"string"},"scouting_role":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","properties":{"code":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"},"status":{"type":"integer"}}}}},"paths":{"/v1/me":{"get":{"description":"Returns the authenticated user's profile and their group memberships. For a brand-new user who has not yet completed onboarding, `data.profile` is `null` and `data.memberships` is empty — the client should route them into onboarding.","tags":["users"],"summary":"Get the current user","responses":{"200":{"description":"The current user's profile and memberships","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"}}}]}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create or update the current user's profile

> Creates or updates the authenticated user's personal details (name and self-declared scouting role). Safe to call repeatedly; it upserts. The saved profile is returned in \`data\`.

```json
{"openapi":"3.1.1","info":{"title":"Trooply API","version":"1.0"},"servers":[{"url":"https://api.trooply.co.uk/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"description":"Bearer access token. Generate one from the **Developer** area of your Trooply account and send it as `Authorization: Bearer <token>`.","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"data":{},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"ResponseMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"request_id":{"type":"string","format":"uuid"},"total":{"type":"integer"}}},"Profile":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"first_name":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_name":{"type":"string"},"onboarding_completed_at":{"type":"string","format":"date-time"},"onboarding_step":{"type":"string"},"scouting_role":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","properties":{"code":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"},"status":{"type":"integer"}}},"UpsertProfileRequest":{"type":"object","required":["first_name","last_name","scouting_role"],"properties":{"first_name":{"type":"string","maxLength":100,"minLength":1},"last_name":{"type":"string","maxLength":100,"minLength":1},"onboarding_step":{"type":"string","maxLength":100},"scouting_role":{"type":"string","enum":["group_lead_volunteer","section_team_leader","section_team_member","district_county","group_administrator","something_else"]}}}}},"paths":{"/v1/me":{"put":{"description":"Creates or updates the authenticated user's personal details (name and self-declared scouting role). Safe to call repeatedly; it upserts. The saved profile is returned in `data`.","tags":["users"],"summary":"Create or update the current user's profile","responses":{"200":{"description":"The saved profile","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"}}}]}}}},"400":{"description":"Malformed JSON body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed; see error.fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertProfileRequest"}}},"description":"Profile details","required":true}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.trooply.co.uk/users.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
