Export policy JSON to Excel
const url = 'https://localhost:10001/api/v1/policies/export';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":"example","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/policies/export \ --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": "example", "version": "example" }'Accepts structured policy JSON and returns a downloadable Excel (.xlsx) workbook
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Policy data
object
Rendered into the Controls sheet
object
Title/URL pairs in the sheet
object
Example generated
{ "controls": [ { "citations": [ { "title": "example", "url": "example" } ], "controlCode": "example", "description": "example", "title": "example" } ], "description": "example", "iconUrl": "example", "name": "example", "type": "example", "version": "example"}Responses
Section titled “ Responses ”Excel file
Bad request - Invalid policy JSON
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
INVALID_REQUESTExample
unexpected end of JSON inputExample
Invalid request bodyUnauthorized - Authentication required
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
INVALID_REQUESTExample
unexpected end of JSON inputExample
Invalid request bodyForbidden - Insufficient permissions
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
INVALID_REQUESTExample
unexpected end of JSON inputExample
Invalid request bodyInternal server error
Error body for the policy conversion, policy export, and event ingestion endpoints, carrying a machine-readable code
object
Example
INVALID_REQUESTExample
unexpected end of JSON inputExample
Invalid request body