Skip to main content
POST
/
usages
Record usage
curl --request POST \
  --url https://api.piriod.com/usages/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-simple-workspace: <x-simple-workspace>' \
  --data '
{
  "subscription_line": 123,
  "date_time": "2023-11-07T05:31:56Z",
  "quantity": 123
}
'
{
  "subscription_line": 123,
  "date_time": "2023-11-07T05:31:56Z",
  "quantity": 123,
  "id": 123,
  "creation_scheme": "api",
  "created": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://piriod-d406ac55.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use header Authorization: Token <api_token>. API tokens are obtained from the Piriod dashboard.

Headers

x-simple-workspace
string
required

Workspace (account) identifier. Required for every request.

x-piriod-test-mode
boolean
default:false

Whether to operate against test-mode data. Defaults to false.

Body

application/json

A usage record posted against a metered subscription line. The line's plan must have usage_scheme=metered.

subscription_line
integer
required

Subscription line ID this usage belongs to.

date_time
string<date-time>
required

Timestamp the usage was recorded for.

quantity
number
required

Response

Usage recorded.

A usage record posted against a metered subscription line. The line's plan must have usage_scheme=metered.

subscription_line
integer
required

Subscription line ID this usage belongs to.

date_time
string<date-time>
required

Timestamp the usage was recorded for.

quantity
number
required
id
integer
read-only
creation_scheme
enum<string>
read-only
Available options:
api,
file,
panel
created
string<date-time>
read-only