# Endpoints

####

## Send event

> Using this endpoint you can send events for event-based missions. Requires \`X-API-KEY\` header to resolve operator identity.

```json
{"openapi":"3.0.3","info":{"title":"User Balance API","version":"1.0.0"},"servers":[{"url":"https://integration.enable3.io","description":"Production API server"}],"paths":{"/api/v1/event":{"post":{"summary":"Send event","description":"Using this endpoint you can send events for event-based missions. Requires `X-API-KEY` header to resolve operator identity.","operationId":"sendEvent","tags":["INTEGRATION"],"parameters":[{"name":"X-API-KEY","in":"header","required":true,"description":"API key assigned to user's operator","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppEventDto"}}}},"responses":{"201":{"description":"OK"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized (missing or invalid API key)"},"404":{"description":"User not found or unauthorized"}}}}},"components":{"schemas":{"AppEventDto":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"eventId":{"type":"string"},"eventTags":{"type":"array","items":{"type":"string"}},"value":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","userId","eventId","value","createdAt"]}}}}
```

#### Get Widget URL (use it for the [WebView integration)](https://docs.enabl3.io/enabl3/tech/integration/webview)

## Get widget url

> Get widget URL for operator's user.\
> The resulting URL will already have the required token. Expiration time = 1 day.<br>

```json
{"openapi":"3.0.3","info":{"title":"Integration API - Get Widget URL","version":"1.0"},"servers":[{"url":"https://integration.enable3.io"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key assigned to user's operator"}},"schemas":{"WidgetUrlResponse":{"type":"object","properties":{"url":{"type":"string","description":"Widget URL with embedded authentication token (valid for 1 day)"}},"required":["url"]}}},"paths":{"/api/v1/integration/user/{operatorUserId}/widget":{"get":{"summary":"Get widget url","operationId":"getWidgetUrl","description":"Get widget URL for operator's user.\nThe resulting URL will already have the required token. Expiration time = 1 day.\n","tags":["Widget"],"parameters":[{"name":"operatorUserId","in":"path","required":true,"description":"Operator user id, external one","schema":{"type":"string"}},{"name":"X-API-KEY","in":"header","required":true,"description":"API key assigned to user's operator","schema":{"type":"string"}},{"name":"referralCode","in":"query","required":false,"description":"Referral code provided by the operator on behalf of the user. If supplied, it will be applied as if the user entered it manually (e.g. during registration on the operator's side).\n","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetUrlResponse"}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"409":{"description":"Conflict"}}}}}}
```

#### Get JWT (use it for the [SDK](https://docs.enabl3.io/enabl3/tech/integration/sdk) integration)

Using for mobile SDK (Android).

{% openapi src="/files/o1gz5rFmqx2vk3F4eY5I" path="/api/v1/integration/user/{operatorUserId}/token" method="get" %}
[integration.json](https://2323683558-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SVK0eP2IwFbT1kSzOyQ%2Fuploads%2F2xCRKsC8J3sF2vxaQ9xE%2Fintegration.json?alt=media\&token=ce903cd3-f1e3-4dac-9e2c-de31ca4e75ca)
{% endopenapi %}

#### Send revenue

Sending revenue which used for Hold to earn calculation.

{% openapi src="/files/o1gz5rFmqx2vk3F4eY5I" path="/api/v1/revenue" method="post" %}
[integration.json](https://2323683558-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SVK0eP2IwFbT1kSzOyQ%2Fuploads%2F2xCRKsC8J3sF2vxaQ9xE%2Fintegration.json?alt=media\&token=ce903cd3-f1e3-4dac-9e2c-de31ca4e75ca)
{% endopenapi %}

{% openapi src="/files/o1gz5rFmqx2vk3F4eY5I" path="/api/v1/segment/users/" method="post" %}
[integration.json](https://2323683558-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SVK0eP2IwFbT1kSzOyQ%2Fuploads%2F2xCRKsC8J3sF2vxaQ9xE%2Fintegration.json?alt=media\&token=ce903cd3-f1e3-4dac-9e2c-de31ca4e75ca)
{% endopenapi %}

{% openapi src="/files/o1gz5rFmqx2vk3F4eY5I" path="/api/v1/segment/users" method="delete" %}
[integration.json](https://2323683558-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8SVK0eP2IwFbT1kSzOyQ%2Fuploads%2F2xCRKsC8J3sF2vxaQ9xE%2Fintegration.json?alt=media\&token=ce903cd3-f1e3-4dac-9e2c-de31ca4e75ca)
{% endopenapi %}

## Get current token balance by operatorUserId

> Get current token balance by \`operatorUserId\`. Requires \`X-API-KEY\` header to resolve \`operatorId\`.

```json
{"openapi":"3.0.3","info":{"title":"User Balance API","version":"1.0.0"},"servers":[{"url":"https://integration.enable3.io","description":"Production API server"}],"paths":{"/api/v1/integration/user/{operatorUserId}/balance":{"get":{"summary":"Get current token balance by operatorUserId","description":"Get current token balance by `operatorUserId`. Requires `X-API-KEY` header to resolve `operatorId`.","operationId":"getUserBalance","tags":["INTEGRATION"],"parameters":[{"name":"operatorUserId","in":"path","required":true,"description":"The user ID within the operator context","schema":{"type":"string"}},{"name":"X-API-KEY","in":"header","required":true,"description":"API key used to resolve the operatorId (injected internally)","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully returned user balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBalanceIntegrationDto"}}}},"401":{"description":"Unauthorized (missing or invalid API key)"},"404":{"description":"User not found or unauthorized"}}}}},"components":{"schemas":{"UserBalanceIntegrationDto":{"type":"object","properties":{"balance":{"type":"string","format":"decimal"},"userExists":{"type":"boolean"}},"required":["balance","userExists"]}}}}
```

## Add websites for operator

> Add one or more websites to an operator's integration configuration. Requires \`X-API-KEY\` header to resolve operator identity.

```json
{"openapi":"3.0.3","info":{"title":"User Balance API","version":"1.0.0"},"servers":[{"url":"https://integration.enable3.io","description":"Production API server"}],"paths":{"/api/v1/integration/websites":{"post":{"summary":"Add websites for operator","description":"Add one or more websites to an operator's integration configuration. Requires `X-API-KEY` header to resolve operator identity.","operationId":"addWebsites","tags":["INTEGRATION"],"parameters":[{"name":"X-API-KEY","in":"header","required":true,"description":"API key assigned to user's operator","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorWebsitesDto"}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized (missing or invalid API key)"},"404":{"description":"User not found or unauthorized"},"409":{"description":"Conflict (e.g. duplicate entry)"}}}}},"components":{"schemas":{"OperatorWebsitesDto":{"type":"object","properties":{"websites":{"type":"array","items":{"type":"string"}}},"required":["websites"]}}}}
```


---

# 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/endpoints.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.
