Nuvelics documentation
APIAPI reference

Spend caps

Read and set your organization's spend caps, and resume paid work after a cap has stopped it.

GET
/api/tenant/v1/spend-caps

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Response Body

The org's spending caps, their current state, and the live spend in each window

application/json
  1. response
platform*
Example Request
curl -X GET 'https://api.nuvelics.com/api/tenant/v1/spend-caps'
Example Response
{  "platform": {    "dailyCapMicroUsd": 0,    "weeklyCapMicroUsd": 0,    "monthlyCapMicroUsd": 0,    "resumePolicy": "auto",    "state": {      "status": "running",      "trippedWindow": "day",      "resetsAt": "2019-08-24T14:15:22Z"    },    "windows": {      "day": {        "spentMicroUsd": 0,        "windowStartsAt": "2019-08-24T14:15:22Z",        "windowResetsAt": "2019-08-24T14:15:22Z"      },      "week": {        "spentMicroUsd": 0,        "windowStartsAt": "2019-08-24T14:15:22Z",        "windowResetsAt": "2019-08-24T14:15:22Z"      },      "month": {        "spentMicroUsd": 0,        "windowStartsAt": "2019-08-24T14:15:22Z",        "windowResetsAt": "2019-08-24T14:15:22Z"      }    }  }}
PUT
/api/tenant/v1/spend-caps

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Request Body

application/json
  1. body
platform*

Response Body

Caps saved and applied; carries the state the save produced

application/json
  1. response
platform*
Example Request
curl -X PUT 'https://api.nuvelics.com/api/tenant/v1/spend-caps' \  -H 'Content-Type: application/json' \  -d '{  "platform": {    "dailyCapMicroUsd": 0,    "weeklyCapMicroUsd": 0,    "monthlyCapMicroUsd": 0,    "resumePolicy": "auto"  }}'
Example Response
{  "platform": {    "dailyCapMicroUsd": 0,    "weeklyCapMicroUsd": 0,    "monthlyCapMicroUsd": 0,    "resumePolicy": "auto",    "state": {      "status": "running",      "trippedWindow": "day",      "resetsAt": "2019-08-24T14:15:22Z"    }  }}
POST
/api/tenant/v1/spend-caps/resume

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Response Body

Spending resumed (or already running)

application/json
  1. response
platform*
Example Request
curl -X POST 'https://api.nuvelics.com/api/tenant/v1/spend-caps/resume'
Example Response
{  "platform": {    "dailyCapMicroUsd": 0,    "weeklyCapMicroUsd": 0,    "monthlyCapMicroUsd": 0,    "resumePolicy": "auto",    "state": {      "status": "running",      "trippedWindow": "day",      "resetsAt": "2019-08-24T14:15:22Z"    }  }}

Report a problem with this page

On this page