Skip to content

Admin API types

This page lists the data shapes (types) that appear in Admin API requests and responses, in order of name. The “Type” column on each operation page links here. Common rules are in the Admin API reference.

“or null” in the “Type” column means that the value can be null instead.

Result of accepting: the space you joined.

Name Type Required Constraints Description
space InvitationSpace Yes

A user’s access token. Used with the Admin API through Authorization: Bearer. The plaintext is not stored.

Name Type Required Constraints Description
createdAt date-time Yes
expiresAt date-time or null If null, it never expires
id string Yes
lastUsedAt date-time or null
name string Yes
scope TokenScope Yes
tokenPrefix string Yes The leading part used to tell tokens apart on screen (hako_pat_Ab3dE)
Name Type Required Constraints Description
expiresIn ExpiresIn or null
name string Yes
scope TokenScope or null

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
accessToken AccessToken Yes
token string Yes The plaintext token. Returned only in this response (the server keeps only the hash)
Name Type Required Constraints Description
actions RoleActions Yes
permissions Array of strings Yes

Usage and limit. If max is null, there is no limit.

Name Type Required Constraints Description
max integer or null 0 or more
used integer Yes 0 or more

An API key for the Content API. The plaintext key is not stored; only its hash is kept.

Name Type Required Constraints Description
createdAt date-time Yes
id string Yes
keyPrefix string Yes The leading part used to tell keys apart in the admin (example: hako_Ab3dE)
lastUsedAt date-time or null
name string Yes
permissions ApiKeyPermissions Yes
revokedAt date-time or null When the key was revoked. null if active
revokedBy UserRef or null
spaceId string Yes
Name Type Required Constraints Description
name string Yes Name for telling it apart
permissions ApiKeyPermissions or null
Name Type Required Constraints Description
apiKey ApiKeyView Yes
key string Yes The plaintext key. Returned only in this response (the server keeps only the hash)

Permissions of an API key. It has default permissions and individual permissions per content type. For a content type with individual permissions, the default permissions are not used; only the individual permissions apply.

Name Type Required Constraints Description
contentTypes object (values: MethodPermissions) Individual permissions per content type ID
default MethodPermissions
media MediaPermissions Media actions (if omitted on an existing key, none are allowed)

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
name string or null Name for telling it apart
permissions ApiKeyPermissions or null

ApiKey, object.

One audit log item (when reading, https://docs.hakocms.net/reference/admin-api/audit-logs)

Name Type Required Constraints Description
action string Yes
actor AuditLogActor Yes
details any Yes
id string Yes
ip string or null
occurredAt date-time Yes
target AuditLogTarget or null
userAgent string or null
Name Type Required Constraints Description
email string or null
id string or null
name string or null
tokenId string or null If the user acted with an access token, the ID of that token
type string Yes
Name Type Required Constraints Description
logs Array of AuditLog Yes
nextCursor string or null If there is more, the cursor for the next page
Name Type Required Constraints Description
id string Yes
label string or null
type string Yes

Features available on the login screen.

Name Type Required Constraints Description
passwordHelpUrl string or null Where to direct people who forgot their password or opened an unusable link (auth.password_help_url).
passwordReset boolean Yes Passwords can be reset by email (mail.smtp_url is set)
passwordResetLinkMinutes integer or null Expiry of the link sent by email (minutes). null if passwords cannot be reset

A content type. Corresponds to /api/v1/{endpoint} in the Content API.

Name Type Required Constraints Description
createdAt date-time Yes
endpoint string Yes
id string Yes
kind ContentTypeKind Yes
name string Yes
schema object Yes Schema ({"fields": [...]})
schemaVersion integer Yes Increases by 1 each time the schema changes. Used to detect concurrent edits
spaceId string Yes
updatedAt date-time Yes
Name Type Required Constraints Description
endpoint string Yes Endpoint (the content type ID, the name used in the Content API path, such as blog-posts)
kind ContentTypeKind Yes
name string Yes Display name
schema object Schema ({"fields": [...]}). You can see the current shape with content-types get

Kind of content type. A collection (collection) has multiple entries, and a single (single) has only one entry.

"collection" "single".

One item in the list: a content type and the number of its entries.

ContentType, object.

Name Type Required Constraints Description
endpoint string or null Endpoint (content type ID). Changing it also changes the path in the Content API
name string or null Display name
Name Type Required Constraints Description
fileName string Yes
size integer Yes 0 or more
Name Type Required Constraints Description
id string Yes
name string Yes

Invitation, object.

Name Type Required Constraints Description
data any Yes
Name Type Required Constraints Description
deliveries Array of DeliveryView Yes
nextCursor string or null

"pending" "succeeded" "failed".

Name Type Required Constraints Description
createdAt date-time Yes
event string Yes
id string Yes
responseCode integer or null 0 or more
status DeliveryStatus Yes
Name Type Required Constraints Description
attempts integer Yes 0 or more
createdAt date-time Yes
error string or null
event string Yes
finishedAt date-time or null
id string Yes
nextAttemptAt date-time or null
payload any Yes
responseBody string or null
responseCode integer or null 0 or more
status DeliveryStatus Yes

Content. It keeps the published revision and the latest draft separately.

Name Type Required Constraints Description
contentTypeId string Yes
createdAt date-time Yes
draft any Value of the latest draft. null if there is no draft
id string Yes
published any Value of the published revision. null if not published
publishedAt date-time or null When it was first published
reservation Reservation Yes Scheduled publishing and scheduled unpublishing
revisedAt date-time or null When it was last published
status EntryStatus Yes
updatedAt date-time Yes
Name Type Required Constraints Description
data any Yes
id string or null If omitted, an ID is assigned automatically
publish boolean If true, publish immediately. If false (the default), create as a draft
Name Type Required Constraints Description
entries Array of Entry Yes
limit integer Yes 0 or more
offset integer Yes 0 or more
totalCount integer Yes

Status of an entry. draft (a draft that has never been published), published (published), published_with_draft (published, with a draft being edited separately from the published revision), closed (unpublished)

"draft" "published" "published_with_draft" "closed".

Name Type Required Constraints Description
issues Array of objects Input validation errors (400). Location and details
message string Yes Details of the error (in English)

Expiry choices.

"30d" "90d" "1y" "never".

Name Type Required Constraints Description
mediaFiles boolean or null Whether to include media contents (included by default)

Usage and limits of the whole environment.

Name Type Required Constraints Description
mediaBytes Amount Yes Total size of media (bytes)
spaces Amount Yes Includes spaces being imported
users Amount Yes Users not deleted

An invitation.

Name Type Required Constraints Description
createdAt date-time Yes
email string Yes
expiresAt date-time Yes
id string Yes
invitedBy UserRef or null
role InvitationRole Yes
Name Type Required Constraints Description
email string Yes Email address of the person to invite
roleId string Yes ID of the role given on joining (see roles list)

If you send a property whose name is not listed here, you get 422.

Contents of the invitation (shown on the accept screen)

Name Type Required Constraints Description
accountExists boolean Yes Whether an account exists for the invitation’s email address
email string Yes
expiresAt date-time Yes
role InvitationRoleName Yes
space InvitationSpace Yes
Name Type Required Constraints Description
id string Yes
name string Yes
Name Type Required Constraints Description
name string Yes
Name Type Required Constraints Description
name string or null
slug string Yes
Name Type Required Constraints Description
spaces Array of LeftoverView Yes
Name Type Required Constraints Description
id string Yes
importStartedAt date-time Yes
name string Yes
slug string Yes
Name Type Required Constraints Description
media Array of MediaView Yes
nextCursor string or null
totalCount integer Yes 0 or more
Name Type Required Constraints Description
email string Yes
password string Yes
Name Type Required Constraints Description
clientName string Yes
code string Yes
createdAt date-time Yes
expiresAt date-time Yes
status string Yes pending approved denied

Returned right after login and by /me.

Name Type Required Constraints Description
spaces Array of Membership Yes
user User Yes

image if it is an image whose width and height could be read, otherwise file.

"image" "file".

Permissions per media action. Anything omitted is not allowed.

Name Type Required Constraints Description
create boolean default false Upload
delete boolean default false
read boolean default false List and get one
update boolean default false Change alt text and tags

If you send a property whose name is not listed here, you get 422.

Only alt text and tags can be changed. The file name and contents cannot be changed (unknown keys return 422)

Name Type Required Constraints Description
alt string or null Alt text
tags Array of strings or null Tags (an array of strings). If given, they replace the existing tags

If you send a property whose name is not listed here, you get 422.

Form for uploading media (multipart/form-data)

Name Type Required Constraints Description
alt string or null Alt text
file file Yes File
tags string or null Tags (a JSON array of strings, ["news","top"])

Media returned by the Admin API (https://docs.hakocms.net/reference/admin-api/media)

Name Type Required Constraints Description
alt string Yes
createdAt date-time Yes
createdBy string or null
fileName string Yes
height integer or null 0 or more
id string Yes
kind MediaKind Yes
mime string Yes
size integer Yes 0 or more
tags Array of strings Yes
updatedAt date-time Yes
url string Yes
width integer or null 0 or more

A member of a space.

Name Type Required Constraints Description
joinedAt date-time Yes
role RoleRef Yes
user MemberUser Yes
Name Type Required Constraints Description
roleId string Yes ID of the new role (see roles list)

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
email string Yes
id string Yes
name string Yes

Member, object.

The role a user has in a space.

Name Type Required Constraints Description
role string Yes
space Space Yes

Permissions per content action. Anything omitted is not allowed.

Name Type Required Constraints Description
create boolean default false Create entries (drafts)
delete boolean default false
preview boolean default false Preview (preview=true): also read drafts and entries that have never been published. Also requires read
publish boolean default false Publish, unpublish, and schedule
read boolean default false Read published entries
update boolean default false Change and discard drafts

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
name string Yes Display name of the account to create
password string Yes Password of the account to create

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
direct boolean Yes Whether to send directly to storage
headers object (values: string) Yes
method string Yes
url string Yes
Name Type Required Constraints Description
expiresAt date-time Yes
path string Yes Path in the admin (/admin/password/hpw_…). Append it to the server URL and give it to the user. Returned only in this response

Contents of the link (shown on the screen for setting a password)

Name Type Required Constraints Description
email string Yes
expiresAt date-time Yes
Name Type Required Constraints Description
validHours integer or null 0 or more How long the link is valid (hours, 1–168). 24 if omitted

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
email string Yes Email address of the account whose password was forgotten

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
pollToken string Yes

If you send a property whose name is not listed here, you get 422.

Result of a CLI login. The token and user are returned only when approved.

Name Type Required Constraints Description
accessToken AccessToken or null
status string Yes pending approved denied
token string or null The plaintext token. Returned only in this response
user User or null

"custom" "vercel" "netlify" "slack".

Name Type Required Constraints Description
data any If given, this value is saved and published. If omitted, the latest draft (or the published revision if there is no draft) is published again

The content’s schedule and the record of the last failed scheduled publishing.

Name Type Required Constraints Description
closeAt date-time or null
error string or null Reason the last scheduled publishing failed
failedAt date-time or null
publishAt date-time or null
Name Type Required Constraints Description
closeAt string or null Date and time for scheduled unpublishing (RFC 3339). null cancels it. If omitted, it does not change
publishAt string or null Date and time for scheduled publishing (RFC 3339). null cancels it. If omitted, it does not change

If you send a property whose name is not listed here, you get 422.

One revision (the value at each save). Includes the value.

RevisionSummary, object.

Who saved the revision.

Name Type Required Constraints Description
deleted boolean Yes The user is deleted, or the API key is revoked
id string or null
name string or null The user’s name or the API key’s name. null for an anonymized user
type string Yes “user” / “apiKey” / “system”
Name Type Required Constraints Description
nextCursor string or null If there is more, the cursor for the next page
revisions Array of RevisionSummary Yes

One item in a revision list (without the value)

Name Type Required Constraints Description
actor RevisionActor or null
createdAt date-time Yes
id string Yes
kind string Yes “draft” or “published”
number integer Yes Revision number per content item (starting from 1)
schemaVersion integer Yes

A role in a space.

Name Type Required Constraints Description
actions RoleActions Yes
builtin boolean Yes A built-in role (owner / admin / editor / viewer). Cannot be changed
id string Yes
memberCount integer Yes
name string Yes
permissions Array of strings Yes

A role’s actions per content type. For a content type with individual settings, the default is not used; only the individual settings apply.

Name Type Required Constraints Description
contentTypes object (values: array of strings) Actions per content type ID
default Array of strings

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
builtin boolean Yes
id string Yes
name string Yes
Name Type Required Constraints Description
actions RoleActions Actions on entries ({"default": ["read", ...], "contentTypes": {"<ID>": [...]}}). By default, nothing can be done on any of them
name string Yes Name of the role
permissions Array of strings Permissions on the whole space (an array of strings). Empty by default

If you send a property whose name is not listed here, you get 422.

Role, object.

One item of the schema change history.

Name Type Required Constraints Description
createdAt date-time Yes
createdBy string or null
version integer Yes
Name Type Required Constraints Description
password string Yes

If you send a property whose name is not listed here, you get 422.

A space. The boundary for schema, content, media, and members.

Name Type Required Constraints Description
createdAt date-time Yes
id string Yes
name string Yes
slug string Yes
Name Type Required Constraints Description
name string Yes Display name
slug string Yes Slug (the ID used in URLs)

Usage and limits of a space.

Name Type Required Constraints Description
apiKeys Amount Yes API keys not revoked
contentTypes Amount Yes
editsStoppedBy StoppedBy or null
entries Amount Yes Total across all content types
mediaBytes Amount Yes Total size of media (bytes)
mediaPublicUrl string or null Public URL of media. URLs under it count as your own media (used to decide which references can be removed). If null, only the shape of the path is checked
members Amount Yes Members and invitations not yet accepted
webhooks Amount Yes

The space and the logged-in user’s role (null for an environment administrator who is not a member)

Space, object.

Name Type Required Constraints Description
confirm boolean Also apply changes that current entries violate. false if omitted
prune boolean Delete content types that are removed (delete), together with their entries. false if omitted
Name Type Required Constraints Description
name string Yes Name of the space to create by importing
slug string Yes Slug of the space to create by importing
Name Type Required Constraints Description
clientName string Yes Used as the token’s name (the CLI sends the computer’s name)

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
code string Yes Characters shown in the terminal for the user to compare in the admin
expiresAt date-time Yes
interval integer Yes 0 or more Polling interval (seconds)
pollToken string Yes Value the CLI uses to receive the result. Returned only in this response

The limit that is the reason edits are stopped (the same shape as limit when a request is refused)

Name Type Required Constraints Description
max integer Yes 0 or more Limit (bytes)
name string Yes media_over_limit (the whole server) or space.media_over_limit (this space)
Name Type Required Constraints Description
md5 string or null Required when sending directly to storage (GCS checks content only with MD5)
sha256 string Yes
size integer Yes 0 or more
Name Type Required Constraints Description
path string Yes
reason string Yes

What an access token can do. The details are at https://docs.hakocms.net/reference/admin-api.

"read" "all".

"export" "import" "apply".

Name Type Required Constraints Description
transfers Array of TransferView Yes

Status. An import goes (for a multipart upload, uploading →) uploaded (the ZIP was received) → queued → running → succeeded / failed. An export starts from queued. A schema apply goes queued → running → planned (the diff is ready and waits for approval) → queued → running → succeeded / failed.

"uploading" "uploaded" "queued" "running" "planned" "succeeded" "failed".

Name Type Required Constraints Description
createdAt date-time Yes
createdBy CreatedBy or null
document any Import: summary of the contents of the received ZIP
downloadable boolean Yes Export: whether the ZIP can be downloaded (finished and not expired)
error string or null
expiresAt date-time or null
fileSize integer or null 0 or more
finishedAt date-time or null
id string Yes
kind TransferKind Yes
options any Yes Export: mediaFiles. Import: slug name (after it starts)
progress any
space string or null Import: slug of the created space (after it finishes)
status TransferStatus Yes
Name Type Required Constraints Description
confirm boolean Apply knowingly even when current entries violate the new schema
schema object Yes Schema ({"fields": [...]}). You can see the current shape with content-types get
schemaVersion integer Yes The version when you started editing. If someone has updated it since, 409 is returned
Name Type Required Constraints Description
contentType ContentType Yes
tightenings Array of TighteningView Yes Changes that current entries may violate. You are asked to fix violating entries the next time you save them
violationCount integer Yes 0 or more Number of entries that violate the new schema (when applied with confirm: true)
Name Type Required Constraints Description
direct boolean Yes Whether to send parts directly to storage
documentVersion integer Yes 0 or more Version of the space document that this server can read
maxBytes integer Yes 0 or more
partBytes integer Yes 0 or more

TransferView, object.

Name Type Required Constraints Description
contentType UsageContentType Yes
deletedField boolean Yes A value left in a soft-deleted field. It is not shown in the admin but is kept in case the field is restored
entryId string Yes
fieldPath string Yes
kind string Yes
Name Type Required Constraints Description
endpoint string Yes
id string Yes
name string Yes

A user of the admin.

Name Type Required Constraints Description
anonymizedAt date-time or null When the user was anonymized
createdAt date-time Yes
deletedAt date-time or null When the user was deleted. The user’s record is kept even after deletion
email string Yes
id string Yes
isAdmin boolean Yes Administrator of the whole environment. Can create spaces
locale string Yes
name string Yes
timezone string Yes
Name Type Required Constraints Description
email string Yes Email address (used to log in)
isAdmin boolean Make the user an environment administrator (can create spaces)
name string or null Display name. If omitted, the part of the email address before @
password string or null If omitted, a user without a password is created (the user sets one through a password link)

If you send a property whose name is not listed here, you get 422.

A person referenced from another record (who created it, who revoked it, and so on). The name is shown even if the user is deleted.

Name Type Required Constraints Description
deleted boolean Yes
id string Yes
name string or null null for an anonymized user

One item in the user list that environment administrators see.

Name Type Required Constraints Description
anonymizedAt date-time or null
createdAt date-time Yes
deletedAt date-time or null
email string Yes
id string Yes
isAdmin boolean Yes
name string Yes
spaces Array of strings Yes Slugs of the spaces the user belongs to
Name Type Required Constraints Description
contentTypeId string or null Send only events for this content type. If null, all content types and media
enabled boolean or null Whether to send. Default true
events Array of strings or null Array of event names to send. Default [“entry.published”, “entry.deleted”]
headers object (values: string) or null Custom headers (an object mapping names to values). Up to 20
name string Yes Name
preset string or null Payload format. Allowed values: custom, vercel, netlify, slack. Default custom
secret string or null Signing secret (8–256 characters)
url string Yes Destination (http:// or https://)

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
contentTypeId string or null Send only events for this content type. If null, all content types and media
enabled boolean or null Whether to send
events Array of strings or null Array of event names to send
headers object (values: string) or null Custom headers (an object mapping names to values). Up to 20
name string or null Name
preset string or null Payload format. Allowed values: custom, vercel, netlify, slack
secret string or null Signing secret (8–256 characters). Send null to remove the secret
url string or null Destination (http:// or https://)

If you send a property whose name is not listed here, you get 422.

Name Type Required Constraints Description
contentTypeId string or null
createdAt date-time Yes
enabled boolean Yes
events Array of strings Yes
hasSecret boolean Yes The secret itself is not returned
headers object (values: string) Yes
id string Yes
lastDelivery DeliverySummary or null
manageable boolean Yes Whether you can change this webhook (whether your role has permission to read what it sends)
name string Yes
preset Preset Yes
updatedAt date-time Yes
url string Yes