Home / Docs / API reference

/api/me/spending

GET /api/me/spending

Authentication signed-in session; roles: admin, cfo_viewer, fde, hr_ops, manager, member, operator

Response

FieldTypeDescription
wallets requiredarray of object
wallets[].id requiredstringThe answer's id.
wallets[].tenantIdstring
wallets[].ownerKindstring
wallets[].ownerIdstring
wallets[].kind requiredstring
wallets[].balanceMu requiredinteger
wallets[].heldMu requiredinteger
wallets[].currencyHintstring or null
wallets[].expiresAtstring or null
wallets[].spendPriorityinteger
wallets[].sourceKindstring or null
wallets[].sourceRefstring or null
wallets[].periodStartstring or null
wallets[].periodEndstring or null
wallets[].rolloverCapMuinteger or null
wallets[].createdAtstring
wallets[].closedAtstring or null
caps requiredarray of object
caps[].idstringThe answer's id.
caps[].periodstring
caps[].tierobject
caps[].botKeyobject
caps[].limitMuinteger or null
caps[].perRequestMuinteger or null
caps[].reservedMuinteger or null
caps[].spentMuinteger
caps[].periodStartedAtstring or null
caps[].runsOutAtstring or null
pause requiredobject or null
pause.pausedAtstring
pause.pausedBystring
pause.notestring or null
topUpPolicyobject or null
topUpPolicy.idstringThe answer's id.
topUpPolicy.amountMuinteger
topUpPolicy.triggerBalanceMuinteger
topUpPolicy.monthlyCeilingMuinteger or null
topUpIntents requiredarray of object
topUpIntents[].idstringThe answer's id.
topUpIntents[].amountMuinteger
topUpIntents[].reasonstring
topUpIntents[].statestring
topUpIntents[].periodStartstring
topUpIntents[].confirmedAtstring or null
topUpIntents[].createdAtstring
skippedRuns requiredarray of object
skippedRuns[].idstringThe answer's id.
skippedRuns[].reasonstring
skippedRuns[].detailstring or null
skippedRuns[].createdAtstring
trial requiredobject or null
trial.balanceMuinteger
trial.expiresAtstring or null
trial.daysLeftnumber
trial.freeLaneCallsThisPeriodinteger
Example response (shape)
{
  "wallets": [
    {
      "id": "<id>",
      "tenantId": "<tenantId>",
      "ownerKind": "<ownerKind>",
      "ownerId": "<ownerId>",
      "kind": "<kind>",
      "balanceMu": 0,
      "heldMu": 0,
      "currencyHint": "<currencyHint>",
      "expiresAt": "<expiresAt>",
      "spendPriority": 0,
      "sourceKind": "<sourceKind>",
      "sourceRef": "<sourceRef>",
      "periodStart": "<periodStart>",
      "periodEnd": "<periodEnd>",
      "rolloverCapMu": "<rolloverCapMu>",
      "createdAt": "<createdAt>",
      "closedAt": "<closedAt>"
    }
  ],
  "caps": [
    {
      "id": "<id>",
      "period": "<period>",
      "tier": "<tier>",
      "botKey": "<botKey>",
      "limitMu": "<limitMu>",
      "perRequestMu": "<perRequestMu>",
      "reservedMu": "<reservedMu>",
      "spentMu": 0,
      "periodStartedAt": "<periodStartedAt>",
      "runsOutAt": "<runsOutAt>"
    }
  ],
  "pause": {
    "pausedAt": "<pausedAt>",
    "pausedBy": "<pausedBy>",
    "note": "<note>"
  },
  "topUpPolicy": {
    "id": "<id>",
    "amountMu": 0,
    "triggerBalanceMu": 0,
    "monthlyCeilingMu": "<monthlyCeilingMu>"
  },
  "topUpIntents": [
    {
      "id": "<id>",
      "amountMu": 0,
      "reason": "<reason>",
      "state": "<state>",
      "periodStart": "<periodStart>",
      "confirmedAt": "<confirmedAt>",
      "createdAt": "<createdAt>"
    }
  ],
  "skippedRuns": [
    {
      "id": "<id>",
      "reason": "<reason>",
      "detail": "<detail>",
      "createdAt": "<createdAt>"
    }
  ],
  "trial": {
    "balanceMu": 0,
    "expiresAt": "<expiresAt>",
    "daysLeft": 0,
    "freeLaneCallsThisPeriod": 0
  }
}

Common errors

  • 401 not signed in

Every error has the same JSON shape; see Errors and Limits.

Full schema (JSON)

Response schema

{
  "description": "A session credential. With no personal workspace the page is empty (topUpPolicy is then absent).",
  "type": "object",
  "required": [
    "wallets",
    "caps",
    "pause",
    "topUpIntents",
    "skippedRuns",
    "trial"
  ],
  "properties": {
    "wallets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "balanceMu",
          "heldMu"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "ownerKind": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "balanceMu": {
            "type": "integer"
          },
          "heldMu": {
            "type": "integer"
          },
          "currencyHint": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "spendPriority": {
            "type": "integer"
          },
          "sourceKind": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "periodStart": {
            "type": [
              "string",
              "null"
            ]
          },
          "periodEnd": {
            "type": [
              "string",
              "null"
            ]
          },
          "rolloverCapMu": {
            "type": [
              "integer",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "closedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "caps": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "tier": {},
          "botKey": {},
          "limitMu": {
            "type": [
              "integer",
              "null"
            ]
          },
          "perRequestMu": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reservedMu": {
            "type": [
              "integer",
              "null"
            ]
          },
          "spentMu": {
            "type": "integer"
          },
          "periodStartedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "runsOutAt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "pause": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "pausedAt": {
          "type": "string"
        },
        "pausedBy": {
          "type": "string"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "topUpPolicy": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "amountMu": {
          "type": "integer"
        },
        "triggerBalanceMu": {
          "type": "integer"
        },
        "monthlyCeilingMu": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "topUpIntents": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "amountMu": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "confirmedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        }
      }
    },
    "skippedRuns": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        }
      }
    },
    "trial": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "balanceMu": {
          "type": "integer"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "daysLeft": {
          "type": "number"
        },
        "freeLaneCallsThisPeriod": {
          "type": "integer"
        }
      }
    }
  }
}