MIGHTY DEVELOPERS
Get organization usage
GET /v1/mic/usage. MIC API request examples, required scopes and response schemas. Sandbox access requires an approved application.
Request access
Service access is reviewed before credentials are issued. Public documentation and the read-only demo do not grant private sandbox or production access.
GET /v1/mic/usage
Operation ID: getMicPublicUsage
Authenticate your application
After access approval, sandbox provisioning and license activation, create client credentials in your workspace. Keep MIGHTY_CLIENT_ID and MIGHTY_CLIENT_SECRET in your server environment. Exchange them for an access token with the required scope. This example uses a POSIX shell such as Bash.
curl --request POST "https://www.pradiota.com/sandbox/oauth/token" \ --user "$MIGHTY_CLIENT_ID:$MIGHTY_CLIENT_SECRET" \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'scope=mic.usage:read'
Set MIGHTY_ACCESS_TOKEN to the returned access_token. Send it as Authorization: Bearer and request a new token when it expires. MIC API access is not enabled yet; request sandbox access to prepare your integration.
Send a request
After sandbox access is approved, use an access token for your application. Set MIGHTY_ACCESS_TOKEN. After MIC access is approved, open the MIC console at /developers/console/mic, choose the application and credential, then Load current workspace. Use the returned micws_ ID as MIC_WORKSPACE_ID and replace the other MIC variables with your workspace’s resource IDs. The example sends Bearer authentication and required query parameters; copying it does not send a request.
Required scope: mic.usage:read. Additional permissions: none.
curl --request GET "https://www.pradiota.com/sandbox/v1/mic/usage" \
--header "Authorization: Bearer ${MIGHTY_ACCESS_TOKEN}" \
--header 'Accept: application/json' \
--get \
--data-urlencode "workspaceId=${MIC_WORKSPACE_ID}" \
--data-urlencode 'window=DAY'Query & header schemas
{
"query": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*(?![\\s\\S])",
"x-forbidden-substrings": [
".."
]
},
"window": {
"type": "string",
"enum": [
"DAY",
"MONTH",
"ENTITLEMENT"
]
}
},
"required": [
"workspaceId",
"window"
],
"additionalProperties": false
},
"headers": {}
}Success response schema
HTTP 200
{
"$ref": "#/$defs/UsageSummaryEnvelope",
"$defs": {
"UsageSummaryEnvelope": {
"type": "object",
"properties": {
"data": {
"$ref": "#/$defs/UsageSummary"
},
"meta": {
"type": "object",
"properties": {
"requestId": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
},
"required": [
"requestId"
],
"additionalProperties": false
}
},
"required": [
"data",
"meta"
],
"additionalProperties": false
},
"UsageSummary": {
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*(?![\\s\\S])",
"x-forbidden-substrings": [
".."
]
},
"environment": {
"type": "string",
"const": "SANDBOX"
},
"window": {
"type": "string",
"enum": [
"DAY",
"ENTITLEMENT"
]
},
"observedAt": {
"type": "string",
"format": "date-time",
"maxLength": 40
},
"quotaScope": {
"type": "string",
"const": "ORGANIZATION_SHARED"
},
"entitlementState": {
"type": "string",
"const": "ACTIVE"
},
"resetTimezone": {
"type": "string",
"enum": [
"UTC",
"Asia/Kolkata"
]
},
"activatedAt": {
"type": "string",
"format": "date-time",
"maxLength": 40
},
"expiresAt": {
"type": "string",
"format": "date-time",
"maxLength": 40
},
"buckets": {
"type": "array",
"minItems": 0,
"maxItems": 32,
"items": {
"$ref": "#/$defs/UsageBucket"
}
}
},
"required": [
"workspaceId",
"environment",
"window",
"observedAt",
"quotaScope",
"entitlementState",
"resetTimezone",
"activatedAt",
"expiresAt",
"buckets"
],
"additionalProperties": false
},
"UsageBucket": {
"type": "object",
"properties": {
"metric": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"pattern": "^[A-Z][A-Z0-9_]{0,79}(?![\\s\\S])"
},
"unit": {
"oneOf": [
{
"type": "string",
"enum": [
"COUNT",
"BYTE"
]
},
{
"type": "null"
}
]
},
"unitDefinitionState": {
"type": "string",
"enum": [
"DEFINED",
"NOT_CONFIGURED"
]
},
"quotaScope": {
"type": "string",
"const": "ORGANIZATION_SHARED"
},
"windowStart": {
"type": "string",
"format": "date-time",
"maxLength": 40
},
"windowEnd": {
"type": "string",
"format": "date-time",
"maxLength": 40
},
"granted": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]{0,18})(?![\\s\\S])",
"maxLength": 19,
"x-maximum": "9223372036854775807"
},
"used": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]{0,18})(?![\\s\\S])",
"maxLength": 19,
"x-maximum": "9223372036854775807"
},
"reserved": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]{0,18})(?![\\s\\S])",
"maxLength": 19,
"x-maximum": "9223372036854775807"
},
"remaining": {
"type": "string",
"pattern": "^(?:0|[1-9][0-9]{0,18})(?![\\s\\S])",
"maxLength": 19,
"x-maximum": "9223372036854775807"
},
"resetAt": {
"oneOf": [
{
"type": "string",
"format": "date-time",
"maxLength": 40
},
{
"type": "null"
}
]
},
"expiresAt": {
"type": "string",
"format": "date-time",
"maxLength": 40
}
},
"required": [
"metric",
"unit",
"unitDefinitionState",
"quotaScope",
"windowStart",
"windowEnd",
"granted",
"used",
"reserved",
"remaining",
"resetAt",
"expiresAt"
],
"additionalProperties": false
}
}
}Use cURL or install the MIC SDK and follow the language examples.
Browse MIC methods