Create policy
const url = 'https://localhost:10001/api/v1/organizations/example/policies';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"controls":[{"citations":[{"title":"example","url":"example"}],"controlCode":"example","description":"example","title":"example"}],"description":"example","iconUrl":"example","name":"example","type":"Risk Management","version":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:10001/api/v1/organizations/example/policies \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "controls": [ { "citations": [ { "title": "example", "url": "example" } ], "controlCode": "example", "description": "example", "title": "example" } ], "description": "example", "iconUrl": "example", "name": "example", "type": "Risk Management", "version": "example" }'Create a new policy within an organization and return the persisted record
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Organization ID or UUID (urn:uuid optional)
Request Body
Section titled “Request Body ”Policy object
object
At least one control is required
object
object
Alphanumeric, . and -; upper-cased
SemVer with no leading “v”, e.g. 1.2.3
Responses
Section titled “ Responses ”Created policy
A reusable template of controls in the organization’s library, applied to projects rather than used directly
object
Assigned by the integrity service at creation
Present on read, ignored on update
A single requirement within a policy template, identified by its control code
object
Assigned by the integrity service at creation
object
Alphanumeric, . and -; upper-cased
Assigned from the parent policy
Taken from the path on create
Derived from name
See PolicyType for values
Example
{ "type": "Risk Management"}Bad request - Invalid organization ID or request body
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}Unauthorized - Authentication required
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}Forbidden - No organization access or insufficient permissions
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}Organization not found
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}Name, version, URL, or content already taken in this organization
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}Internal server error
Error body returned by the governance endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Invalid request body"}