POST
/
consents
curl --request POST \
  --url https://cookiechimp.com/api/v1/consents \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --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

X-API-KEY
string
headerrequired

Body

application/json
user_id
string

ID of the user set by your website

user_preferences
object
required

Response

201 - application/json
user_id
string

ID of the user set by your website

user_preferences
object
required
id
string

Unique identifier for the consent

session_id
string

ID of the session

created_at
string

Date and time when the consent was created