WebscaleApiDataModels
type WebscaleApiDataModels = {
AccessCheckRequest: WebscaleApiDataModels["RequestBase"] & {
resource?: WebscaleApiDataModels["RequestResource"];
};
AccessCheckResponse: {
customer: WebscaleApiDataModels["CustomerInfo"];
eventId: string;
features: {
[key: string]: {
featureId: string;
featureSlug: string;
properties: {
[key: string]:
| {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
}
| {
isFallback: boolean;
type: "number";
value: number | null;
}
| {
isFallback: boolean;
type: "string";
value: string | null;
}
| {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};
};
};
};
identity: WebscaleApiDataModels["UserIdentity"];
status: "success";
};
AnonymousRequestIdentity: {
anonymousIdentifier: string;
};
BlindCounterUpdateRequest: WebscaleApiDataModels["RequestBase"] & {
counterId: string;
resourceId?: string;
update?: number;
};
BlindCounterUpdateResponse: {
status: "success";
};
BooleanProperty: {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};
CloudflareRequest: {
cf?: WebscaleApiDataModels["CloudflareWorkersCf"];
};
CloudflareWorkersCf: {
asn?: number | null;
asOrganization?: string | null;
botManagement?: | {
corporateProxy?: boolean;
detectionIds?: number[];
ja3Hash?: string;
ja4?: string;
score?: number;
verifiedBot?: boolean;
}
| null;
city?: string | null;
continent?: string | null;
country?: string | null;
httpProtocol?: string | null;
isEUCountry?: string | null;
latitude?: string | null;
longitude?: string | null;
metroCode?: string | null;
postalCode?: string | null;
region?: string | null;
regionCode?: string | null;
timezone?: string | null;
tlsVersion?: string | null;
verifiedBotCategory?: string | null;
};
CustomerInfo: {
customerIdentifiers: string[];
hasProducts: boolean;
isCustomer: boolean;
};
EdgeRequest: {
bot?: | {
raw?: | {
[key: string]: unknown;
}
| null;
score?: number | null;
tags?: string[] | null;
verifiedBot?: boolean | null;
}
| null;
extra?: | {
[key: string]: unknown;
}
| null;
geo?: | {
city?: string | null;
continent?: string | null;
countryCode?: string | null;
latitude?: number | null;
longitude?: number | null;
metroCode?: string | null;
postalCode?: string | null;
region?: string | null;
regionCode?: string | null;
timezone?: string | null;
}
| null;
network?: | {
asn?: number | null;
asOrganization?: string | null;
proxyType?: "vpn" | "hosting" | "tor" | "corporate" | "residential" | null;
}
| null;
provider?: string | null;
requestId?: string | null;
tls?: | {
h2Fingerprint?: string | null;
httpProtocol?: string | null;
ja3Hash?: string | null;
ja4?: string | null;
version?: string | null;
}
| null;
};
ErrorResponse: {
errors?: WebscaleApiDataModels["ErrorResponse"][];
message: string;
status: "error";
statusCode: number;
};
FastlyRequest: {
botManagement?: | {
decisionMs?: number | null;
redirectUrl?: string | null;
tags?: string[];
verdict?: string | null;
wafResponse?: number | null;
} & {
[key: string]: unknown;
}
| null;
x-sigsci-requestid-header?: string | null;
x-sigsci-tags-header?: string | null;
} & {
[key: string]: unknown;
};
FeatureAccess: {
featureId: string;
featureSlug: string;
properties: {
[key: string]:
| {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
}
| {
isFallback: boolean;
type: "number";
value: number | null;
}
| {
isFallback: boolean;
type: "string";
value: string | null;
}
| {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};
};
};
FeatureProperty: | WebscaleApiDataModels["MeterableProperty"]
| WebscaleApiDataModels["NumberProperty"]
| WebscaleApiDataModels["StringProperty"]
| WebscaleApiDataModels["BooleanProperty"];
JwtRequestIdentity: {
createAnonymousIdentifierFallback?: boolean;
userJwt: string;
};
MeterableProperty: {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
};
NewAnonymousRequestIdentity: {
createAnonymousIdentifier: true;
};
NumberProperty: {
isFallback: boolean;
type: "number";
value: number | null;
};
OfferRedemptionAction: | {
properties?: {
[key: string]: unknown;
};
type: "navigate";
url: string;
}
| {
properties?: {
[key: string]: unknown;
};
type: string;
}
| {
properties?: {
[key: string]: unknown;
};
type: "none";
};
OfferRedemptionRequest: WebscaleApiDataModels["RequestBase"] & {
offerToken: string;
};
OfferRedemptionResponse: {
action: WebscaleApiDataModels["OfferRedemptionAction"];
eventId: string;
message?: string | null;
status: "success" | "failure";
statusCode: number;
};
ProvidedRequestIdentity: {
userIdentifier: string;
};
RequestBase: {
cloudflare?: WebscaleApiDataModels["CloudflareRequest"];
edge?: WebscaleApiDataModels["EdgeRequest"];
fastly?: WebscaleApiDataModels["FastlyRequest"];
http?: WebscaleApiDataModels["RequestHttp"];
identity?: WebscaleApiDataModels["RequestIdentity"];
properties?: {
[key: string]: unknown;
};
};
RequestHttp: {
clientIP?: string;
cookies?: {
[key: string]: string;
};
proxyOrigin?: {
status?: number;
};
referer?: string;
url?: string;
userAgent?: string;
};
RequestIdentity: | WebscaleApiDataModels["ProvidedRequestIdentity"]
| WebscaleApiDataModels["JwtRequestIdentity"]
| WebscaleApiDataModels["AnonymousRequestIdentity"]
| WebscaleApiDataModels["NewAnonymousRequestIdentity"];
RequestResource: {
id?: string;
meta?: {
[key: string]: string;
};
} & {
[key: string]: unknown;
};
StringProperty: {
isFallback: boolean;
type: "string";
value: string | null;
};
SubSurfaceBehavior: {
metadata: WebscaleApiDataModels["SubSurfaceMetadata"];
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};
SubSurfaceMetadata: {
cssSelector?: null | string;
};
SurfaceBehavior: {
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};
SurfaceDecisionRequest: WebscaleApiDataModels["RequestBase"] & {
components?: string[];
resource?: WebscaleApiDataModels["RequestResource"];
surfaceSlug: string;
};
SurfaceDecisionResponse: {
componentBehaviors: {
[key: string]: {
metadata: WebscaleApiDataModels["SubSurfaceMetadata"];
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};
};
componentsSkipped: boolean;
surfaceBehavior: WebscaleApiDataModels["SurfaceBehavior"];
} & WebscaleApiDataModels["AccessCheckResponse"];
UserIdentity: {
authType: "provided" | "jwt" | "anonymous" | "middleware";
identifier: string;
isAuthenticated: boolean;
jwtClaims?: {
[key: string]: unknown;
};
};
};Properties
AccessCheckRequest
AccessCheckRequest: WebscaleApiDataModels["RequestBase"] & {
resource?: WebscaleApiDataModels["RequestResource"];
};-
Type Declaration
resource?
optional resource?: WebscaleApiDataModels["RequestResource"]; -
Description
Request payload for access checks.
**User Identity:** If provided, one of the following must be provided: - `userIdentifier`: Direct user ID (requires secret key) - `userJwt`: JWT token for authenticated users - `anonymousIdentifier`: Anonymous session identifier If not provided, user identity must be resolved by middleware.
Example
{
* "identity": {
* "userIdentifier": "user_12345"
* },
* "resource": {
* "id": "article_abc123"
* }
* }AccessCheckResponse
AccessCheckResponse: {
customer: WebscaleApiDataModels["CustomerInfo"];
eventId: string;
features: {
[key: string]: {
featureId: string;
featureSlug: string;
properties: {
[key: string]:
| {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
}
| {
isFallback: boolean;
type: "number";
value: number | null;
}
| {
isFallback: boolean;
type: "string";
value: string | null;
}
| {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};
};
};
};
identity: WebscaleApiDataModels["UserIdentity"];
status: "success";
};-
customer
customer: WebscaleApiDataModels["CustomerInfo"]; -
eventId
eventId: string;Description
Unique identifier for this access check event
Example
c918c19e-b782-4c2f-93c0-8a5f94c0a1b5 -
features
features: { [key: string]: { featureId: string; featureSlug: string; properties: { [key: string]: | { consumedInRequest?: boolean; consumedUnits?: number; consumedUnitsInRequest?: number; counterId: string; excessUnitsInRequest?: number; hasAccess: boolean; isFallback: boolean; periodStart?: string; remainingUnits?: number; resourceIdUsed?: boolean; totalUnits?: number; type: "meterable"; uniqueResources?: boolean; } | { isFallback: boolean; type: "number"; value: number | null; } | { isFallback: boolean; type: "string"; value: string | null; } | { isFallback: boolean; type: "boolean"; value: boolean | null; }; }; }; };Index Signature
[key: string]: { featureId: string; featureSlug: string; properties: { [key: string]: | { consumedInRequest?: boolean; consumedUnits?: number; consumedUnitsInRequest?: number; counterId: string; excessUnitsInRequest?: number; hasAccess: boolean; isFallback: boolean; periodStart?: string; remainingUnits?: number; resourceIdUsed?: boolean; totalUnits?: number; type: "meterable"; uniqueResources?: boolean; } | { isFallback: boolean; type: "number"; value: number | null; } | { isFallback: boolean; type: "string"; value: string | null; } | { isFallback: boolean; type: "boolean"; value: boolean | null; }; }; }Description
Map of feature slugs to feature access information
-
identity
identity: WebscaleApiDataModels["UserIdentity"]; -
status
status: "success";Description
Status of the access check
-
Description
Response from an access check
AnonymousRequestIdentity
AnonymousRequestIdentity: {
anonymousIdentifier: string;
};Anonymous User
-
anonymousIdentifier
anonymousIdentifier: string;Description
Identifier for anonymous/unauthenticated users. Use this for guest sessions or before user login.
Example
anon_session_789 -
Description
Request with anonymous identifier
BlindCounterUpdateRequest
BlindCounterUpdateRequest: WebscaleApiDataModels["RequestBase"] & {
counterId: string;
resourceId?: string;
update?: number;
};-
Type Declaration
counterId
counterId: string;Description
Unique identifier for the counter to update
Example
api_calls.monthly_limitresourceId?
optional resourceId?: string;Description
ID of the resource being tracked
Example
api_endpoint_123update?
optional update?: number;Description
Amount to add to the counter (can be negative)
Default
1Example
1 -
Description
Request to update usage counters without access check.
BlindCounterUpdateResponse
BlindCounterUpdateResponse: {
status: "success";
};-
status
status: "success";Description
Status of the counter update
-
Description
Response from a counter update
BooleanProperty
BooleanProperty: {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};-
isFallback
isFallback: boolean;Description
Whether this is a default value
-
type
type: "boolean";Description
Type of the property (enum property replaced by openapi-typescript)
-
value
value: boolean | null;Description
Boolean configuration value
Example
true
CloudflareRequest
CloudflareRequest: {
cf?: WebscaleApiDataModels["CloudflareWorkersCf"];
};Cloudflare Request Info
-
cf?
optional cf?: WebscaleApiDataModels["CloudflareWorkersCf"]; -
Description
Request information specific to requests made from Cloudflare Workers. (requires secret key)
CloudflareWorkersCf
CloudflareWorkersCf: {
asn?: number | null;
asOrganization?: string | null;
botManagement?: | {
corporateProxy?: boolean;
detectionIds?: number[];
ja3Hash?: string;
ja4?: string;
score?: number;
verifiedBot?: boolean;
}
| null;
city?: string | null;
continent?: string | null;
country?: string | null;
httpProtocol?: string | null;
isEUCountry?: string | null;
latitude?: string | null;
longitude?: string | null;
metroCode?: string | null;
postalCode?: string | null;
region?: string | null;
regionCode?: string | null;
timezone?: string | null;
tlsVersion?: string | null;
verifiedBotCategory?: string | null;
};Cloudflare Workers CF Object
-
asn?
optional asn?: number | null; -
asOrganization?
optional asOrganization?: string | null; -
botManagement?
optional botManagement?: | { corporateProxy?: boolean; detectionIds?: number[]; ja3Hash?: string; ja4?: string; score?: number; verifiedBot?: boolean; } | null; -
city?
optional city?: string | null; -
continent?
optional continent?: string | null; -
country?
optional country?: string | null; -
httpProtocol?
optional httpProtocol?: string | null; -
isEUCountry?
optional isEUCountry?: string | null; -
latitude?
optional latitude?: string | null; -
longitude?
optional longitude?: string | null; -
metroCode?
optional metroCode?: string | null; -
postalCode?
optional postalCode?: string | null; -
region?
optional region?: string | null; -
regionCode?
optional regionCode?: string | null; -
timezone?
optional timezone?: string | null; -
tlsVersion?
optional tlsVersion?: string | null; -
verifiedBotCategory?
optional verifiedBotCategory?: string | null; -
Description
See https://developers.cloudflare.com/workers/runtime-apis/request/#incomingrequestcfproperties
CustomerInfo
CustomerInfo: {
customerIdentifiers: string[];
hasProducts: boolean;
isCustomer: boolean;
};-
customerIdentifiers
customerIdentifiers: string[];Description
List of customer identifiers (user ID, Stripe customer ID, etc.)
Example
[ "user_12345", "stripe_cus_abc123" ] -
hasProducts
hasProducts: boolean;Description
Whether the user has any associated products
Example
true -
isCustomer
isCustomer: boolean;Description
Whether the user is a paying customer
Example
true -
Description
Customer status and product information
EdgeRequest
EdgeRequest: {
bot?: | {
raw?: | {
[key: string]: unknown;
}
| null;
score?: number | null;
tags?: string[] | null;
verifiedBot?: boolean | null;
}
| null;
extra?: | {
[key: string]: unknown;
}
| null;
geo?: | {
city?: string | null;
continent?: string | null;
countryCode?: string | null;
latitude?: number | null;
longitude?: number | null;
metroCode?: string | null;
postalCode?: string | null;
region?: string | null;
regionCode?: string | null;
timezone?: string | null;
}
| null;
network?: | {
asn?: number | null;
asOrganization?: string | null;
proxyType?: "vpn" | "hosting" | "tor" | "corporate" | "residential" | null;
}
| null;
provider?: string | null;
requestId?: string | null;
tls?: | {
h2Fingerprint?: string | null;
httpProtocol?: string | null;
ja3Hash?: string | null;
ja4?: string | null;
version?: string | null;
}
| null;
};Edge Request Info
-
bot?
optional bot?: | { raw?: | { [key: string]: unknown; } | null; score?: number | null; tags?: string[] | null; verifiedBot?: boolean | null; } | null;Union Members
Type Literal
{ raw?: | { [key: string]: unknown; } | null; score?: number | null; tags?: string[] | null; verifiedBot?: boolean | null; }raw?
optional raw?: | { [key: string]: unknown; } | null;Description
The CDN's own bot management object, for fields not mapped above
score?
optional score?: number | null;Description
0-100, higher is more likely human
tags?
optional tags?: string[] | null;verifiedBot?
optional verifiedBot?: boolean | null;
null
-
extra?
optional extra?: | { [key: string]: unknown; } | null;Description
Any other CDN-specific values
-
geo?
optional geo?: | { city?: string | null; continent?: string | null; countryCode?: string | null; latitude?: number | null; longitude?: number | null; metroCode?: string | null; postalCode?: string | null; region?: string | null; regionCode?: string | null; timezone?: string | null; } | null;Union Members
Type Literal
{ city?: string | null; continent?: string | null; countryCode?: string | null; latitude?: number | null; longitude?: number | null; metroCode?: string | null; postalCode?: string | null; region?: string | null; regionCode?: string | null; timezone?: string | null; }city?
optional city?: string | null;continent?
optional continent?: string | null;Description
Continent code, derived from
countryCodewhen omittedExample
EUcountryCode?
optional countryCode?: string | null;Description
ISO 3166-1 alpha-2 country code
Example
GBlatitude?
optional latitude?: number | null;longitude?
optional longitude?: number | null;metroCode?
optional metroCode?: string | null;postalCode?
optional postalCode?: string | null;region?
optional region?: string | null;Example
EnglandregionCode?
optional regionCode?: string | null;Description
ISO 3166-2 first-level subdivision code
Example
ENGtimezone?
optional timezone?: string | null;Description
IANA time zone name
Example
Europe/London
null
Description
The end user's location. isEUCountry is derived from countryCode.
-
network?
optional network?: | { asn?: number | null; asOrganization?: string | null; proxyType?: "vpn" | "hosting" | "tor" | "corporate" | "residential" | null; } | null;Union Members
Type Literal
{ asn?: number | null; asOrganization?: string | null; proxyType?: "vpn" | "hosting" | "tor" | "corporate" | "residential" | null; }asn?
optional asn?: number | null;Description
Autonomous system number of the requester
Example
2856asOrganization?
optional asOrganization?: string | null;proxyType?
optional proxyType?: "vpn" | "hosting" | "tor" | "corporate" | "residential" | null;Description
Anonymising proxy classification, where the CDN provides one
null
-
provider?
optional provider?: string | null;Description
The CDN or proxy that served the request
Example
akamai -
requestId?
optional requestId?: string | null;Description
The CDN's own request identifier, for joining MOS events to its logs
-
tls?
optional tls?: | { h2Fingerprint?: string | null; httpProtocol?: string | null; ja3Hash?: string | null; ja4?: string | null; version?: string | null; } | null;Union Members
Type Literal
{ h2Fingerprint?: string | null; httpProtocol?: string | null; ja3Hash?: string | null; ja4?: string | null; version?: string | null; }h2Fingerprint?
optional h2Fingerprint?: string | null;Description
HTTP/2 client fingerprint
httpProtocol?
optional httpProtocol?: string | null;Example
HTTP/2ja3Hash?
optional ja3Hash?: string | null;Description
JA3 TLS client fingerprint (MD5)
ja4?
optional ja4?: string | null;Description
JA4 TLS client fingerprint
version?
optional version?: string | null;Example
TLSv1.3
null
-
Description
Request information from any CDN or edge proxy, for platforms without a dedicated body such as
cloudflareorfastly. (requires secret key) When present, it replaces the geo and bot data of the request that reached MOS, since that request came from the proxy rather than the end user. Values of the wrong type are ignored, and numeric fields also accept numeric strings.
ErrorResponse
ErrorResponse: {
errors?: WebscaleApiDataModels["ErrorResponse"][];
message: string;
status: "error";
statusCode: number;
};-
errors?
optional errors?: WebscaleApiDataModels["ErrorResponse"][];Description
Additional error details
-
message
message: string;Description
Human-readable error message
Example
Invalid API key -
status
status: "error";Description
Status indicating an error occurred
-
statusCode
statusCode: number;Description
HTTP status code
Example
400 -
Description
Error response format
FastlyRequest
FastlyRequest: {
botManagement?: | {
decisionMs?: number | null;
redirectUrl?: string | null;
tags?: string[];
verdict?: string | null;
wafResponse?: number | null;
} & {
[key: string]: unknown;
}
| null;
x-sigsci-requestid-header?: string | null;
x-sigsci-tags-header?: string | null;
} & {
[key: string]: unknown;
};Fastly Request Info
-
Type Declaration
botManagement?
optional botManagement?: | { decisionMs?: number | null; redirectUrl?: string | null; tags?: string[]; verdict?: string | null; wafResponse?: number | null; } & { [key: string]: unknown; } | null;x-sigsci-requestid-header?
optional x-sigsci-requestid-header?: string | null;x-sigsci-tags-header?
optional x-sigsci-tags-header?: string | null; -
Description
Request information specific to requests made from Fastly Compute. (requires secret key)
clientcarries Fastly'sClientInfo, with its location data underclient.geo. MOS reads the end user's geo, network and TLS fingerprint from it, and ignores values of the wrong type.
FeatureAccess
FeatureAccess: {
featureId: string;
featureSlug: string;
properties: {
[key: string]:
| {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
}
| {
isFallback: boolean;
type: "number";
value: number | null;
}
| {
isFallback: boolean;
type: "string";
value: string | null;
}
| {
isFallback: boolean;
type: "boolean";
value: boolean | null;
};
};
};-
featureId
featureId: string;Description
Internal feature identifier
Example
feat_123456 -
featureSlug
featureSlug: string;Description
Feature slug for external reference
Example
file_system -
properties
properties: { [key: string]: | { consumedInRequest?: boolean; consumedUnits?: number; consumedUnitsInRequest?: number; counterId: string; excessUnitsInRequest?: number; hasAccess: boolean; isFallback: boolean; periodStart?: string; remainingUnits?: number; resourceIdUsed?: boolean; totalUnits?: number; type: "meterable"; uniqueResources?: boolean; } | { isFallback: boolean; type: "number"; value: number | null; } | { isFallback: boolean; type: "string"; value: string | null; } | { isFallback: boolean; type: "boolean"; value: boolean | null; }; };Index Signature
[key: string]: | { consumedInRequest?: boolean; consumedUnits?: number; consumedUnitsInRequest?: number; counterId: string; excessUnitsInRequest?: number; hasAccess: boolean; isFallback: boolean; periodStart?: string; remainingUnits?: number; resourceIdUsed?: boolean; totalUnits?: number; type: "meterable"; uniqueResources?: boolean; } | { isFallback: boolean; type: "number"; value: number | null; } | { isFallback: boolean; type: "string"; value: string | null; } | { isFallback: boolean; type: "boolean"; value: boolean | null; }Description
Feature properties
-
Description
Access information for a specific feature
FeatureProperty
FeatureProperty:
| WebscaleApiDataModels["MeterableProperty"]
| WebscaleApiDataModels["NumberProperty"]
| WebscaleApiDataModels["StringProperty"]
| WebscaleApiDataModels["BooleanProperty"];-
Description
A feature property that can be boolean, number, string, or meterable with usage tracking
JwtRequestIdentity
JwtRequestIdentity: {
createAnonymousIdentifierFallback?: boolean;
userJwt: string;
};JWT Authentication
-
createAnonymousIdentifierFallback?
optional createAnonymousIdentifierFallback?: boolean;Description
If true, MonetizationOS will create an anonymous identifier for this request if JWT authentication fails.
-
userJwt
userJwt: string;Description
JWT token for user authentication. The JWT must be valid according to your configured JWT integrations.
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30 -
Description
Request with JWT token
MeterableProperty
MeterableProperty: {
consumedInRequest?: boolean;
consumedUnits?: number;
consumedUnitsInRequest?: number;
counterId: string;
excessUnitsInRequest?: number;
hasAccess: boolean;
isFallback: boolean;
periodStart?: string;
remainingUnits?: number;
resourceIdUsed?: boolean;
totalUnits?: number;
type: "meterable";
uniqueResources?: boolean;
};-
consumedInRequest?
optional consumedInRequest?: boolean;Description
Whether the counter for this meter was incremented in this request
Example
false -
consumedUnits?
optional consumedUnits?: number;Description
Number of units already consumed in the current period
Example
10 -
consumedUnitsInRequest?
optional consumedUnitsInRequest?: number;Description
Number of units consumed in this request
Example
1 -
counterId
counterId: string;Description
Unique identifier for the usage counter
Example
feat_123456.enabled -
excessUnitsInRequest?
optional excessUnitsInRequest?: number;Description
Number of attempted consumption units in this request that exceeded available units
Example
0 -
hasAccess
hasAccess: boolean;Description
Whether the user currently has access
Example
true -
isFallback
isFallback: boolean;Description
Whether this is a default value
-
periodStart?
optional periodStart?: string;Format: date-time
Description
Start of the current usage period
Example
2025-07-01T00:00:00Z -
remainingUnits?
optional remainingUnits?: number;Description
Number of units remaining in the current period
Example
5 -
resourceIdUsed?
optional resourceIdUsed?: boolean;Description
Whether the resource ID associated with this check has previously been used
Example
false -
totalUnits?
optional totalUnits?: number;Description
Total units allowed in the current period
Example
15 -
type
type: "meterable";Description
Type of the property (enum property replaced by openapi-typescript)
-
uniqueResources?
optional uniqueResources?: boolean;Description
Whether this counter tracks unique resources
Example
false
NewAnonymousRequestIdentity
NewAnonymousRequestIdentity: {
createAnonymousIdentifier: true;
};New Anonymous User
-
createAnonymousIdentifier
createAnonymousIdentifier: true;Description
Must be set to 'true'.
Example
true @enum {boolean} -
Description
Specifies that MonetizationOS should generate a new identifier for this anonymous user.
NumberProperty
NumberProperty: {
isFallback: boolean;
type: "number";
value: number | null;
};-
isFallback
isFallback: boolean;Description
Whether this is a default value
-
type
type: "number";Description
Type of the property (enum property replaced by openapi-typescript)
-
value
value: number | null;Description
Numeric configuration value
Example
100
OfferRedemptionAction
OfferRedemptionAction:
| {
properties?: {
[key: string]: unknown;
};
type: "navigate";
url: string;
}
| {
properties?: {
[key: string]: unknown;
};
type: string;
}
| {
properties?: {
[key: string]: unknown;
};
type: "none";
};-
Union Members
Type Literal
{ properties?: { [key: string]: unknown; }; type: "navigate"; url: string; }properties?
optional properties?: { [key: string]: unknown; };Index Signature
[key: string]: unknownDescription
Optional object of additional properties, produced by the redemption workflow.
type
type: "navigate";Description
Type of action to take
Example
navigate @enum {string}url
url: string;Description
URL to navigate the user to
Example
https://www.example.com/post-checkout
Type Literal
{
properties?: {
[key: string]: unknown;
};
type: string;
}properties?
optional properties?: {
[key: string]: unknown;
};Index Signature
[key: string]: unknownDescription
Optional object of additional properties, produced by the redemption workflow.
type
type: string;Description
Type of custom action to take
Example
custom:display-popupType Literal
{
properties?: {
[key: string]: unknown;
};
type: "none";
}properties?
optional properties?: {
[key: string]: unknown;
};Index Signature
[key: string]: unknownDescription
Optional object of additional properties, produced by the redemption workflow.
type
type: "none";Example
none
@enum {string}-
Description
Action to take as a result of an offer redemption, returned by the redemption workflow
OfferRedemptionRequest
OfferRedemptionRequest: WebscaleApiDataModels["RequestBase"] & {
offerToken: string;
};-
Type Declaration
offerToken
offerToken: string; -
Description
Request payload for redeeming an offer.
Example
{
* "offerToken": "abc123.def456.ghi789",
* "identity": {
* "userIdentifier": "user_12345"
* }
* }OfferRedemptionResponse
OfferRedemptionResponse: {
action: WebscaleApiDataModels["OfferRedemptionAction"];
eventId: string;
message?: string | null;
status: "success" | "failure";
statusCode: number;
};-
action
action: WebscaleApiDataModels["OfferRedemptionAction"];Description
Actions to take as a result of the offer redemption, produced by the redemption workflow
-
eventId
eventId: string;Description
Unique identifier for this offer redemption event
Example
c918c19e-b782-4c2f-93c0-8a5f94c0a1b5 -
message?
optional message?: string | null;Description
Optional, human-readable error message included when status is 'failure'
Example
Invalid offer token -
status
status: "success" | "failure";Description
Status of the offer redemption
-
statusCode
statusCode: number;Description
HTTP status code to returned to the client as a result of this redemption.
Example
200 -
Description
Response from an offer redemption
ProvidedRequestIdentity
ProvidedRequestIdentity: {
userIdentifier: string;
};Authenticated User
-
userIdentifier
userIdentifier: string;Description
Authenticated user identifier. Can only be used with an organization's secret keys. Use this when you have a direct user ID from your system.
Example
user_12345 -
Description
Request with direct user identifier
RequestBase
RequestBase: {
cloudflare?: WebscaleApiDataModels["CloudflareRequest"];
edge?: WebscaleApiDataModels["EdgeRequest"];
fastly?: WebscaleApiDataModels["FastlyRequest"];
http?: WebscaleApiDataModels["RequestHttp"];
identity?: WebscaleApiDataModels["RequestIdentity"];
properties?: {
[key: string]: unknown;
};
};-
cloudflare?
optional cloudflare?: WebscaleApiDataModels["CloudflareRequest"]; -
edge?
optional edge?: WebscaleApiDataModels["EdgeRequest"]; -
fastly?
optional fastly?: WebscaleApiDataModels["FastlyRequest"]; -
http?
optional http?: WebscaleApiDataModels["RequestHttp"]; -
identity?
optional identity?: WebscaleApiDataModels["RequestIdentity"]; -
properties?
optional properties?: { [key: string]: unknown; };Index Signature
[key: string]: unknownDescription
Optional object of properties to pass additional information to the workflows. Available in the workflow as
context.properties. -
Description
Base properties for a request payload for all endpoints related to end users.
RequestHttp
RequestHttp: {
clientIP?: string;
cookies?: {
[key: string]: string;
};
proxyOrigin?: {
status?: number;
};
referer?: string;
url?: string;
userAgent?: string;
};-
clientIP?
optional clientIP?: string;Description
The IP address of the original HTTP request client. Available as
context.clientIPin workflows.Example
203.0.113.42 -
cookies?
optional cookies?: { [key: string]: string; };Index Signature
[key: string]: stringDescription
Selected cookies from the original HTTP request Cookie header. Available as
context.cookiesin workflows.Example
{ * "__session": "jwt-token", * "theme": "dark" * } -
proxyOrigin?
optional proxyOrigin?: { status?: number; };Description
Information about the response from the origin server, where this request is being used to drive a proxy.
proxyOrigin.status?
optional status?: number;Description
HTTP status code from the origin response
Example
200 -
referer?
optional referer?: string;Description
The Referer header from the original HTTP request. Available as
context.refererin workflows.Example
https://www.example.com/homepage -
url?
optional url?: string;Description
The full URL of the original HTTP request, including scheme, host, path, and query string. Available as
context.rawUrlin workflows.Example
https://www.example.com/articles/foo?test=123&ref=homepage -
userAgent?
optional userAgent?: string;Description
The user agent string from the original HTTP request. Available as
context.userAgentin workflows.Example
Mozilla/5.0 (platform; rv:gecko-version) Gecko/gecko-trail Firefox/firefox-version -
Description
HTTP request information forwarded by the client. Can only be specified when a secret key is used.
RequestIdentity
RequestIdentity:
| WebscaleApiDataModels["ProvidedRequestIdentity"]
| WebscaleApiDataModels["JwtRequestIdentity"]
| WebscaleApiDataModels["AnonymousRequestIdentity"]
| WebscaleApiDataModels["NewAnonymousRequestIdentity"];Request Identity
-
Description
Properties used to identify the user or session that the request is associated with
RequestResource
RequestResource: {
id?: string;
meta?: {
[key: string]: string;
};
} & {
[key: string]: unknown;
};-
Type Declaration
id?
optional id?: string;Description
Unique identifier for the resource
Example
article_abc123meta?
optional meta?: { [key: string]: string; };Index Signature
[key: string]: stringDescription
Arbitrary key-value metadata for the resource. All values must be strings. If provided, any non-string value will result in a 400 response.
Example
{ * "category": "news", * "og:title": "Example Article" * } -
Description
Information about the resource being accessed. This helps determine which features and meter limits apply to the request.
Example
{
* "id": "article_abc123"
* }StringProperty
StringProperty: {
isFallback: boolean;
type: "string";
value: string | null;
};-
isFallback
isFallback: boolean;Description
Whether this is a default value
-
type
type: "string";Description
Type of the property (enum property replaced by openapi-typescript)
-
value
value: string | null;Description
String configuration value
Example
premium
SubSurfaceBehavior
SubSurfaceBehavior: {
metadata: WebscaleApiDataModels["SubSurfaceMetadata"];
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};-
Type Declaration
metadata
metadata: WebscaleApiDataModels["SubSurfaceMetadata"];properties?
optional properties?: { [key: string]: unknown; };Index Signature
[key: string]: unknownDescription
Optional record of string keys to unknown values
-
Description
Open object with the results produced by the surface component workflows
SubSurfaceMetadata
SubSurfaceMetadata: {
cssSelector?: null | string;
};-
cssSelector?
optional cssSelector?: null | string;Description
Optional CSS selector string
-
Description
Metadata for sub-surface behavior with optional CSS selector
SurfaceBehavior
SurfaceBehavior: {
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};-
Type Declaration
properties?
optional properties?: { [key: string]: unknown; };Index Signature
[key: string]: unknownDescription
Optional record of string keys to unknown values
-
Description
Open object with the results produced by the top-level surface workflow
SurfaceDecisionRequest
SurfaceDecisionRequest: WebscaleApiDataModels["RequestBase"] & {
components?: string[];
resource?: WebscaleApiDataModels["RequestResource"];
surfaceSlug: string;
};-
Type Declaration
components?
optional components?: string[];Description
Slugs of the surface components to run. Only these component workflows run and appear in
componentBehaviors. If omitted, all components run. If empty, only the surface workflow runs. Unknown slugs are ignored. Available in the surface workflow ascomponents, holding the slugs that will run.Example
[ "lesson-paywall" ]resource?
optional resource?: WebscaleApiDataModels["RequestResource"];surfaceSlug
surfaceSlug: string; -
Description
Request payload for surface decisions.
**User Identity:** If provided, one of the following must be provided: - `userIdentifier`: Direct user ID (requires secret key) - `userJwt`: JWT token for authenticated users - `anonymousIdentifier`: Anonymous session identifier If not provided, user identity must be resolved by middleware.
Example
{
* "surfaceSlug": "website",
* "identity": {
* "userIdentifier": "user_12345"
* },
* "resource": {
* "id": "article_abc123"
* }
* }SurfaceDecisionResponse
SurfaceDecisionResponse: {
componentBehaviors: {
[key: string]: {
metadata: WebscaleApiDataModels["SubSurfaceMetadata"];
properties?: {
[key: string]: unknown;
};
} & {
[key: string]: unknown;
};
};
componentsSkipped: boolean;
surfaceBehavior: WebscaleApiDataModels["SurfaceBehavior"];
} & WebscaleApiDataModels["AccessCheckResponse"];-
Type Declaration
componentBehaviors
componentBehaviors: { [key: string]: { metadata: WebscaleApiDataModels["SubSurfaceMetadata"]; properties?: { [key: string]: unknown; }; } & { [key: string]: unknown; }; };Index Signature
[key: string]: { metadata: WebscaleApiDataModels["SubSurfaceMetadata"]; properties?: { [key: string]: unknown; }; } & { [key: string]: unknown; }Description
Record of component behaviors mapped by component slug. Holds only the components selected by
componentsin the request, if provided.componentsSkipped
componentsSkipped: boolean;Description
Whether the component workflows were skipped by returning early from the surface workflow.
surfaceBehavior
surfaceBehavior: WebscaleApiDataModels["SurfaceBehavior"]; -
Description
Response from a surface decision
UserIdentity
UserIdentity: {
authType: "provided" | "jwt" | "anonymous" | "middleware";
identifier: string;
isAuthenticated: boolean;
jwtClaims?: {
[key: string]: unknown;
};
};-
authType
authType: "provided" | "jwt" | "anonymous" | "middleware";Description
How the user was authenticated: - provided: Direct identifier via API - jwt: JWT token authentication - anonymous: Anonymous user - middleware: Identity set by middleware
Example
provided @enum {string} -
identifier
identifier: string;Description
The user's identifier
Example
user_12345 -
isAuthenticated
isAuthenticated: boolean;Description
Whether the user is authenticated
Example
true -
jwtClaims?
optional jwtClaims?: { [key: string]: unknown; };Index Signature
[key: string]: unknownDescription
Claims extracted from the auth JWT
-
Description
Information about the user's identity and authentication status