GET
/
sessions
/
{id}
curl --request GET \
  --url https://cookiechimp.com/api/v1/sessions/{id} \
  --header 'X-API-KEY: <api-key>'
{
  "id": "sess123",
  "user_id": "user456",
  "pageviews": [
    {
      "id": "pageview789",
      "session_id": "sess123",
      "url": "https://www.example.com/products",
      "consent_id": null,
      "active_cookies": [
        "essential-cookie-1"
      ],
      "created_at": "2023-01-20T12:45:30Z"
    },
    {
      "id": "pageview890",
      "session_id": "sess123",
      "url": "https://www.example.com/products/123",
      "consent_id": "consent321",
      "active_cookies": [
        "essential-cookie-1",
        "cookie1",
        "cookie2"
      ],
      "created_at": "2023-01-20T12:50:00Z"
    }
  ],
  "consents": [
    {
      "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"
    }
  ],
  "first_seen_at": "2023-01-20T12:45:30Z",
  "last_seen_at": "2023-01-20T12:50:00Z"
}

Authorizations

X-API-KEY
string
headerrequired

Path Parameters

id
string
required

ID of the resource

Response

200 - application/json
id
string

Unique identifier for the session

user_id
string | null

ID of the user set by your website

pageviews
object[]

List of pageviews in the session

consents
object[]

List of consents in the session

first_seen_at
string

Date and time when the session was first seen

last_seen_at
string

Date and time when the session was last seen