> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reo.dev Write API: Reo Write Add Product Usage Event

> Send one product usage event for a user (email, LinkedIn, GitHub or username) to Reo.dev for a custom metric configured in Reo.

Send one product usage event for a user (email, LinkedIn, GitHub or username) to Reo.dev for a custom metric configured in Reo.

> [!NOTE]
>
> Tool ID: `reo_write_add_product_usage_event`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'reo_write_add_product_usage_event',
  {
    "payload": {
      "activity_type": "example",
      "source": "PRODUCT_CLOUD",
      "user_id": "user_123",
      "user_id_type": "EMAIL",
      "event_at": 123,
      "product_id": "product_123"
    }
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run reo_write_add_product_usage_event --input '{
  "payload": {
    "activity_type": "example",
    "source": "PRODUCT_CLOUD",
    "user_id": "user_123",
    "user_id_type": "EMAIL",
    "event_at": 123,
    "product_id": "product_123"
  }
}'
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "response_code": "example",
    "response": "example",
    "status": "example"
  }
}
```

Use `deepline describe reo_write_add_product_usage_event --json` for the latest machine-readable contract.

## Input reference

### Overview Sends one product usage event from your cloud product for a known user (email, GitHub, LinkedIn, social or username). Reo enriches the user, aggregates their usage at the developer level, and maps it to their company. ### Path Parameters None. ### Errors | Code | When it happens | Response body | |---|---|---| | 400 | API key wrong or missing | `&#123;"response_code":400,"response":"Authentication Failure","status":"failure"&#125;` | ### ENUMs | Field | Value | Meaning | |---|---|---| | source | `PRODUCT_CLOUD` | Usage event from your cloud product | | user\_id\_type | `EMAIL` | `user_id` is an email | | user\_id\_type | `SOCIAL` | `user_id` is a social profile ID | | user\_id\_type | `LINKEDIN` | `user_id` is a LinkedIn profile | | user\_id\_type | `GITHUB` | `user_id` is a GitHub profile | | user\_id\_type | `USERNAME` | `user_id` is a username | ### Things to Note - Uses the same endpoint as See the live schema below for the complete notes.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.payload` | `object` | Yes | — | Wrapper object. Every field sits inside it. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "### Overview Sends one product usage event from your cloud product for a known user (email, GitHub, LinkedIn, social or username). Reo enriches the user, aggregates their usage at the developer level, and maps it to their company. ### Path Parameters None. ### Errors | Code | When it happens | Response body | |---|---|---| | 400 | API key wrong or missing | `{\"response_code\":400,\"response\":\"Authentication Failure\",\"status\":\"failure\"}` | ### ENUMs | Field | Value | Meaning | |---|---|---| | source | `PRODUCT_CLOUD` | Usage event from your cloud product | | user_id_type | `EMAIL` | `user_id` is an email | | user_id_type | `SOCIAL` | `user_id` is a social profile ID | | user_id_type | `LINKEDIN` | `user_id` is a LinkedIn profile | | user_id_type | `GITHUB` | `user_id` is a GitHub profile | | user_id_type | `USERNAME` | `user_id` is a username | ### Things to Note - Uses the same endpoint as Add Telemetry Data. The only difference is `source: \"PRODUCT_CLOUD\"`. - Use your Write API key, not the Read API key. - `activity_type` must match a custom metric configured in Product Usage Settings, or Reo won't process the event.",
    "properties": {
      "payload": {
        "type": "object",
        "description": "Wrapper object. Every field sits inside it.",
        "properties": {
          "activity_type": {
            "type": "string",
            "description": "Must be a custom metric key configured in Product Usage Settings, for example `LOGIN_ACTIVITY`. If no usage data is available, send `CALL_HOME`."
          },
          "source": {
            "type": "string",
            "description": "`PRODUCT_CLOUD`. - `PRODUCT_CLOUD`: Usage event from your cloud product",
            "enum": [
              "PRODUCT_CLOUD"
            ]
          },
          "user_id": {
            "type": "string",
            "description": "Unique user ID, for example an email, LinkedIn URL or username."
          },
          "user_id_type": {
            "type": "string",
            "description": "Type of `user_id` (see ENUMs). - `EMAIL`: `user_id` is an email - `SOCIAL`: `user_id` is a social profile ID - `LINKEDIN`: `user_id` is a LinkedIn profile - `GITHUB`: `user_id` is a GitHub profile - `USERNAME`: `user_id` is a username",
            "enum": [
              "EMAIL",
              "SOCIAL",
              "LINKEDIN",
              "GITHUB",
              "USERNAME"
            ]
          },
          "event_at": {
            "type": "integer",
            "description": "When the event happened, Unix timestamp in seconds."
          },
          "product_id": {
            "type": "string",
            "description": "Unique ID of your product."
          },
          "ip_addr": {
            "type": "string",
            "description": "IP the user logged in from. Helps Reo resolve the company."
          },
          "domain": {
            "type": "string",
            "description": "Domain of the user or company."
          },
          "environment": {
            "type": "string",
            "description": "Where the product runs, for example `PRODUCTION`."
          },
          "event_id": {
            "type": "string",
            "description": "Unique ID for the event, used for filtering."
          },
          "user_agent": {
            "type": "string",
            "description": "Browser or client string."
          },
          "meta": {
            "type": "object",
            "description": "Any extra key-value data.",
            "additionalProperties": true
          }
        },
        "required": [
          "activity_type",
          "source",
          "user_id",
          "user_id_type",
          "event_at",
          "product_id"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "payload"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.response_code` | `string` | No | — | Status code, as a string. |
| `result.data.response` | `string` | No | — | Result message. |
| `result.data.status` | `string` | No | — | `success` or `failure`. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "response_code": {
            "type": "string",
            "description": "Status code, as a string."
          },
          "response": {
            "type": "string",
            "description": "Result message."
          },
          "status": {
            "type": "string",
            "description": "`success` or `failure`."
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.