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
Create a new consent for a specific web space
POST /webspaces/:id/consents
Route parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The identifier of the web space on which the consent is created |
Required headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Authorization token for API access |
Accept | string | Yes | Specifies the desired response format (application/json) |
Content-Type | string | Yes | Specifies the request content format (application/json) |
Request parameters (JSON format)
| Name | Type | Required | Description |
|---|---|---|---|
ip_address | string | Yes | The IP address of the subject providing consent |
consent_type | string | Yes | The type of consent (e.g. "banner", "form", "explicit") |
optin | string | Yes | Consent status ("accepted", "rejected", "partial") |
consent_data | array | No | Array of objects containing consent data with label/value structure |
versions | array | No | Array of objects containing the policy versions referenced |
identifier | string | Yes | Unique identifier of the subject providing consent |
source | string | No | Source of consent (e.g. "website", "app") |
consent_features | array | No | Array of strings indicating the features for which consent was given |
html_form | string | No | HTML 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.