# User

User identity management APIs. Used to retrieve and update player profiles and to link game-specific user identities with Sverse accounts.

## Get user information by identity

> Retrieve user information from the SDK system using a unique player identity\
> provided by the Game Studio.\
> \
> This endpoint is intended for server-to-server usage and requires a valid API key.\
> The returned user belongs to the game associated with the provided API key.<br>

```json
{"openapi":"3.0.3","info":{"title":"Sverse Managed Backend (Server SDK)","version":"1.0.0"},"tags":[{"name":"User","description":"User identity management APIs.\nUsed to retrieve and update player profiles and to link\ngame-specific user identities with Sverse accounts.\n"}],"servers":[{"url":"https://be.sverse.io","description":"Production Environment"},{"url":"https://sandbox.api.sverse.io","description":"Sandbox / Testing Environment"}],"paths":{"/api/private/users/{identity}":{"get":{"tags":["User"],"summary":"Get user information by identity","description":"Retrieve user information from the SDK system using a unique player identity\nprovided by the Game Studio.\n\nThis endpoint is intended for server-to-server usage and requires a valid API key.\nThe returned user belongs to the game associated with the provided API key.\n","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string"},"description":"Unique user identity from the Game Studio system"},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"API key issued to the Game Studio"}],"responses":{"200":{"description":"User information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"serverId":{"type":"string","description":"Identity of the user from the Game Studio system"}}}}}}}},"400":{"description":"Bad request – missing identity parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized – game not found or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}}}}}}}
```

## Update user information

> Update user information in the SDK system using a unique player identity\
> provided by the Game Studio.\
> \
> This endpoint is intended for server-to-server usage and requires a valid API key.\
> Only allowed user fields can be updated.<br>

```json
{"openapi":"3.0.3","info":{"title":"Sverse Managed Backend (Server SDK)","version":"1.0.0"},"tags":[{"name":"User","description":"User identity management APIs.\nUsed to retrieve and update player profiles and to link\ngame-specific user identities with Sverse accounts.\n"}],"servers":[{"url":"https://be.sverse.io","description":"Production Environment"},{"url":"https://sandbox.api.sverse.io","description":"Sandbox / Testing Environment"}],"paths":{"/api/private/users/{identity}":{"put":{"tags":["User"],"summary":"Update user information","description":"Update user information in the SDK system using a unique player identity\nprovided by the Game Studio.\n\nThis endpoint is intended for server-to-server usage and requires a valid API key.\nOnly allowed user fields can be updated.\n","parameters":[{"name":"identity","in":"path","required":true,"schema":{"type":"string"},"description":"Unique user identity from the Game Studio system"},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"API key issued to the Game Studio"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"New username of the user"}}}}}},"responses":{"200":{"description":"User information updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"identity":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}}}}}}},"400":{"description":"Bad request – missing or invalid identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized – game not found or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"boolean"},"message":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://sverse-1.gitbook.io/sverse-docs/api-reference/server/user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
