Herald
OpenapiLegal

Publish a new per-realm custom agreement version.

Admin — requires first-party Bearer + `settings.manage` (realm pinned by the session token). Unknown `agreementType` → 400; non-object/empty `content` → 400 (also enforced in the service). On success the service records an `agreement.published` audit event and returns the new version.

PUT
/api/legal/admin/agreements/{agreementType}

Admin — requires first-party Bearer + settings.manage (realm pinned by the session token). Unknown agreementType → 400; non-object/empty content → 400 (also enforced in the service). On success the service records an agreement.published audit event and returns the new version.

Path Parameters

agreementType*string

Agreement type: terms_of_service | privacy_policy

Request Body

application/json
  1. body

PUT publish-custom request body. content is a locale → body map and must contain at least one entry (validated by the service layer).

content*unknown
external_url?string|null
mode?null|
version_label?string|null

Response Body

Newly published version

application/json
  1. response

PUT publish / DELETE revert response: the newly published version's stable identifiers. For revert this is a brand-new snapshot version (new version_id), so clients can assert the id changed to trigger user reconsent.

effective_at*string
Formatdate-time
external_url?string|null
mode*AgreementMode
Value in"full_text""link"
version_id*string
Formatuuid
version_no*integer
Formatint32
Example Request
curl -X PUT 'https://example.com/api/legal/admin/agreements/string' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": null
}'
Example Response
{
  "effective_at": "2019-08-24T14:15:22Z",
  "external_url": "string",
  "mode": "full_text",
  "version_id": "9e94c502-ca41-4342-a7f7-af96b444512c",
  "version_no": 0
}