curl --request GET \
--url http://localhost:3333/v1/policies \
--header 'X-API-Key: <api-key>'{
"data": [
{
"id": "pol_abc123def456",
"name": "Data Privacy Policy",
"description": "This policy outlines how we handle and protect personal data",
"status": "draft",
"content": [
{
"type": "paragraph",
"attrs": {
"textAlign": null
},
"content": [
{
"type": "text",
"text": "This policy outlines our commitment to protecting personal data."
}
]
}
],
"frequency": "yearly",
"department": "IT",
"isRequiredToSign": true,
"signedBy": [],
"reviewDate": "2024-12-31T00:00:00.000Z",
"isArchived": false,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T00:00:00.000Z",
"lastArchivedAt": null,
"lastPublishedAt": "2024-01-10T00:00:00.000Z",
"organizationId": "org_abc123def456",
"assigneeId": "usr_abc123def456",
"approverId": "usr_xyz789abc123",
"policyTemplateId": null
}
],
"authType": "session",
"authenticatedUser": {
"id": "usr_abc123def456",
"email": "[email protected]"
}
}Returns all policies for the authenticated organization. Supports both API key authentication (X-API-Key header) and session authentication (cookies + X-Organization-Id header).
curl --request GET \
--url http://localhost:3333/v1/policies \
--header 'X-API-Key: <api-key>'{
"data": [
{
"id": "pol_abc123def456",
"name": "Data Privacy Policy",
"description": "This policy outlines how we handle and protect personal data",
"status": "draft",
"content": [
{
"type": "paragraph",
"attrs": {
"textAlign": null
},
"content": [
{
"type": "text",
"text": "This policy outlines our commitment to protecting personal data."
}
]
}
],
"frequency": "yearly",
"department": "IT",
"isRequiredToSign": true,
"signedBy": [],
"reviewDate": "2024-12-31T00:00:00.000Z",
"isArchived": false,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T00:00:00.000Z",
"lastArchivedAt": null,
"lastPublishedAt": "2024-01-10T00:00:00.000Z",
"organizationId": "org_abc123def456",
"assigneeId": "usr_abc123def456",
"approverId": "usr_xyz789abc123",
"policyTemplateId": null
}
],
"authType": "session",
"authenticatedUser": {
"id": "usr_abc123def456",
"email": "[email protected]"
}
}API key for authentication
Organization ID (required for session auth, optional for API key auth)
Policies retrieved successfully
Was this page helpful?