Skip to content

Admin API: Usage

Operations that get the current usage and limits of a space and of the whole environment. Common rules (authentication, error format, dates and times) are in the Admin API reference.

In the examples, replace <hostname> with the hostname of your environment and <access token> with an access token that starts with hako_pat_. Replace other values in angle brackets, such as <slug>, with the values described in each operation’s parameter table.

Operation Method and path
Space usage GET /admin/api/spaces/{slug}/usage
Usage of the whole environment GET /admin/api/usage

The usage of the space, and the limits set by the operator (max; null means no limit). Any member can view it.

GET /admin/api/spaces/{slug}/usage
  • Login: required (session or access token)

Parameters:

Name In Type Required Constraints Description
slug path string Yes Slug of the space

Responses:

Status Body Reason
200 SpaceUsageView (application/json)
401 Error (application/json) Not logged in, or the access token is wrong, expired, or revoked
404 Error (application/json) Not found. A space you are not a member of also returns 404

If the request fails, you get a 4xx or 5xx status and a JSON body with message. The meaning of each status is in the list of errors.

Example:

ターミナルウィンドウ
curl "https://<hostname>.hakocms.net/admin/api/spaces/<slug>/usage" \
-H "Authorization: Bearer <access token>"

The usage and limits of the whole environment. Environment administrators only.

GET /admin/api/usage
  • Login: required (session or access token)

Responses:

Status Body Reason
200 InstanceUsageView (application/json)
401 Error (application/json) Not logged in, or the access token is wrong, expired, or revoked
403 Error (application/json) Insufficient permission (including writes with a read-only access token and writes from another origin with a session)

If the request fails, you get a 4xx or 5xx status and a JSON body with message. The meaning of each status is in the list of errors.

Example:

ターミナルウィンドウ
curl "https://<hostname>.hakocms.net/admin/api/usage" \
-H "Authorization: Bearer <access token>"