Skip to main content

Consent store integration via REST API


This section shows the integration and consultation of the consent archive, necessary to be able to store evidence of the consent to the processing of personal data that users may have knowingly given while browsing your website.

This documentation describes endpoints for managing consent within webspaces. The base URL of the API is

https://api.avacy.eu/:team/v4

POST /webspaces/:id/consents

Route parameters

NameTypeRequiredDescription
idintegerYesThe identifier of the web space on which the consent is created

Required headers

NameTypeRequiredDescription
AuthorizationstringYesAuthorization token for API access
AcceptstringYesSpecifies the desired response format (application/json)
Content-TypestringYesSpecifies the request content format (application/json)

Request parameters (JSON format)

NameTypeRequiredDescription
ip_addressstringYesThe IP address of the subject providing consent
consent_typestringYesThe type of consent (e.g. "banner", "form", "explicit")
optinstringYesConsent status ("accepted", "rejected", "partial")
consent_dataarrayNoArray of objects containing consent data with label/value structure
versionsarrayNoArray of objects containing the policy versions referenced
identifierstringYesUnique identifier of the subject providing consent
sourcestringNoSource of consent (e.g. "website", "app")
consent_featuresarrayNoArray of strings indicating the features for which consent was given
html_formstringNoHTML representation of the consent form shown to the user

Example:

{
"ip_address": "192.168.1.20",
"consent_type": "banner",
"optin": "accepted",
"consent_data": [
{
"label": "name",
"value": "Mario"
},
{
"label": "surname",
"value": "Rossi"
}
],
"versions": [
{
"slug": "privacy_policy",
"link": "https://example.com/privacy",
"date": "2025-05-15"
}
],
"identifier": "user-123",
"source": "website",
"consent_features": [
"privacy_policy",
"cookie_policy"
],
"html_form": "<p>We use cookies and other technologies...</p>"
}

Successful Response

Code: 201 Created

{
"message": "Consent created successfully",
"data": {
"id": 123,
"webspace_id": 1,
"ip_address": "192.168.1.20",
"consent_type": "banner",
"optin": "accepted",
"consent_data": [
{
"label": "name",
"value": "Mario"
},
{
"label": "surname",
"value": "Rossi"
}
],
"versions": [
{
"slug": "privacy_policy",
"link": "https://example.com/privacy",
"date": "2025-05-15"
}
],
"identifier": "user-123",
"source": "website",
"consent_features": [
"privacy_policy",
"cookie_policy"
],
"html_form": "<p>We use cookies and other technologies...</p>",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2025-11-12T10:30:00.000000Z",
"updated_at": "2025-11-12T10:30:00.000000Z"
}
}

Error Response

Code: 400 Bad Request if the required fields are missing or invalid.

Code: 404 Not Found if the webspace with the specified ID does not exist.