ClickwrapConsents
Consent Create
This endpoint creates a consent object and initiates a session to capture user agreement to specific terms or conditions (e.g., terms of service, privacy policies). The consent object is used to store both session-related metadata and consent details. This endpoint is important because it generates a unique session ID which is used to edit and link the consent to the user’s interaction in consent edit request, ensuring continuity and security.
X-Subscription-Key<token>
In: header
Header Parameters
X-Subscription-Key*string
Unique API key used to identify and authorize access to a specific environment
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/consents/create" \ -H "Authorization: Bearer {{authToken}}" \ -H "X-Subscription-Key: {{apiKey}}" \ -H "Content-Type: application/json" \ -d '{ "externalContext": "12345", "consent": { "termDefinitionId": "{{termDefinitionId}}" } }'{ "result": { "statusCode": 201, "message": "Created", "data": [ { "consent": { "sessionId": "{{sessionId}}", "sessionStartDatetime": "{{sessionStartDatetime}}", "sessionExpirationDatetime": "{{sessionExpirationDatetime}}" }, "termDefinition": { "text": "{{termText}}" } } ] }, "externalContext": "{{externalContextId}}", "origin": "{{originEnvironment}}", "dateTime": "{{responseTimestamp}}", "userId": "{{userId}}"}