GET/ users/ :id/ events/
Get user events
You can return all user’s events.
Attributes
Optional unless marked required
- id
- A unique identifier for the user which is given by User automatically.
| Lookup | Description | Example usage |
|---|---|---|
| count_from | A date from when stats should be counted | ?count_from=2021-05-16 |
| count_to | A date utill stats should be counted | ?count_from=2022-05-16 |
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/users/:id/events/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/users/:id/events/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/users/:id/events/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/users/:id/events/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"count": 1,"next": null,"previous": null,"results": [{"client": 1952,"timestamp": "2026-11-17T15:13:49Z","id": 27,"items": [{"name": "plan","name_std": "plan","value": "pro","type": "string"},{"name": "seats","name_std": "seats","value": "10","type": "string"}],"event": "plan_upgraded","event_id": 47}]}{
"detail": "No ClientUser matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
client - ID of the contact.
- results[].
timestamp - When it happened, ISO 8601.
- results[].
id - ID of the event occurrence.
- results[].
items - Event data: one object per field with a value, each with
name,name_std,valueandtype, sorted byname.- results[].
items[]. name - Name of the event field.
- results[].
items[]. name_std - Standardized name of the field, used as its key in the API.
- results[].
items[]. value - Value of the field in this occurrence.
- results[].
items[]. type - Value type of the field:
boolean,datetime,number,stringorjson.
- results[].
- results[].
event - Name of the event.
- results[].
event_id - ID of the event.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.