# Public API for data access

## POST /api/v2/integration/user/{userId}/rewards/redeem

> Reward from widget balance

```json
{"openapi":"3.1.0","info":{"title":"Integration API","version":"1"},"servers":[{"url":"https://integration.enable3.io","description":"Generated server url"}],"paths":{"/api/v2/integration/user/{userId}/rewards/redeem":{"post":{"tags":["integration-controller"],"description":"Reward from widget balance","operationId":"requestReward","parameters":[{"name":"operatorId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewardRequestDto"}}},"required":true},"responses":{"204":{"description":"No Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRewardResponseDto"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}}}}}},"components":{"schemas":{"RewardRequestDto":{"type":"object","properties":{"rewardId":{"type":"string"},"type":{"type":"string","enum":["EVENT","MODERATION","PROMO"]}}},"ClaimRewardResponseDto":{"type":"object","properties":{"reply":{"type":"string"}}},"CustomMessage":{"type":"object","properties":{"message":{"type":"string"},"property":{"type":"string"}}}}}}
```

## POST /api/v2/integration/user/{userId}/missions/{missionId}/claim

> Claim accumulated reward points for given mission

```json
{"openapi":"3.1.0","info":{"title":"Integration API","version":"1"},"servers":[{"url":"https://integration.enable3.io","description":"Generated server url"}],"paths":{"/api/v2/integration/user/{userId}/missions/{missionId}/claim":{"post":{"tags":["integration-controller"],"description":"Claim accumulated reward points for given mission","operationId":"claimMissionRewards","parameters":[{"name":"missionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"operatorId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}}}}}},"components":{"schemas":{"CustomMessage":{"type":"object","properties":{"message":{"type":"string"},"property":{"type":"string"}}}}}}
```

## GET /api/v2/integration/user/{userId}/rewards

> Get rewards available for user

```json
{"openapi":"3.1.0","info":{"title":"Integration API","version":"1"},"servers":[{"url":"https://integration.enable3.io","description":"Generated server url"}],"paths":{"/api/v2/integration/user/{userId}/rewards":{"get":{"tags":["integration-controller"],"description":"Get rewards available for user","operationId":"getAvailableRewards","parameters":[{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0,"minimum":0}},{"name":"lang","in":"query","required":true,"schema":{"type":"string"}},{"name":"operatorId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultsWrapperDtoUserRewardDto"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}}}}}},"components":{"schemas":{"ResultsWrapperDtoUserRewardDto":{"type":"object","properties":{"results":{"type":"array","description":"results for the requested page","items":{"$ref":"#/components/schemas/UserRewardDto"}},"total":{"type":"integer","format":"int64","description":"total number of results (non paginated)"},"hasNext":{"type":"boolean","description":"indicates if there are any results left beyond the current page"}}},"UserRewardDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"},"availableForUser":{"type":"boolean"}}},"CustomMessage":{"type":"object","properties":{"message":{"type":"string"},"property":{"type":"string"}}}}}}
```

## GET /api/v2/integration/user/{userId}/missions

> Get all active missions by user

```json
{"openapi":"3.1.0","info":{"title":"Integration API","version":"1"},"servers":[{"url":"https://integration.enable3.io","description":"Generated server url"}],"paths":{"/api/v2/integration/user/{userId}/missions":{"get":{"tags":["integration-controller"],"description":"Get all active missions by user","operationId":"getActiveMissions","parameters":[{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0,"minimum":0}},{"name":"lang","in":"query","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"operatorId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultsWrapperDtoUserMissionDto"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}}}}}},"components":{"schemas":{"ResultsWrapperDtoUserMissionDto":{"type":"object","properties":{"results":{"type":"array","description":"results for the requested page","items":{"$ref":"#/components/schemas/UserMissionDto"}},"total":{"type":"integer","format":"int64","description":"total number of results (non paginated)"},"hasNext":{"type":"boolean","description":"indicates if there are any results left beyond the current page"}}},"UserMissionDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"rewardAmount":{"type":"number"},"pendingRewardsAmountToClaim":{"type":"number"},"canClaim":{"type":"boolean"},"currentProgress":{"type":"number","description":"presents only for mission type IN_APP_EVENT"},"targetProgress":{"type":"number","description":"presents only for mission type IN_APP_EVENT"},"dueDate":{"type":"string","format":"string","pattern":"yyyy-MM-dd HH:mm"},"progressPercent":{"type":"number","description":"presents only for mission type IN_APP_EVENT, QUEST"}}},"CustomMessage":{"type":"object","properties":{"message":{"type":"string"},"property":{"type":"string"}}}}}}
```

## GET /api/v2/integration/user/{userId}/balance

> Get user's current balance

```json
{"openapi":"3.1.0","info":{"title":"Integration API","version":"1"},"servers":[{"url":"https://integration.enable3.io","description":"Generated server url"}],"paths":{"/api/v2/integration/user/{userId}/balance":{"get":{"tags":["integration-controller"],"description":"Get user's current balance","operationId":"getUserBalance","parameters":[{"name":"operatorId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"userId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBalanceDto"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomMessage"}}}}}}}},"components":{"schemas":{"UserBalanceDto":{"type":"object","properties":{"amount":{"type":"number"}}},"CustomMessage":{"type":"object","properties":{"message":{"type":"string"},"property":{"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://docs.enable3.io/enable3/tech/integration/public-api-for-data-access.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.
