Skip to content

Watch / Set limit / Explain / Ignore / Intervene

POST
/v1/intel/meters/{id}/action
curl --request POST \
--url https://api.trustysweep.com/v1/intel/meters/example/action \
--header 'Content-Type: application/json' \
--cookie sweep_session=<sweep_session> \
--data '{ "action": "watch", "limit_cents": 1 }'
id
required
string
/^mtr_[0-9A-HJKMNP-TV-Z]{26}$/
Idempotency-Key
string
<= 255 characters

Unique key per logical operation. Same key + same body within 24h replays the original response with Idempotent-Replayed: true; same key + different body → 409 idempotency_key_reused.

Media typeapplication/json
object
action
required
string
Allowed values: watch set_limit explain ignore intervene
limit_cents
integer

OK

Media typeapplication/json
object
meter
required
object
id
required

Prefixed ULID (mtr_…)

string
/^mtr_[0-9A-HJKMNP-TV-Z]{26}$/
service
required
string
serviceDomain
One of:
string
basePriceCents
One of:
integer
billingPeriod
required
string
Allowed values: weekly monthly quarterly annual usage one_time unknown
includedAllowance
One of:
string
meterUnit
One of:
string
meterRate
One of:
string
observedUsage
One of:
string
observedOverageCents
One of:
integer
currentPeriodCostCents
One of:
integer
projectedPeriodCostCents
One of:
integer
previousPeriodCostCents
One of:
integer
changeCents
One of:
integer
changePercent
One of:
number
primaryDriver
One of:
string
concentration
One of:
string
nextThresholdCents
One of:
integer
projectedThresholdAt
One of:
string format: date-time
trapType
required
string
Allowed values: metered_overage teaser_expiration renewal_jump free_credit_exhaustion seat_growth auto_upgrade surcharge variable_bill unknown
action
required
string
Allowed values: watch set_limit explain ignore intervene
interventionCapable
required
boolean
evidenceLevel
required

CONFIRMED = direct platform/API/settlement evidence; DETECTED = reliable statement/email/invoice evidence; ESTIMATED = calculation from observable rates or incomplete evidence. An estimate is never presented as confirmed.

string
Allowed values: CONFIRMED DETECTED ESTIMATED
confidence
required
number
evidence
required
Array<object>
object
kind
required
string
Allowed values: email statement api invoice contract receipt user derived
ref
required
string
sourceId
string
observedAt
required
string format: date-time
excerpt
string
<= 300 characters
lastUpdated
required
string format: date-time
explanation
One of:
string
plan_id
One of:

Prefixed ULID (pln_…)

string
/^pln_[0-9A-HJKMNP-TV-Z]{26}$/
metered
required

True when the action consumed an intelligence operation.

boolean
Example
{
"meter": {
"id": "mtr_01J8Z3K9M2Q4R6S8T0V2W4X6Y8",
"billingPeriod": "weekly",
"trapType": "metered_overage",
"action": "watch",
"evidenceLevel": "CONFIRMED",
"evidence": [
{
"kind": "email"
}
]
},
"plan_id": "pln_01J8Z3K9M2Q4R6S8T0V2W4X6Y8"
}
RateLimit-Limit
integer

Requests allowed in the current window.

RateLimit-Remaining
integer

Requests remaining in the current window.

RateLimit-Reset
integer

Seconds until the window resets.

Validation failed

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}

Unauthenticated

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}

Forbidden / action denied / step-up required

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}

Not found

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}

Conflict (state, stale plan, idempotency key reuse)

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}

Rate limited

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}
Retry-After
integer

Seconds to wait before retrying.

RateLimit-Limit
integer

Requests allowed in the current window.

RateLimit-Remaining
integer

Requests remaining in the current window.

RateLimit-Reset
integer

Seconds until the window resets.

Internal error

Media typeapplication/problem+json

RFC 9457 problem details.

object
type
required
title
required
string
status
required
integer
detail
string
code
required

Machine-readable error code from errors.json

string
request_id
required
string
errors
Array<object>
object
path
required
string
message
required
string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"path": "example",
"message": "example"
}
]
}