Managing Policies and Notices

The Policy & Notice Management APIs are used to retrieve policies and notices that have been created within your account in order to obtain key details on the Active version of a policy on a particular date and view all previous versions of a given policy.

Retrieving a list of all policies

The GET /v2/privacynotices endpoint can be used to obtain a paged list of all privacy notices in your account.

The available parameters for this endpoint are size and page. The size query parameter represents the number of policies that will be displayed on a single page. The page query parameter represents the page number of the page that you want to display. The first page will have a page parameter of 0.

Note: If no value is defined in the size parameter, the value will default to 20 policies per page. In addition, the value of the size parameter cannot exceed 50.

Example Request:

GET https://trial.onetrust.com/api/privacynotice/v2/privacynotices

Response Body:

{
    "content": [
        {
            "id": "f0e9f2c7-15be-4761-9c03-c2f970a5bef6",
            "createdDate": "2021-02-19T13:55:58.017",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "bb7f9c39-fb5f-4bbd-abf8-1f347a0d2eb9",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "a8be698b-b65c-4674-8452-1da6aa0af26e",
            "createdDate": "2021-02-19T10:06:44.707",
            "lastPublishedDate": "2021-02-19T10:11:21.773",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "670be57d-e081-4cbb-82e0-9856e214c868",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 2
                },
                {
                    "id": "2237a2d6-70c5-4fa4-bd14-9d55e1ce1ee8",
                    "publishedDate": "2021-02-19T10:11:21.773",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "64106383-291c-43c6-8609-fc2f16c15561",
            "createdDate": "2021-02-19T09:43:32.95",
            "lastPublishedDate": "2021-02-19T09:47:28.6",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "bfbe63ae-c162-4085-88c7-b15f0d8f6823",
                    "publishedDate": "2021-02-19T09:47:28.6",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "b1ac6bba-cc6d-4588-a323-4767edb3818a",
            "createdDate": "2021-02-18T16:36:59.387",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "c16225dc-6a65-46f5-a2fd-d2884934c375",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "f282803d-e4b7-488c-860b-906cba951acd",
            "createdDate": "2021-02-18T06:04:32.063",
            "lastPublishedDate": "2021-02-18T16:40:37.62",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 4,
            "versions": [
                {
                    "id": "d6314d9e-593e-4ddd-903a-6c8805d6c6bd",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 4
                },
                {
                    "id": "350bc77b-541c-410e-ae96-2228cfe4217f",
                    "publishedDate": "2021-02-18T16:40:37.62",
                    "status": "ACTIVE",
                    "version": 3
                },
                {
                    "id": "e0f65cf3-82b1-41b6-b73e-c7b6000d6261",
                    "publishedDate": "2021-02-18T15:15:05.547",
                    "status": "INACTIVE",
                    "version": 2
                },
                {
                    "id": "afe1eeed-a193-46e3-aa99-b925ddf3600a",
                    "publishedDate": "2021-02-18T14:00:44.027",
                    "status": "RETIRED",
                    "version": 1
                }
            ]
        },
        {
            "id": "8ebd2635-6c37-4fa5-b072-d583a03cfe26",
            "createdDate": "2021-02-18T02:20:45.55",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "fd051cc6-2e66-43af-8edf-a3f1024125d9",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "40482655-fbfe-4227-86b0-9a3dc565f50b",
            "createdDate": "2021-02-17T20:17:06.277",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "c37e9c00-686f-47e1-a6ac-8f635a95dcd3",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "133de5c0-90fc-4771-85c9-f9c84fb0dff4",
            "createdDate": "2021-02-17T16:15:10.393",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "50d262ec-990f-4544-b117-c5d97d0da523",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "5286ea59-90ae-4548-93ce-7e5d846b48ea",
            "createdDate": "2021-02-17T13:30:33.577",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "eac1ecf8-5962-4231-ac54-0cb858dfa30c",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "70992e99-1d66-4a22-a957-c42b45932479",
            "createdDate": "2021-02-17T07:42:22.243",
            "lastPublishedDate": "2021-02-17T07:49:43.627",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "a339f343-7269-49cb-94da-89b8cbd9e542",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 2
                },
                {
                    "id": "38d85190-d8f1-4ff9-a9fa-b6f06342438e",
                    "publishedDate": "2021-02-17T07:49:43.627",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "3454c4bb-1a1f-44a5-9ced-cfaa5f91f41a",
            "createdDate": "2021-02-16T14:43:44.483",
            "lastPublishedDate": "2021-02-16T14:57:25.787",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "63859a4a-0eee-4253-b714-376d255f22d5",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 2
                },
                {
                    "id": "68881c46-a62a-4f8e-a861-740dc3ee4306",
                    "publishedDate": "2021-02-16T14:57:25.787",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "01d6ad81-d2a0-43b9-9fe2-a7f20c2d57d7",
            "createdDate": "2021-02-16T09:50:22.543",
            "lastPublishedDate": "2021-02-16T16:59:18.173",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "7c15c0c7-90d4-479e-ace3-fc52710d2173",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 2
                },
                {
                    "id": "9dd572b7-946c-4718-9cc8-3e8dfecc58d5",
                    "publishedDate": "2021-02-16T16:59:18.173",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "0b792e4a-98a3-4fa2-8ba2-7aebf0423592",
            "createdDate": "2021-02-15T11:06:25.43",
            "lastPublishedDate": "2021-02-15T13:21:45.757",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "c1f5d254-0715-486a-a998-26f8778e4ada",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 2
                },
                {
                    "id": "fa30ea5c-4a01-46f0-a7ac-49fc20e0c87a",
                    "publishedDate": "2021-02-15T13:21:45.757",
                    "status": "ACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "2ab4284e-64c7-4b82-9d2d-3785e9d60592",
            "createdDate": "2021-02-15T06:57:15.103",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "aba720c9-04a5-4f85-885e-051513f34640",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "aa41ddce-346f-4589-947a-e41f66e9227e",
            "createdDate": "2021-02-12T03:49:52.757",
            "lastPublishedDate": "2021-02-12T03:56:26.727",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "8418c6b5-f256-41d7-9eeb-c3115f4f8738",
                    "publishedDate": "2021-02-12T03:56:26.727",
                    "status": "INACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "2b23c021-4859-4fcc-a9a6-8a6568411eb9",
            "createdDate": "2021-02-11T18:25:45.8",
            "lastPublishedDate": null,
            "organizationId": "70a48ea0-ae29-458b-bed5-61c9b538c067",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "fa385bb6-6a9f-49d4-94e6-694e0386662f",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "d6e78f6a-11df-40c7-a39e-c137c201b26d",
            "createdDate": "2021-02-11T12:28:44.18",
            "lastPublishedDate": "2021-02-11T12:32:26.317",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "705019ab-8a5b-4cd7-b661-9fc47dc5cbec",
                    "publishedDate": "2021-02-11T12:32:26.317",
                    "status": "INACTIVE",
                    "version": 1
                }
            ]
        },
        {
            "id": "6afa1e44-d97c-406d-aaa9-9ab92fcdb416",
            "createdDate": "2021-02-09T16:43:32.343",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "03f9b0dd-2b00-4a8e-ab0f-7ea75d5144a6",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        },
        {
            "id": "7db41048-e15b-4cda-bbd7-e165c3227052",
            "createdDate": "2021-02-08T12:54:09.437",
            "lastPublishedDate": "2021-02-10T18:11:33.89",
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 2,
            "versions": [
                {
                    "id": "57732808-1a38-4d28-9b3f-9bf8f38faa96",
                    "publishedDate": "2021-02-10T18:11:33.89",
                    "status": "INACTIVE",
                    "version": 2
                },
                {
                    "id": "34a3c573-f14c-455b-aaa4-a5791bc33251",
                    "publishedDate": "2021-02-10T16:59:05.58",
                    "status": "RETIRED",
                    "version": 1
                }
            ]
        },
        {
            "id": "7ae82508-2efb-4925-a33a-50287ca7fe69",
            "createdDate": "2021-02-03T19:34:06.633",
            "lastPublishedDate": null,
            "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
            "responsibleUserId": null,
            "numberOfVersions": 1,
            "versions": [
                {
                    "id": "a95259d7-0b6d-45c6-87df-f8ec6ff7537b",
                    "publishedDate": null,
                    "status": "DRAFT",
                    "version": 1
                }
            ]
        }
    ],
    "pageable": {
        "sort": {
            "sorted": true,
            "unsorted": false,
            "empty": false
        },
        "pageNumber": 0,
        "pageSize": 20,
        "offset": 0,
        "paged": true,
        "unpaged": false
    },
    "sort": [
        {
            "direction": "DESC",
            "property": "createdDate",
            "ignoreCase": false,
            "nullHandling": "NATIVE",
            "ascending": false,
            "descending": true
        }
    ],
    "numberOfElements": 20,
    "totalPages": 5,
    "totalElements": 87,
    "first": true,
    "last": false,
    "size": 20,
    "number": 0,
    "empty": false
}

Note that the above response contains 20 policy IDs since the size parameter was set to 20. If you want to retrieve additional details on a specific policy, you can copy the respective policy ID, such as 3454c4bb-1a1f-44a5-9ced-cfaa5f91f41a, and include it in the GET /v2/privacynotices/{id} request, as detailed below.

Retrieving the policy version active on a particular date

The GET /v2/privacynotices/{id} endpoint can be used to obtain details on the version of the policy that was Active on a particular date.

The parameters required for this endpoint are id and date. The id path parameter represents the policy ID and will need to be passed in the request. The date query parameter represents the date at which you want to see which version of the policy was published. The version of a policy that was Active before the query paramater date will be returned.

Note: Acceptable formats for the date parameter are yyyy-MM-dd or yyyy-MM-ddTHH:mm:ss.

Example Request:

GET https://trial.onetrust.com/api/privacynotice/v2/privacynotices/3454c4bb-1a1f-44a5-9ced-cfaa5f91f41a?date=2021-02-20

Response Body:

{
    "id": "3454c4bb-1a1f-44a5-9ced-cfaa5f91f41a",
    "createdDate": "2021-02-16T14:43:44.483",
    "lastPublishedDate": "2021-02-19T19:28:47.6",
    "organizationId": "a6ec6c83-d384-4844-ad9b-afdacde54e0a",
    "responsibleUserId": null,
    "version": {
        "id": "2b609d49-c756-40a0-b22d-b8da2a87aa0e",
        "name": "Test - Demo v4",
        "publishedDate": "2021-02-19T19:28:47.6",
        "status": "ACTIVE",
        "version": 4
    }
}

Retrieving a list of all versions of a given policy

The GET /v2/privacynotices/{privacyNoticeId}/versions endpoint can be used to obtain a paged list of all versions of a specific policy.

The available parameters for this endpoint are privacyNoticeId, page, and size. The privacyNoticeId path parameter is required and represents the policy ID and will need to be passed in the request. The size query parameter represents the number of versions of the policy that will be displayed on a single page. The page query parameter represents the page number of the page that you want to display. The first page will have a page parameter of 0.

Example Request:

GET https://trial.onetrust.com/api/privacynotice/v2/privacynotices/3454c4bb-1a1f-44a5-9ced-cfaa5f91f41a/versions

Response Body:

{
    "content": [
        {
            "id": "2b609d49-c756-40a0-b22d-b8da2a87aa0e",
            "name": "Test - Demo v4",
            "status": "ACTIVE",
            "version": 4,
            "publishedDate": "2021-02-19T19:28:47.600Z",
            "publishedBy": "bd484676-bfae-45c7-a167-8a52cff65fc1",
            "languages": [
                {
                    "guid": "91814c4c-8277-4044-a7ee-175d369b75c6",
                    "languageCode": "en-us",
                    "defaultLanguage": true
                },
                {
                    "guid": "c7cb40b7-657e-4a33-b6dc-3038116ab2b8",
                    "languageCode": "es",
                    "defaultLanguage": false
                },
                {
                    "guid": "5f0d5e37-9e57-4244-9058-d1a51744f0ea",
                    "languageCode": "fr",
                    "defaultLanguage": false
                }
            ]
        },
        {
            "id": "28b342b7-d4ef-4794-806c-f337bea05594",
            "name": "Test - Demo v2",
            "status": "RETIRED",
            "version": 3,
            "publishedDate": "2021-02-19T19:28:30.767Z",
            "publishedBy": "bd484676-bfae-45c7-a167-8a52cff65fc1",
            "languages": [
                {
                    "guid": "9b01da21-8208-4635-99c7-4b945a05cb83",
                    "languageCode": "en-us",
                    "defaultLanguage": true
                },
                {
                    "guid": "e231d1c9-7efe-4d72-b4d6-2da270321852",
                    "languageCode": "es",
                    "defaultLanguage": false
                },
                {
                    "guid": "74a76760-3412-400d-b2da-a09a02ceb3af",
                    "languageCode": "fr",
                    "defaultLanguage": false
                }
            ]
        },
        {
            "id": "63859a4a-0eee-4253-b714-376d255f22d5",
            "name": "Test - Demo",
            "status": "RETIRED",
            "version": 2,
            "publishedDate": "2021-02-19T19:28:22.193Z",
            "publishedBy": "bd484676-bfae-45c7-a167-8a52cff65fc1",
            "languages": [
                {
                    "guid": "5453fbba-22db-4ae4-979a-cfe717407a4c",
                    "languageCode": "en-us",
                    "defaultLanguage": true
                },
                {
                    "guid": "215d0f87-d56f-4d18-ba9d-d7609006ca7b",
                    "languageCode": "es",
                    "defaultLanguage": false
                },
                {
                    "guid": "fc70c116-55f1-4d8e-be37-bfc2edbff5e6",
                    "languageCode": "fr",
                    "defaultLanguage": false
                }
            ]
        },
        {
            "id": "68881c46-a62a-4f8e-a861-740dc3ee4306",
            "name": "Test - Demo",
            "status": "RETIRED",
            "version": 1,
            "publishedDate": "2021-02-16T14:57:25.787Z",
            "publishedBy": "bd484676-bfae-45c7-a167-8a52cff65fc1",
            "languages": [
                {
                    "guid": "37cf8c81-ff9c-4492-8ad7-1a0ddec0a0e3",
                    "languageCode": "en-us",
                    "defaultLanguage": true
                },
                {
                    "guid": "27dd5856-305b-47c0-a04c-b02cf747b85a",
                    "languageCode": "es",
                    "defaultLanguage": false
                },
                {
                    "guid": "470a6565-3154-44fc-a41a-37285ecd02ab",
                    "languageCode": "fr",
                    "defaultLanguage": false
                }
            ]
        }
    ],
    "pageable": {
        "sort": {
            "sorted": false,
            "unsorted": true,
            "empty": true
        },
        "pageNumber": 0,
        "pageSize": 20,
        "offset": 0,
        "paged": true,
        "unpaged": false
    },
    "sort": [],
    "numberOfElements": 4,
    "totalPages": 1,
    "first": true,
    "last": true,
    "totalElements": 4,
    "size": 20,
    "number": 0,
    "empty": false
}