Policy handbooks

Get a policy handbook

Fetches one policy handbook, including its full policy text and why indexing failed if it did.

GET
https://api.portal.magicdoor.com/company-app/policy-handbooks/{policyHandbookId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

policyHandbookIdstringrequired

The policy handbook to act on. A Snowflake id sent as a decimal string.

example: 1830472847398422022

Response

200 · The handbook.

idstring

The handbook. A Snowflake id sent as a decimal string.

levelenum<string>

Which rung of the hierarchy the handbook applies at. PascalCase, not camelCase.

GlobalPortfolioPropertyUnitLease
levelIdstring

The portfolio, property, unit or lease the handbook is attached to. Absent when level is Global.

titlestring

Name of the handbook.

descriptionstring

What the handbook covers. Absent when none was set.

scriptstring

The policy text itself, in plain text. This is what the AI is given.

indexStatusenum<string>

How far the handbook has got through being indexed for AI search. PascalCase, not camelCase.

PendingProcessingIndexedFailed
indexErrorstring

Why indexing failed. Present when indexStatus is Failed.

indexedAtstring · date-time

When the handbook was last indexed, in the company's timezone. Absent when it never has been.

enabledboolean

Whether the handbook is applied to live chats.

createdstring · date-time

When the handbook was created, in the company's timezone.

updatedstring · date-time

When it was last changed, in the company's timezone.

401 · The access token is missing, expired, or not valid for this company.

404 · No policy handbook with that id exists in the caller's company.

`level` and `indexStatus` are PascalCase

Most enums in this API come back camelCased. These two do not: they are turned into strings by hand, so you get Property and Indexed, not property and indexed. The level query filter is read the same way and is case-sensitive.