Consent Audit Trail Export API

AI Tools

The Export Consent Audit Archive API allows customers to retrieve a comprehensive archive of a consent record, including consent metadata, approved operations, associated data categories and data types, lifecycle events, modification history, revocation records, and related audit information. The exported archive serves as a complete audit trail of the consent throughout its lifecycle and can be used for regulatory compliance, internal governance, dispute resolution, audit reviews, and record-keeping purposes. This API helps organisations demonstrate transparency and accountability by providing a verifiable record of consent-related activities and decisions associated with a Data Principal's consent.

API Definition


Request

Type

URL

Version

POST

https://api.attestr.com/api/{version/public/consent/<_id>/export

Use "v3" for DPDA compliant version

Request Url Parameters

Type

Name

Description

Optional (default)

Min Version

Max Version

String

_id

Consent ID as generated in Register Consent API

Required

v3


Request Header Parameters

Type

Name

Value / Description

Optional

Min Version

Max Version

String

Content-Type

application/json

Required

v3


String

Authorization

Basic {authToken}

Required

v3


Info

If you do not have the authentication token, please refer to Register App to generate one.

Sample Request

curl --location --request POST 'https://api.attestr.com/api/v3/public/consent/CX3RnblcrFw4smjIM6/export' \ --header 'Authorization: Basic your_auth_token' \ --header 'Content-Type: application/json'

Response

Http Status 200

Type

Key

Description

Min Version

Max Version

String

_id

Unique AsyncRequest Id as assigned by Attestr Platform

v3


String

number

Unique human readable number for reference as assigned by Attestr platform

v3


Upon successful submission of an export request, Attestr runs an automated job, which fetches all the associated consent metadata and prepares an excel document containing the relevant audit trail information. Once completed, the job status is appropriately updated with the media ID of the excel file.

Sample Response

{ "_id": "AR0xHy64j4cbQiA", "number": "1234-56789-1234" }

Get Export Result API

Type

URL

GET

https://api.attestr.com/api/v3/public/common/async/<asyncId>

Request URL Parameters

Name

Description

Min Version

Max Version

asyncId

Replace <asyncId> in the URL with the _id received in the export API response above

v3


Request Header Parameters

Type

Name

Value / Description

Optional

Min Version

Max Version

String

Content-Type

application/json

Required

v3


String

Authorization

Basic {authToken}

Required

v3


Response

Http Status 200

Key

Description

Type

Min Version

Max Version

_id

Request Id as queried in the URL

String

v3


number

Request number as generated in the export API response

String

v3


requestId

Unique ID used by Attestr for request tracing purposes

String

v3


status

Status of the request. Possible values are - COMPLETED, INITIATED, ERRORED

String

v3


input

The input details used for export

String

v3


output

Output object if the export is completed. It has the following structure. { "_id": "mediaId" }

This mediaId corresponds to the excel file which can be downloaded using Get Media Stream API.

Object

v3


error

Error object if the operation ran into errors, null otherwise. Null if status is completed or initiated.

String

v3


created

Unix timestamp when the request was placed.

Number

v3


updated

Unix timestamp when the request was last updated. Null if status is initiated.

Number

v3


signature

Signature generated using the output and client secret. Used for validating the accuracy of data. Null if status is errored or initiated.

String

v3


Sample Output

{ "_id": "AR07Pg8MEqX9LX-15W", "number": "3964-174479-9074", "requestId": "02fb52da-6269-4fc5-8e77-8c3a72b75b87", "status": "COMPLETED", "input": { consentId: consent._id, type: "CONSENT_DUMP", consent: { consentId: consent._id } }, "output": { _id: "MX0hjk356gA1njA", }, "error": null, "created": 1704954457725, "createdBy": null, "createdByOrg": "OX02wacfO0qIS0cosU", "client": "AC0UpnHQzkjGPHkyKe", "updated": 1704986882821, "signature": "791c1b6ae7f82218702ad1f4403881efa4ccccef26a62abf961803225ee2f506", "tracker": [], "metadata": null }

Error Response

Parameter

Type

Description

code

Number

Unique error codes for different errors. Always available.

httpStatusCode

String

Standard HTTP status code for the error

message

String

Error message describing the error. Always Available.

details

String

Detail error message. Available only for certain types of errors.

Error Codes

HTTP Status

Error Code

Error Message

400

4001

Malformed data or missing required parameter values

400

4005

Operation could not be performed due to low credits balance

401

4016

Invalid client authorization

403

4031

Unauthorized access

403

4035

Requested service is not provisioned for your account

403

4039

Client's IP address is not whitelisted

403

4035

Requested service is not provisioned for your account

429

4291

Maximum account rate limit exceeded

429

4292

Maximum API rate limit exceeded

429

4293

Maximum account daily limit exceeded

429

4294

Maximum API daily limit exceeded

500

5001

Request could not be processed

Sample Error Response

{ "httpStatusCode": 400, "code": 4001, "message": "Malformed data or missing required parameter values", "appError": true }


  Last updated