Skip to content

Admin API reference

The Admin API is the API that the admin uses. With it, you can do what you can do in the admin from scripts and CI: manage content types, entries, API keys, members, webhooks, and more. This page has the rules common to all operations and the list of operations.

To show entries on your site, use the Content API, not the Admin API (Content API reference).

If you work from the command line, use hakocms-cli instead of calling the Admin API directly. It handles login, paging, and checks for you (What you can do with the CLI).

https://<hostname>.hakocms.net/admin/api

<hostname> is the hostname of your environment. It is the same as in the admin address https://<hostname>.hakocms.net/admin.

From scripts, send an access token with Authorization: Bearer.

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

Replace <access token> with an access token that starts with hako_pat_.

Item Details
How to create In the admin, click your name at the top right, then click [アクセストークン](Access tokens) to create one
Permissions It works with the same permissions as the person who created it
Scope [読み取りだけ](Read only) (GET only) or [すべて(あなたと同じ)](Everything (same as you))
Expiration Choose 30 days, 90 days, 1 year, or no expiration. The default is 90 days
Display Shown only once, when you create it
Operations it cannot do Creating access tokens and approving CLI logins. For both, log in to the admin

Access tokens are different from Content API keys (which start with hako_). You cannot call the Admin API with an API key.

When you call with a token that has an expiration, the Hako-Token-Expires-At response header contains the expiration. When you call with an expired or revoked token, you get 401 and invalid or expired access token.

  • Send the body as JSON with Content-Type: application/json. Without it, you get 415
  • JSON keys are camelCase
  • {slug} in a path is the space slug, and {endpoint} is the content type ID ([エンドポイント](Endpoint) in the admin)
  • Dates and times are returned in UTC as RFC 3339 (2026-10-08T03:22:22.076Z)

When a request fails, you get a 4xx or 5xx status and JSON in the following format.

{ "message": "slug already exists" }

When the input breaks the rules, the response also includes issues, a list of what is wrong and where.

{
"message": "fields.id: fieldId is reserved",
"issues": [{ "path": "fields.id", "message": "fieldId is reserved" }]
}

The meaning of each status and how to fix it are in the list of errors.

  • The Hako-Version response header contains the API version (currently 1)
  • Within the same version, operations and fields are only added. Operations and fields are not removed, and their names and meanings are not changed
  • Changes to the format are announced in the Changelog
  • Operations marked “Beta” are outside this promise. Their format may change even within the same version
Group Description Operations
Login and access tokens Operations to log in, log out, and get the logged-in user, and to create, list, and revoke access tokens. 9
Password resets An operation to send an email for setting a new password. 1
Password links Operations to check the contents of a link received by email and to set a password. 2
CLI login approval Operations to approve or deny a login from the CLI in the admin. 3
Users Operations to create, list, and delete the users of the environment. Only environment admins can use them. 5
Spaces Operations to create, get, and delete spaces. 4
Usage Operations to get the current usage and limits of a space and of the whole environment. 2
Content types Operations to create, change, and delete content types, and to update their schemas. 7
Type definition downloads Operations to get the OpenAPI, TypeScript types, GraphQL schema, and schema file generated from the content types of a space. 4
Entries Operations to create, change, publish, and delete entries the same way as in the admin, and to work with revision history. 11
Media Operations to upload, list, change, and delete media. 6
API keys Operations to issue API keys for the Content API, change their permissions, and revoke them. 5
Members Operations to list the members of a space, change their roles, and remove them. 4
Roles Operations to create, change, and delete the roles of a space. 5
Invitations Operations to invite people to a space, revoke invitations, and accept invitations. 5
Webhooks Operations to create, change, and delete webhooks, and to send tests, view delivery history, and resend. 8
Audit logs Operations to get the records of operations for a space and for the whole environment, and to export them as CSV. 4
Space exports Operations to export the contents of a space to a single file. 5
Space imports Operations to import an exported file as a new space. 13
Schema applies Operations to apply a schema file to an existing space. 5

The data shapes (types) are in Admin API types.