> For the complete documentation index, see [llms.txt](https://ro-proxy.gitbook.io/integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ro-proxy.gitbook.io/integration/user.md).

# User

Account profile and settings.

## Get the authenticated user's profile

> Return the profile (including current balance and bandwidth counters) of the user who owns the API key.

```json
{"openapi":"3.0.3","info":{"title":"RoProxy Integration API","version":"1.0.0"},"tags":[{"name":"User","description":"Account profile and settings."}],"servers":[{"url":"https://integration-api.ro-proxy.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key minted via `POST /api/key`, sent as\n`Authorization: Bearer <token>`.\n"}},"schemas":{"UserProfileEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"$ref":"#/components/schemas/UserProfile"}}},"UserProfile":{"type":"object","properties":{"id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"email":{"type":"string","format":"email"},"in":{"type":"integer","format":"int64","description":"Total inbound bytes used by this account."},"out":{"type":"integer","format":"int64","description":"Total outbound bytes used by this account."},"status":{"type":"string","enum":["inactive","active","ban"]},"country":{"type":"string","description":"ISO-3166 alpha-2 country code."},"balance":{"type":"number","format":"double","description":"Current account balance, in USD."}}},"ErrorEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]}},"responses":{"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/api/user/profile":{"get":{"tags":["User"],"summary":"Get the authenticated user's profile","description":"Return the profile (including current balance and bandwidth counters) of the user who owns the API key.","responses":{"200":{"description":"Profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## List the caller's permissions

> Return the list of permission codes granted to the caller. Regular users get an empty list; admins get the codes for the operations they may perform.

```json
{"openapi":"3.0.3","info":{"title":"RoProxy Integration API","version":"1.0.0"},"tags":[{"name":"User","description":"Account profile and settings."}],"servers":[{"url":"https://integration-api.ro-proxy.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key minted via `POST /api/key`, sent as\n`Authorization: Bearer <token>`.\n"}},"schemas":{"PermissionListEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"array","items":{"type":"string"}}}},"ErrorEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]}},"responses":{"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/api/user/permission":{"get":{"tags":["User"],"summary":"List the caller's permissions","description":"Return the list of permission codes granted to the caller. Regular users get an empty list; admins get the codes for the operations they may perform.","responses":{"200":{"description":"Permission codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionListEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Change the account password

> Update the password of the user who owns the API key. Existing API keys remain valid after a password change.

```json
{"openapi":"3.0.3","info":{"title":"RoProxy Integration API","version":"1.0.0"},"tags":[{"name":"User","description":"Account profile and settings."}],"servers":[{"url":"https://integration-api.ro-proxy.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key minted via `POST /api/key`, sent as\n`Authorization: Bearer <token>`.\n"}},"schemas":{"ChangePasswordRequest":{"type":"object","required":["old_password","new_password"],"properties":{"old_password":{"type":"string"},"new_password":{"type":"string","minLength":8}}},"EmptyEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]},"ErrorEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]}},"responses":{"BadRequest":{"description":"Invalid request payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/api/user/password":{"put":{"tags":["User"],"summary":"Change the account password","description":"Update the password of the user who owns the API key. Existing API keys remain valid after a password change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Password updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Update default country preference

> Set the ISO-3166 alpha-2 country code used as the default location when creating new sessions.

```json
{"openapi":"3.0.3","info":{"title":"RoProxy Integration API","version":"1.0.0"},"tags":[{"name":"User","description":"Account profile and settings."}],"servers":[{"url":"https://integration-api.ro-proxy.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key minted via `POST /api/key`, sent as\n`Authorization: Bearer <token>`.\n"}},"schemas":{"UpdateCountryRequest":{"type":"object","required":["country"],"properties":{"country":{"type":"string","description":"ISO-3166 alpha-2 country code."}}},"EmptyEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]},"ErrorEnvelope":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}},"required":["message"]}},"responses":{"BadRequest":{"description":"Invalid request payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServerError":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/api/user/country":{"put":{"tags":["User"],"summary":"Update default country preference","description":"Set the ISO-3166 alpha-2 country code used as the default location when creating new sessions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCountryRequest"}}}},"responses":{"200":{"description":"Country updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```


---

# 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://ro-proxy.gitbook.io/integration/user.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.
