Create a Consent
Create a Consent
Create a new consent record
POST
/
consents
curl --request POST \
--url https://cookiechimp.com/api/v1/consents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "<string>",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"<string>"
],
"rejected_categories": [
"<string>"
],
"accepted_services": {},
"rejected_services": {}
}
}'
{
"id": "consent321",
"session_id": "sess123",
"user_id": "user456",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"cat1",
"cat2"
],
"rejected_categories": [
"cat3",
"cat4"
],
"accepted_services": {
"company1": [
"cookie1",
"cookie2"
]
},
"rejected_services": {}
},
"created_at": "2023-01-20T12:46:30Z"
}
Authorizations
Body
application/json
Consent to create
Available options:
all
, custom
, necessary
ID of the user set by your website
Response
201
application/json
Created consent
Available options:
all
, custom
, necessary
ID of the user set by your website
Unique identifier for the consent
ID of the session
Date and time when the consent was created
curl --request POST \
--url https://cookiechimp.com/api/v1/consents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "<string>",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"<string>"
],
"rejected_categories": [
"<string>"
],
"accepted_services": {},
"rejected_services": {}
}
}'
{
"id": "consent321",
"session_id": "sess123",
"user_id": "user456",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"cat1",
"cat2"
],
"rejected_categories": [
"cat3",
"cat4"
],
"accepted_services": {
"company1": [
"cookie1",
"cookie2"
]
},
"rejected_services": {}
},
"created_at": "2023-01-20T12:46:30Z"
}