> For the complete documentation index, see [llms.txt](https://docs.reo.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reo.dev/integrations/input-sources/api-based-integration/telemetry/single-events.md).

# Single Events

If you have an open source offering with call home/telemetry functionality to collect anonymous usage or event data, you can use the **Product Usage API** to share the data with Reo.Dev

From the telemetry data, we should be able to get

* IP address of the system or domain
* Unique user ID
* Activity Details

From the telemetry data, we will be able to enrich the

* IP address or domain and find out the company to which the user belongs
* With the unique user ID, we will aggregate the product usage at a developer level and ultimately map it to the company to which the user(s) are associated

{% hint style="info" %}
**Important Note:** Telemetry Data functionality requires the configuration of relevant metrics in the **Product Usage Settings**. Without this setup, the data cannot be transmitted or processed in the Reo.Dev platform.&#x20;

To ensure proper integration, follow the steps in [How to Configure Product Usage Metrics in Settings](/configurations/product-usage.md) before proceeding with telemetry data workflows.
{% endhint %}

### API Structure

| **Header**   | **Description**                                         | **Data type** |
| ------------ | ------------------------------------------------------- | ------------- |
| X-API-KEY    | Generated Reo.Dev \<API\_KEY> for authorization.        | string        |
| Content-Type | Request content-type is always set to application/json. | string        |

```
curl --location 'https://ingest.reo.dev/api/product/usage' \
--header 'X-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "payload": {
		 "activity_type" : "LOGIN_ACTIVITY",
		 "source": "TELEMETRY",        
		 "environment":"PRODUCTION",
        "user_id": "",
        "user_id_type":"",
        "ip_addr": "156.59.87.83",
        "domain":"",
        "event_id": 1231231232,  
        "event_at": 639303296,  
        "product_id": "reoWebApp",
        "user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "meta": {"property1":"value1","property2":"value2"}
    }
}'
```

{% hint style="info" %}
**Rate Limits**

The Product Usage API on <mark style="color:red;">`ingest.reo.dev`</mark> accepts up to **200 requests per minute**. **This limit applies to both single events and aggregated events.**<br>

*Need a higher limit?* Reach out to your CSM and we'll work with you on the right setup for your volume.
{% endhint %}

#### **Tenant API Key**

To access your API key, navigate to:

**Settings →Configurations → API Keys → Product Usage API**

{% hint style="info" %}
Note: Only users with Admin Role in Reo.Dev can access the API Keys
{% endhint %}

<figure><img src="https://2705882080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx46P5sAHxDG7PqOdVLxI%2Fuploads%2FKJeXnY1AK1gikgHakdfG%2Fimage.png?alt=media&amp;token=5fdebd96-0438-4b37-ac5a-13021b41da11" alt=""><figcaption></figcaption></figure>

| Parameter                                                        | Description                                                                                                                                                                                                                                           | Datatype | Allowed Values                                      | Example                                                                                                                   |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **source (Required)**                                            | Source of the activity.                                                                                                                                                                                                                               | enum     | `TELEMETRY`, `PRODUCT_CLOUD`                        | `"TELEMETRY"`                                                                                                             |
| **activity\_type (Required)**                                    | Usage Metrics of the product. The definition of primary, secondary1 and secondary2 should match with metrics defined in the Reo.Dev settings. Where Source is Telemetry and you do not get any product usage data, activity type can be `"CALL HOME"` | string   | Keys defined in metrics section in Reo.dev UI       | `"CALL HOME"`                                                                                                             |
| **environment (optional)**                                       | Environment where product has been deployed.                                                                                                                                                                                                          | string   |                                                     | `"PRODUCTION"`                                                                                                            |
| **user\_id\_type (optional)**                                    | Type of user ID such as email, Social, LinkedIn, GitHub, Username.                                                                                                                                                                                    | enum     | `EMAIL`, `SOCIAL`, `LINKEDIN`, `GITHUB`, `USERNAME` | `"EMAIL"`                                                                                                                 |
| **user\_id (optional)**                                          | Unique user ID captured for a customer.                                                                                                                                                                                                               | string   |                                                     | `"https://github.com/michaelbevan"`                                                                                       |
| **ip\_addr (mandatory)**                                         | IP address of the system from where the user has logged in.                                                                                                                                                                                           | string   |                                                     | `"192.127.0.0"`                                                                                                           |
| <p><strong>domain</strong><br><strong>(conditional)</strong></p> | domain of the user who has done the event. Either ip\_addr or domain is mandatory.                                                                                                                                                                    | string   |                                                     | `www.reo.dev`                                                                                                             |
| **event\_id (mandatory)**                                        | A unique identifier for the event for Tenant for filter.                                                                                                                                                                                              | string   |                                                     | `193ef456430`                                                                                                             |
| **event\_at (mandatory)**                                        | The time at which the event occurred (Formatted as a UNIX epoch in seconds).                                                                                                                                                                          | integer  |                                                     | `639303296`                                                                                                               |
| **product\_id (Required)**                                       | Unique identifier of your product.                                                                                                                                                                                                                    | string   |                                                     | `"reoWebApp"`                                                                                                             |
| **user\_agent (optional)**                                       | Additional browser properties. This is optional if `user_id` is sent. In case `user_id` is not sent, `user_agent` becomes mandatory.                                                                                                                  | string   |                                                     | `"Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"` |
| **meta (optional)**                                              | Any other parameter that needs to be sent.                                                                                                                                                                                                            | object   |                                                     |                                                                                                                           |

{% hint style="info" %}
Note: For telemetry data, the only accepted source value is "TELEMETRY".
{% endhint %}

### **Sample JSON Request**

```
"payload": {
	"activity_type": "CALL_HOME",
	"source": "TELEMETRY",        
	"environment": "PRODUCTION",
        "user_id": "",
        "user_id_type":"",
        "ip_addr": "156.59.87.83",
        "domain":"",
        "event_id": "193ef456430",  
        "event_at": "639303296",  
        "product_id": "V1.2",
        "user_agent": "Mozilla/5.0 (Macintosh, Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "meta": {}
    }
```

### **Sample JSON Response \[Success]**

```json
{
    "response_code": "200",
    "response": "Data Uploaded",
    "status": "success"
}
```

### **Sample JSON Response \[Wrong API Key]**

```json
{
    "response_code": 400,
    "response": "Authentication Failure",
    "status": "failure"
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.reo.dev/integrations/input-sources/api-based-integration/telemetry/single-events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
