Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Usage

Access Account Usage

get
/api/usage

Report usage

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
accountIdstringRequired

Harness Account ID

Example: abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$
timestampinteger · int64Required

Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)

Example: 1670427991307
intervalinteger · int64Optional

Usage calculation interval (in days)

Default: 30Example: 30
Responses
200

OK response.

application/json

Usage Result

accountIdentifierstringRequired

Account identifier

Example: BdsgiWzwT7CQFeJl9XkQ3A
modulestringRequired

Harness module

Example: STO
timestampinteger · int64Required

Timestamp

Example: 1670427991307
get/api/usage
GET /gateway/sto/api/usage?accountId=abcdef1234567890ghijkl&timestamp=1670427991307 HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "accountIdentifier": "BdsgiWzwT7CQFeJl9XkQ3A",
  "activeDevelopers": {
    "count": 0,
    "displayName": "Last 30 Days",
    "references": [
      "Vitae dolorum ullam atque aut cum qui.",
      "Dolore tempore incidunt expedita voluptatem excepturi.",
      "Eos culpa."
    ]
  },
  "activeScans": {
    "count": 0,
    "displayName": "Last 30 Days",
    "references": [
      "Vitae dolorum ullam atque aut cum qui.",
      "Dolore tempore incidunt expedita voluptatem excepturi.",
      "Eos culpa."
    ]
  },
  "module": "STO",
  "timestamp": 1670427991307
}
get
/api/usage/all-accounts

Report usage for all accounts

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
timestampinteger · int64Required

Timestamp indicating the end of the usage interval (in milliseconds since Unix epoch)

Example: 1670427991307
intervalinteger · int64Optional

Usage calculation interval (in days)

Default: 30Example: 30
Responses
200

OK response.

application/json

All Accounts Usage Result

timestampinteger · int64Required

Timestamp

Example: 1670427991307
get/api/usage/all-accounts
GET /gateway/sto/api/usage/all-accounts?timestamp=1670427991307 HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "timestamp": 1670427991307,
  "usage": [
    {
      "accountId": "BdsgiWzwT7CQFeJl9XkQ3A",
      "developerCount": 25,
      "harnessCodeCount": 100,
      "harnessContainerCount": 50,
      "scanCount": 5000
    },
    {
      "accountId": "BdsgiWzwT7CQFeJl9XkQ3A",
      "developerCount": 25,
      "harnessCodeCount": 100,
      "harnessContainerCount": 50,
      "scanCount": 5000
    },
    {
      "accountId": "BdsgiWzwT7CQFeJl9XkQ3A",
      "developerCount": 25,
      "harnessCodeCount": 100,
      "harnessContainerCount": 50,
      "scanCount": 5000
    }
  ]
}

Last updated

Was this helpful?