Skip to content
API console (try a request with your own key)Get early access

List the workspace's credit history

GET
/v1/credits/history
#!/usr/bin/env bash
set -euo pipefail
API=https://api.speccapture.com
AUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
page=$(curl -sS --fail-with-body "$API/v1/credits/history?limit=20" \
-H "$AUTH") || { echo "$page" >&2; exit 1; }
jq -r '.data[] as $entry | "\($entry.occurredAt) \($entry.type) of \($entry.credits) credits: \($entry.availableChange) available, \($entry.heldChange) held"' <<<"$page"
if [[ "$(jq -r '.nextCursor' <<<"$page")" != null ]]; then
jq -r '"Older entries: send cursor=\(.nextCursor)"' <<<"$page"
fi

Every change to the workspace’s credits, newest first: each grant (grantKind trial, plan, pack or addedBySpecCapture, with when it expires and what of it remains), each job’s reservation, each sheet’s spend, each refund, and each expiry of credits left unspent. Each entry says how many credits it moved and what it did to the credits available and held (availableChange, heldChange), so the whole history adds up to GET /v1/account’s credits; a job’s entries name the job, its file and the sheet. Page with limit and cursor (the previous page’s nextCursor), narrow with createdAfter and createdBefore (when an entry happened) and type.

limit
integer format: int32

How many items the page holds: 1 to 200, 50 when left out.

cursor
string

The previous page’s nextCursor, exactly as it came: the list continues just after that page’s last item, so items made or removed meanwhile never shift a page. Leave it out for the first page.

createdAfter
string format: date-time

Only items that happened strictly after this date and time (ISO 8601, such as 2026-10-14T09:30:00Z; without an offset it is UTC).

createdBefore
string format: date-time

Only items that happened strictly before this date and time (ISO 8601, such as 2026-10-14T09:30:00Z; without an offset it is UTC).

type
Allowed values: grant reservation spend refund expiry takenBack

Only entries of this type.

OK

Media typeapplication/json
object
data
required
Array<object>
object
entryId
required
integer format: int64
type
required
Allowed values: grant reservation spend refund expiry takenBack
credits
required
integer format: int32
availableChange
required
integer format: int32
heldChange
required
integer format: int32
occurredAt
required
string format: date-time
grantKind
required
One of:
null
expiresAt
required
null | string format: date-time
remaining
required
null | integer format: int32
jobId
required
null | string format: uuid
fileName
required
null | string
sheetNumber
required
null | integer format: int32
hasMore
required
boolean
nextCursor
required
null | string

Bad Request: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type

A link to the code’s entry in the docs.

null | string
title
null | string
status
null | integer format: int32
detail
null | string
instance
null | string
code

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId

This request’s trace: quote it when asking for help.

string