Policy handbooks

Update a policy handbook

Replaces a policy handbook's level, title, description, text and enabled flag. Every field in the body is written, so send the current value for anything you are not changing.

PUT
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

Body

application/json

levelenum<string>

Which rung to attach the handbook at.

GlobalPortfolioPropertyUnitLease
levelIdstring

The portfolio, property, unit or lease to attach it to. Leave it out when level is Global.

titlestringrequired

Name of the handbook, up to 255 characters.

descriptionstring

What the handbook covers, up to 2000 characters.

scriptstringrequired

The policy text, in plain text.

enabledboolean

Whether to apply the handbook to live chats.

default: true

Response

200 · The handbook after the change.

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.

Changing script means the indexed copy no longer matches the text. Call the reindex endpoint afterwards if the change needs to reach the AI immediately.