You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/includes/collector-api/_actions-api.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@
4
4
5
5
**`POST https://api.moesif.net/v1/actions`**
6
6
7
-
Log a single custom action to Moesif. An action represents something a customer performed on your website
8
-
such as _Sign In_or _Purchased Subscription_. Each action consists of an_Action Name_ and optional _Metadata_.
7
+
Log a single action to Moesif.
8
+
Actions represent events that occur within your application at a specific point in time. They can be tracked within your UI (such as "User Clicked Sign Up") or from your backend (such as "SMS Job Finished"). Each action consists of a required_Action Name_ and optional _Metadata_.
9
9
10
10
<asideclass="warning">
11
-
Currently only the moesif-browser-js SDK supports tracking actions. If you need to track custom actions from your server, use the HTTP API directly.
11
+
Actions can be tracked from your frontend app using moesif-browser-js or directly from your backend using this API.
12
12
</aside>
13
13
14
14
**An example tracking actions using moesif-browser-js:**
Log a batch of custom action to Moesif. An action represents something a customer performed on your website
102
-
such as _Sign In_ or _Purchased Subscription_. Each action consists of an _Action Name_ and optional _Metadata_.
103
-
104
-
This API takes an array form of the same model defined for track single action.
105
-
The maximum batch size is **12MB**. Break up larger batches.
101
+
Log a batch of actions to Moesif.
102
+
Actions represent events that occur within your application at a specific point in time. They can be tracked within your UI (such as "User Clicked Sign Up") or from your backend (such as "SMS Job Finished"). Each action consists of a required _Action Name_ and optional _Metadata_.
106
103
104
+
This API accepts an array of actions as the payload
105
+
The maximum batch size is **15MB**. Break up larger batches into smaller batches.
107
106
108
107
<asideclass="warning">
109
-
Currently only the moesif-browser-js SDK supports tracking actions. if you need to track actions server-side, use the HTTP API directly.
108
+
Actions can be tracked from your frontend app using moesif-browser-js or directly from your backend using this API.
110
109
</aside>
111
110
112
111
**An example tracking actions using moesif-browser-js:**
transaction_id | string | false | A random 36 char UUID for this event. If set, Moesif will deduplicate events using this id and ensure idempotency. Moesif will still deduplicate even across different size batches.
199
-
action_name | string | __true__ | A recognizable name such as <i>Clicked Sign Up</i> or <i>Purchased Subscription<i>
198
+
action_name | string | __true__ | A recognizable name such as <i>Clicked Sign Up</i> or <i>SMS Job Finished<i>
200
199
session_token | string | false | The customer's current session token as a string.
201
200
user_id | string | false | Associate this API call to a [user](#users). Typically, a real person.
202
201
company_id | string | false | Associate this API call to a [company](#companies) (Required for metered billing).
Copy file name to clipboardExpand all lines: source/includes/collector-api/_events-api.md
+81-53Lines changed: 81 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@
4
4
5
5
**`POST https://api.moesif.net/v1/events`**
6
6
7
-
Log a single API call to Moesif as an event.
8
-
The request payload is a single API event containing the API request, the API response, and any custom event metadata.
7
+
Log an API call to Moesif. API Calls in Moesif represent a full API operation or span (in OTel terminology).
8
+
Each API call is a structured log containing the API request, the API response, start and end time, context, and any custom event metadata.
9
9
10
10
<asideclass="warning">
11
11
For logging API calls at scale, most customers should integrate with one of Moesif's <ahref="https://www.moesif.com/implementation">API monitoring agents</a> which instrument your API automatically and handle batching.
@@ -20,64 +20,69 @@ Replace <i>YOUR_COLLECTOR_APPLICATION_ID</i> with your real Application Id
@@ -642,12 +647,21 @@ response |object | false | The object that specifies the API response. The respo
642
647
<pstyle="margin-left:1.5em">body</p> |object | false | Payload of the response in either JSON or a base64 encoded string.
643
648
<pstyle="margin-left:1.5em">transfer_encoding</p> | string | false | Specifies the transfer encoding of _response.body_ field. If set to _json_ then the response.body must be a JSON object. If set to _base64_, then _response.body_ must be a base64 encoded string. Helpful for binary payloads. If not set, the body is assumed to be _json_.
644
649
||
650
+
span |object | false | The object that contains open telemetry span context
651
+
<pstyle="margin-left:1.5em">id</p> |string | false | The open telemetry span id for this API call.
652
+
<pstyle="margin-left:1.5em">parent_id</p> |string | false | The parent span id that comes before this API call.
653
+
<pstyle="margin-left:1.5em">links</p> |array | false | List of links to related traces or spans
654
+
<pstyle="margin-left:1.5em">status</p> |integer | false | The status of the span's operation
655
+
||
656
+
action_name | string | false | A recognizable operation name such as <i>Get Items</i> or <i>Triggered SMS Job<i>
657
+
trace_id | string | false | The open telemetry trace_id that this API call is part of.
645
658
transaction_id | string | false | A random 36 char UUID for this event. If set, Moesif will deduplicate events using this id and ensure idempotency.
646
659
session_token | string | false | Set the API key/session token used for this API call. Moesif will auto-detect API sessions if not set.
647
660
user_id | string | false | Associate this API call to a [user](#users). Typically, a real person.
648
661
company_id | string | false | Associate this API call to a [company](#companies) (Required for metered billing).
649
662
subscription_id | string | false | Associate this API call to a specific [subscription](#subscriptions) of a company. Not needed unless same company can have multiple subscriptions to the same plan. When set, usage will be reported to only this subscription.
650
-
direction | string | false | The direction of this API call which can be _Incoming_ or _Outgoing_.
663
+
direction | string | false | The direction of this API call which can be _Incoming_, _Outgoing_, or _Internal_
664
+
weight|integer | 1 | The weight of this event which is 1/sampling rate. Moesif uses this to reweigh scalar values, like counts, ensuring they are accurate even when API calls are sampled.
651
665
metadata | object | false | An object containing any custom event metadata you want to store with this event.
652
666
653
667
@@ -656,10 +670,10 @@ metadata | object | false | An object containing any custom event metadata you w
656
670
**`POST https://api.moesif.net/v1/events/batch`**
657
671
658
672
Creates and logs a batch of API calls to Moesif.
659
-
The request payload is an array API calls entities, each consisting of the API request, the API response, and any custom event metadata.
660
-
661
-
This API takes a list form of the same model defined in create single event.
673
+
API Calls in Moesif represent a full API operation or span (in OTel terminology).
674
+
Each API call is a structured log containing the API request, the API response, start and end time, context, and any custom event metadata.
662
675
676
+
This API accepts an array of API calls as the payload
663
677
The maximum batch size is **50MB**. Break up larger batches into smaller batches.
664
678
665
679
<asideclass="info">
@@ -722,6 +736,11 @@ Replace <i>YOUR_COLLECTOR_APPLICATION_ID</i> with your real Application Id
@@ -1204,10 +1223,19 @@ response |object | false | The object that specifies the API response. The respo
1204
1223
<p style="margin-left:1.5em">body</p>|object| false | Payload of the response in either JSONor a base64 encoded string.
1205
1224
<p style="margin-left:1.5em">transfer_encoding</p>| string | false | Specifies the transfer encoding of _response.body_ field. If set to _json_ then the response.body must be a JSONobject. If set to _base64_, then _response.body_ must be a base64 encoded string. Helpful for binary payloads. If notset, the body is assumed to be _json_.
1206
1225
||
1226
+
span |object| false | The object that contains open telemetry span context
1227
+
<p style="margin-left:1.5em">id</p>|string | false | The open telemetry span idfor this API call.
1228
+
<p style="margin-left:1.5em">parent_id</p>|string | false | The parent span id that comes before this API call.
1229
+
<p style="margin-left:1.5em">links</p>|array | false | List of links to related traces or spans
1230
+
<p style="margin-left:1.5em">status</p>|integer | false | The status of the span's operation
1231
+
||
1232
+
action_name | string | false | A recognizable operation name such as<i>Get Items</i>or<i>Triggered SMS Job<i>
1233
+
trace_id | string | false | The open telemetry trace_id that this API call is part of.
1207
1234
transaction_id | string | false | A random 36 char UUIDfor this event. If set, Moesif will deduplicate events using this idand ensure idempotency. Moesif will still deduplicate even across different size batches.
1208
1235
session_token | string | false | Set the API key/session token used for this API call. Moesif will auto-detect API sessions ifnotset.
1209
1236
user_id | string | false | Associate this API call to a [user](#users). Typically, a real person.
1210
1237
company_id | string | false | Associate this API call to a [company](#companies) (Required for metered billing).
1211
1238
subscription_id | string | false | Associate this API call to a specific [subscription](#subscriptions) of a company. Not needed unless same company can have multiple subscriptions to the same plan. When set, usage will be reported to only this subscription.
1212
-
direction | string | false | The direction of this API call which can be _Incoming_ or _Outgoing_.
1239
+
direction | string | false | The direction of this API call which can be _Incoming_, _Outgoing_, or _Internal_
1240
+
weight|integer |1| The weight of this event which is1/sampling rate. Moesif uses this to reweigh scalar values, like counts, ensuring they are accurate even when API calls are sampled.
1213
1241
metadata |object| false | An object containing any custom event metadata you want to store with this event.
Copy file name to clipboardExpand all lines: source/index.html.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ code_clipboard: true
38
38
39
39
# Moesif API Reference
40
40
41
-
Moesif is an API analytics and monetization service to grow your API products. With Moesif, you can quickly get started with API observability, API monetization and usage-based billing.
41
+
Moesif is an API analytics and monetization service to build and grow better API products. With Moesif, you can quickly get started with API observability, API monetization and usage-based billing.
42
42
43
43
With Moesif, you cam This reference is for v1 of the Moesif APIs.
44
44
For an overview on the Moesif platform, see the [developer docs](/docs) or [implementation guides](https://www.moesif.com/implementation)
@@ -52,6 +52,6 @@ There are two APIs:
52
52
53
53
## API definitions
54
54
55
-
The _Collector API_ enables you to log raw data to Moesif at high volume such as events and user profiles. It's a write-only, high-volume data collection network and is also used by the Moesif server integrations and plugins.
55
+
The _Collector API_ enables you to log your raw event data to Moesif at high volume such as API calls and user profiles. It's a write-only, high-volume data collection network and is also used by the Moesif server integrations and plugins.
56
56
57
57
The _Management API_ enables you to query and manage data in your Moesif account such as to embed charts in customer-facing applications.
0 commit comments