Platform API
These calls belong to no single module: which projects a key reaches, and the audit log of a project or an agency.
List projects
Section titled “List projects”https://api.trustcomponent.com/platform/v1/projectsLists the projects the API key reaches
Every project the API key may act on, sorted by name, with its modules and the roles the key holds there. A key of a project returns its own project; a key of an agency returns the client projects in its scope.
Authentication: API key as bearer token. Operation getProjectsV1.
curl "https://api.trustcomponent.com/platform/v1/projects" \ -H "Authorization: Bearer <your_api_key>"import { TrustComponent } from '@trustcomponent/sdk';
const tc = new TrustComponent('<your_api_key>');
const projects = await tc.platform.projects.getProjects();use TrustComponent\TrustComponent;
$tc = new TrustComponent('<your_api_key>');
$projects = $tc->platform()->projects()->getProjects();from trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
projects = tc.platform.projects.get_projects()import com.trustcomponent.sdk.TrustComponent;
TrustComponent tc = new TrustComponent("<your_api_key>");
var projects = tc.platform().projects().getProjects(null, null);using TrustComponent;
using var tc = new TrustComponentClient("<your_api_key>");
var projects = await tc.Platform.Projects.GetProjectsAsync();import ( "context"
trustcomponent "github.com/trustcomponent/trustcomponent-go")
tc := trustcomponent.New("<your_api_key>")ctx := context.Background()
projects, _, err := tc.Platform.Projects.GetProjects(ctx).Execute()if err != nil { panic(err)}require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
projects = tc.platform.projects.get_projectsuse trustcomponent::apis::platform_projects_api::GetProjectsParams;
let tc = trustcomponent::TrustComponent::new("<your_api_key>");
let projects = tc.platform.projects.get_projects(GetProjectsParams { page: None, page_size: None }).await?;{ "content": [ { "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "name": "My company", "modules": [ "CAPTCHA", "ANALYTICS" ], "roles": [ "MEMBER" ] } ], "page": 0, "pageSize": 25, "totalElements": 3}Query parameters
| Name | Type | Description |
|---|---|---|
pageoptional | integer | Zero-based page index · 0 to ∞, default 0 |
pageSizeoptional | integer | Number of entries per page · 1 to 100, default 25 |
Response 200 · application/json
| Field | Type | Description |
|---|---|---|
content | array of object | Projects of this page, sorted by name |
page | integer | Zero-based index of this page |
pageSize | integer | Number of entries per page |
totalElements | integer | Number of projects the API key reaches |
Status codes
| Status | Meaning |
|---|---|
200 | One page of projects |
400 | Page below 0 or page size outside 1 to 100 |
401 | API key missing (code: credentials_missing) or invalid (code: credentials_invalid) |
429 | Too many requests (code: rate_limit_exceeded); retry after the seconds in Retry-After |
Use it to find the project id the module calls take in their path. A key of an agency lists every client project it reaches, with the roles it holds there.
Read the audit log
Section titled “Read the audit log”The audit log API lets your own systems read the audit log for archiving, periodic imports or reports of your own. To have every new event pushed to you instead, use streaming; both deliver the same event format. Whether it is available depends on your plan and add-ons, see Current add-ons.
- Create an API key with the Auditor role. In a project or an agency, open API / Integration and choose Create API Key in the API Keys card. You need the Auditor role yourself to give it to a key.
- Read the first page of a time range.
- Read the next page by passing the
nextCursorof the response ascursor, with the samefromandto, untilnextCursorisnull. Unlikepage, the cursor does not shift when new events arrive while you read.
Events of a project
Section titled “Events of a project”https://api.trustcomponent.com/platform/v1/projects/{projectId}/eventsReturns the audit log events of a project
Returns the audit log events of the project and of all its modules, newest first, within the audit log retention of the project's plan. A key of a project reads its own project; a key of an agency reads every client project it reaches on which it holds the Auditor role. The audit log stays readable while the project is locked. To read a time range completely, keep from and to fixed and pass the nextCursor of each response as cursor of the next request until nextCursor is null. Paging with page still works but shifts when new events arrive during the read.
Authentication: API key as bearer token. Operation getEventsOfProjectV1.
# First page; pass its nextCursor as cursor (same from and to) until nextCursor is null.curl "https://api.trustcomponent.com/platform/v1/projects/<project_id>/events?from=2026-11-01T00:00:00.000Z&to=2026-11-08T00:00:00.000Z&pageSize=100" \ -H "Authorization: Bearer <your_api_key>"import { TrustComponent } from '@trustcomponent/sdk';
const tc = new TrustComponent('<your_api_key>');
let cursor: string | undefined;do { const page = await tc.platform.events.getEventsOfProject({ projectId: '<project_id>', from: '2026-11-01T00:00:00.000Z', to: '2026-11-08T00:00:00.000Z', cursor, pageSize: 100 }); cursor = page.nextCursor ?? undefined;} while (cursor);use TrustComponent\TrustComponent;
$tc = new TrustComponent('<your_api_key>');
$cursor = null;do { $page = $tc->platform()->events()->getEventsOfProject('<project_id>', '2026-11-01T00:00:00.000Z', '2026-11-08T00:00:00.000Z', $cursor, null, 100); $cursor = $page->getNextCursor();} while ($cursor !== null);from uuid import UUIDfrom trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
cursor = Nonewhile True: page = tc.platform.events.get_events_of_project(UUID("<project_id>"), "2026-11-01T00:00:00.000Z", "2026-11-08T00:00:00.000Z", cursor=cursor, page_size=100) cursor = page.next_cursor if cursor is None: breakimport com.trustcomponent.sdk.TrustComponent;import java.util.UUID;
TrustComponent tc = new TrustComponent("<your_api_key>");
String cursor = null;do { var page = tc.platform().events().getEventsOfProject(UUID.fromString("<project_id>"), "2026-11-01T00:00:00.000Z", "2026-11-08T00:00:00.000Z", cursor, null, 100); cursor = page.getNextCursor();} while (cursor != null);using TrustComponent;
using var tc = new TrustComponentClient("<your_api_key>");
string cursor = null;do{ var page = await tc.Platform.Events.GetEventsOfProjectAsync(Guid.Parse("<project_id>"), "2026-11-01T00:00:00.000Z", "2026-11-08T00:00:00.000Z", cursor, pageSize: 100); cursor = page.NextCursor;} while (cursor != null);import ( "context"
trustcomponent "github.com/trustcomponent/trustcomponent-go")
tc := trustcomponent.New("<your_api_key>")ctx := context.Background()
var cursor *stringfor { request := tc.Platform.Events.GetEventsOfProject(ctx, "<project_id>").From("2026-11-01T00:00:00.000Z").To("2026-11-08T00:00:00.000Z").PageSize(100) if cursor != nil { request = request.Cursor(*cursor) } page, _, err := request.Execute() if err != nil { panic(err) } if cursor = page.NextCursor.Get(); cursor == nil { break }}require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
cursor = nilloop do page = tc.platform.events.get_events_of_project('<project_id>', from: '2026-11-01T00:00:00.000Z', to: '2026-11-08T00:00:00.000Z', cursor: cursor, page_size: 100) cursor = page.next_cursor break if cursor.nil?enduse trustcomponent::apis::platform_events_api::GetEventsOfProjectParams;
let tc = trustcomponent::TrustComponent::new("<your_api_key>");
let mut cursor: Option<String> = None;loop { let page = tc.platform.events.get_events_of_project(GetEventsOfProjectParams { project_id: "<project_id>".into(), from: Some("2026-11-01T00:00:00.000Z".into()), to: Some("2026-11-08T00:00:00.000Z".into()), cursor: cursor.take(), page: None, page_size: Some(100), }).await?; cursor = page.next_cursor.flatten(); if cursor.is_none() { break; }}{ "from": "2020-01-01T13:30:05.941Z", "to": "2020-01-02T13:30:05.941Z", "content": [ { "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "schemaVersion": 2, "occurredAt": "2020-01-01T13:30:05.941Z", "type": "captcha.captcha.updated", "action": "updated", "subject": { "kind": "captcha.captcha", "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "label": "Checkout form" }, "scopes": [ { "kind": "captcha.captcha", "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "label": "Checkout form" } ], "origin": { "namespace": "CAPTCHA", "source": "WEB_CONTROLLER", "applicationName": "tc-captcha-captchaservice", "traceId": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "transactionId": "e5f6a7b8c9d0e1f2" }, "actor": { "type": "USER", "userId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "apiKeyId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "automation": { "kind": "SCHEDULER", "name": "subscription_deletion_execution" } }, "changes": [ { "field": "label", "operation": "SET", "before": "Checkout", "after": "Checkout form", "isRedacted": false } ], "details": { "method": "PASSWORD", "ipAddress": "203.0.113.xxx" } } ], "page": 0, "pageSize": 100, "totalElements": 1234, "nextCursor": "MjAyNi0wOS0wMVQxMzozMDowNS45NDFafGNjMmUyZDVlLWQxZWYtNGE3Zi1hN2JkLWRlYzViMzdkZjQ3YQ"}Path parameters
| Name | Type | Description |
|---|---|---|
projectIdrequired | string (uuid) | Id of the project |
Query parameters
| Name | Type | Description |
|---|---|---|
fromoptional | string | Start of the time range (inclusive), ISO 8601 in UTC. Defaults to 24 hours before to. |
tooptional | string | End of the time range (inclusive), ISO 8601 in UTC. Defaults to now. |
cursoroptional | string | Position to continue after, taken from nextCursor of the previous response. When set, page is ignored. |
pageoptional | integer | Zero-based page index, ignored when cursor is set · 0 to ∞, default 0 |
pageSizeoptional | integer | Number of entries per page · 1 to 1000, default 100 |
Response 200 · application/json
| Field | Type | Description |
|---|---|---|
from | string | Start of the requested time range |
to | string | End of the requested time range |
content | array of object | Events of this page, newest first |
page | integer | Zero-based index of this page |
pageSize | integer | Requested number of entries per page |
totalElements | integer | Number of events in the whole time range |
nextCursormay be null | string | Pass as cursor to read the next page; null when this page is the last one |
Status codes
| Status | Meaning |
|---|---|
200 | One page of events |
400 | Invalid time range, cursor, page or page size |
401 | API key missing (code: credentials_missing) or invalid (code: credentials_invalid) |
402 | Audit log access not included in the plan (code: feature_not_included) |
403 | The API key has no access to this project or lacks the Auditor role on it (code: access_denied) |
429 | Too many requests (code: rate_limit_exceeded); retry after the seconds in Retry-After |
Events of an agency
Section titled “Events of an agency”https://api.trustcomponent.com/platform/v1/agencies/{agencyId}/eventsReturns the audit log events of an agency
Returns the audit log events of the agency itself, newest first, within the audit log retention of its plan. Only a key of this agency with the Auditor role reads it; client projects are read with getEventsOfProjectV1. Paging works as in getEventsOfProjectV1.
Authentication: API key as bearer token. Operation getEventsOfAgencyV1.
curl "https://api.trustcomponent.com/platform/v1/agencies/<agency_id>/events?pageSize=10" \ -H "Authorization: Bearer <your_api_key>"import { TrustComponent } from '@trustcomponent/sdk';
const tc = new TrustComponent('<your_api_key>');
const events = await tc.platform.events.getEventsOfAgency({ agencyId: '<agency_id>', pageSize: 10 });use TrustComponent\TrustComponent;
$tc = new TrustComponent('<your_api_key>');
$events = $tc->platform()->events()->getEventsOfAgency('<agency_id>', null, null, null, null, 10);from uuid import UUIDfrom trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
events = tc.platform.events.get_events_of_agency(UUID("<agency_id>"), page_size=10)import com.trustcomponent.sdk.TrustComponent;import java.util.UUID;
TrustComponent tc = new TrustComponent("<your_api_key>");
var events = tc.platform().events().getEventsOfAgency(UUID.fromString("<agency_id>"), null, null, null, null, 10);using TrustComponent;
using var tc = new TrustComponentClient("<your_api_key>");
var events = await tc.Platform.Events.GetEventsOfAgencyAsync(Guid.Parse("<agency_id>"), pageSize: 10);import ( "context"
trustcomponent "github.com/trustcomponent/trustcomponent-go")
tc := trustcomponent.New("<your_api_key>")ctx := context.Background()
events, _, err := tc.Platform.Events.GetEventsOfAgency(ctx, "<agency_id>").PageSize(10).Execute()if err != nil { panic(err)}require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
events = tc.platform.events.get_events_of_agency('<agency_id>', page_size: 10)use trustcomponent::apis::platform_events_api::GetEventsOfAgencyParams;
let tc = trustcomponent::TrustComponent::new("<your_api_key>");
let events = tc.platform.events.get_events_of_agency(GetEventsOfAgencyParams { agency_id: "<agency_id>".into(), from: None, to: None, cursor: None, page: None, page_size: Some(10),}).await?;{ "from": "2020-01-01T13:30:05.941Z", "to": "2020-01-02T13:30:05.941Z", "content": [ { "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "schemaVersion": 2, "occurredAt": "2020-01-01T13:30:05.941Z", "type": "captcha.captcha.updated", "action": "updated", "subject": { "kind": "captcha.captcha", "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "label": "Checkout form" }, "scopes": [ { "kind": "captcha.captcha", "id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "label": "Checkout form" } ], "origin": { "namespace": "CAPTCHA", "source": "WEB_CONTROLLER", "applicationName": "tc-captcha-captchaservice", "traceId": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", "transactionId": "e5f6a7b8c9d0e1f2" }, "actor": { "type": "USER", "userId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "apiKeyId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a", "automation": { "kind": "SCHEDULER", "name": "subscription_deletion_execution" } }, "changes": [ { "field": "label", "operation": "SET", "before": "Checkout", "after": "Checkout form", "isRedacted": false } ], "details": { "method": "PASSWORD", "ipAddress": "203.0.113.xxx" } } ], "page": 0, "pageSize": 100, "totalElements": 1234, "nextCursor": "MjAyNi0wOS0wMVQxMzozMDowNS45NDFafGNjMmUyZDVlLWQxZWYtNGE3Zi1hN2JkLWRlYzViMzdkZjQ3YQ"}Path parameters
| Name | Type | Description |
|---|---|---|
agencyIdrequired | string (uuid) | Id of the agency |
Query parameters
| Name | Type | Description |
|---|---|---|
fromoptional | string | Start of the time range (inclusive), ISO 8601 in UTC. Defaults to 24 hours before to. |
tooptional | string | End of the time range (inclusive), ISO 8601 in UTC. Defaults to now. |
cursoroptional | string | Position to continue after, taken from nextCursor of the previous response. When set, page is ignored. |
pageoptional | integer | Zero-based page index, ignored when cursor is set · 0 to ∞, default 0 |
pageSizeoptional | integer | Number of entries per page · 1 to 1000, default 100 |
Response 200 · application/json
| Field | Type | Description |
|---|---|---|
from | string | Start of the requested time range |
to | string | End of the requested time range |
content | array of object | Events of this page, newest first |
page | integer | Zero-based index of this page |
pageSize | integer | Requested number of entries per page |
totalElements | integer | Number of events in the whole time range |
nextCursormay be null | string | Pass as cursor to read the next page; null when this page is the last one |
Status codes
| Status | Meaning |
|---|---|
200 | One page of events |
400 | Invalid time range, cursor, page or page size |
401 | API key missing (code: credentials_missing) or invalid (code: credentials_invalid) |
402 | Audit log access not included in the plan (code: feature_not_included) |
403 | The API key has no access to this agency or lacks its Auditor role (code: access_denied) |
429 | Too many requests (code: rate_limit_exceeded); retry after the seconds in Retry-After |
The event format
Section titled “The event format”| Field | Meaning |
|---|---|
id | Unique id of the event. An event is never delivered with two different ids, so use it to skip duplicates. |
schemaVersion | 2 for events since API keys, automations and anonymous callers are told apart; 1 for older events, which only know USER and SYSTEM. |
type | Kind of the subject followed by the action, for example platform.user.authentication-failed. |
subject / scopes | The resource the action happened to, and the resources it belongs to. label is the name at the time of the event. Kinds use internal names: platform.subscription is a project, platform.organization an agency. |
origin | Where in TrustComponent the event was recorded. Quote the traceId when you ask support about an event. |
actor | Who caused the event, see below. |
changes | The fields the action changed. Secret values are never recorded; such a change has isRedacted: true. |
details | Facts about the action that are not a change of the subject: the sign-in method and masked IP address of a sign-in, the format and time range of an export. |
Actor type | Meaning |
|---|---|
USER | A signed-in person, identified by userId. |
API_KEY | A request authenticated with an API key, identified by apiKeyId. |
AUTOMATION | A process of TrustComponent that runs by itself: a scheduled job, a task at service start, or a reaction to another event. automation.kind is SCHEDULER, RUNNER or LISTENER, automation.name names the job. |
ANONYMOUS | A caller that is not signed in, for example a failed sign-in or a password reset through the link in an e-mail. |
SYSTEM | TrustComponent itself, when no more specific actor applies. |