Retrieve a published policy
const url = 'http://api.disclosebot.localdev:3000/v1/p/policies/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://api.disclosebot.localdev:3000/v1/p/policies/exampleUnauthenticated. The payload the policy embed renders (the hosted policy page inlines the same document). An unpublished policy is not found. While paid plans are on sale, a plan that does not include embeds gets the upgrade_required error; the embed then shows a card linking to the hosted page (public_url in the error meta).
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Policy id or shortcode
Responses
Section titled “ Responses ”Successful
object
object
object
Rendered, sanitized HTML of the policy
The hosted policy page
Whether the widget shows the “Powered by” mark; false only when the plan includes white label
object
object
object
object
object
Example
{ "data": { "type": "policy" }, "included": [ { "type": "organization" } ]}The plan does not include embeds
object
object
object
The entitlement feature key, e.g. automation
The lowest-priced plan that includes the feature
Public reads only: the organization the refused document belongs to
Public reads only: the hosted page the embed links to instead
Example
{ "errors": [ { "title": "Upgrade required", "code": "upgrade_required", "status": "403" } ]}Not published, or unknown