Skip to content

Platform API

These calls belong to no single module: which projects a key reaches, and the audit log of a project or an agency.

GET https://api.trustcomponent.com/platform/v1/projects

Lists 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.

Example request
Terminal window
curl "https://api.trustcomponent.com/platform/v1/projects" \
-H "Authorization: Bearer <your_api_key>"
Example request
import { TrustComponent } from '@trustcomponent/sdk';
const tc = new TrustComponent('<your_api_key>');
const projects = await tc.platform.projects.getProjects();
Example request
use TrustComponent\TrustComponent;
$tc = new TrustComponent('<your_api_key>');
$projects = $tc->platform()->projects()->getProjects();
Example request
from trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
projects = tc.platform.projects.get_projects()
Example request
import com.trustcomponent.sdk.TrustComponent;
TrustComponent tc = new TrustComponent("<your_api_key>");
var projects = tc.platform().projects().getProjects(null, null);
Example request
using TrustComponent;
using var tc = new TrustComponentClient("<your_api_key>");
var projects = await tc.Platform.Projects.GetProjectsAsync();
Example request
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)
}
Example request
require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
projects = tc.platform.projects.get_projects
Example request
use 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?;
Example response (200)
{
"content": [
{
"id": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a",
"name": "My company",
"modules": [
"CAPTCHA",
"ANALYTICS"
],
"roles": [
"MEMBER"
]
}
],
"page": 0,
"pageSize": 25,
"totalElements": 3
}

Query parameters

NameTypeDescription
pageoptionalintegerZero-based page index · 0 to ∞, default 0
pageSizeoptionalintegerNumber of entries per page · 1 to 100, default 25

Response 200 · application/json

FieldTypeDescription
contentarray of objectProjects of this page, sorted by name
pageintegerZero-based index of this page
pageSizeintegerNumber of entries per page
totalElementsintegerNumber of projects the API key reaches

Status codes

StatusMeaning
200One page of projects
400Page below 0 or page size outside 1 to 100
401API key missing (code: credentials_missing) or invalid (code: credentials_invalid)
429Too 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.

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.

  1. 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.
  2. Read the first page of a time range.
  3. Read the next page by passing the nextCursor of the response as cursor, with the same from and to, until nextCursor is null. Unlike page, the cursor does not shift when new events arrive while you read.
GET https://api.trustcomponent.com/platform/v1/projects/{projectId}/events

Returns 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.

Example request
Terminal window
# 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>"
Example request
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);
Example request
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);
Example request
from uuid import UUID
from trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
cursor = None
while 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:
break
Example request
import 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);
Example request
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);
Example request
import (
"context"
trustcomponent "github.com/trustcomponent/trustcomponent-go"
)
tc := trustcomponent.New("<your_api_key>")
ctx := context.Background()
var cursor *string
for {
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
}
}
Example request
require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
cursor = nil
loop 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?
end
Example request
use 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;
}
}
Example response (200)
{
"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

NameTypeDescription
projectIdrequiredstring (uuid)Id of the project

Query parameters

NameTypeDescription
fromoptionalstringStart of the time range (inclusive), ISO 8601 in UTC. Defaults to 24 hours before to.
tooptionalstringEnd of the time range (inclusive), ISO 8601 in UTC. Defaults to now.
cursoroptionalstringPosition to continue after, taken from nextCursor of the previous response. When set, page is ignored.
pageoptionalintegerZero-based page index, ignored when cursor is set · 0 to ∞, default 0
pageSizeoptionalintegerNumber of entries per page · 1 to 1000, default 100

Response 200 · application/json

FieldTypeDescription
fromstringStart of the requested time range
tostringEnd of the requested time range
contentarray of objectEvents of this page, newest first
pageintegerZero-based index of this page
pageSizeintegerRequested number of entries per page
totalElementsintegerNumber of events in the whole time range
nextCursormay be nullstringPass as cursor to read the next page; null when this page is the last one

Status codes

StatusMeaning
200One page of events
400Invalid time range, cursor, page or page size
401API key missing (code: credentials_missing) or invalid (code: credentials_invalid)
402Audit log access not included in the plan (code: feature_not_included)
403The API key has no access to this project or lacks the Auditor role on it (code: access_denied)
429Too many requests (code: rate_limit_exceeded); retry after the seconds in Retry-After
GET https://api.trustcomponent.com/platform/v1/agencies/{agencyId}/events

Returns 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.

Example request
Terminal window
curl "https://api.trustcomponent.com/platform/v1/agencies/<agency_id>/events?pageSize=10" \
-H "Authorization: Bearer <your_api_key>"
Example request
import { TrustComponent } from '@trustcomponent/sdk';
const tc = new TrustComponent('<your_api_key>');
const events = await tc.platform.events.getEventsOfAgency({ agencyId: '<agency_id>', pageSize: 10 });
Example request
use TrustComponent\TrustComponent;
$tc = new TrustComponent('<your_api_key>');
$events = $tc->platform()->events()->getEventsOfAgency('<agency_id>', null, null, null, null, 10);
Example request
from uuid import UUID
from trustcomponent import TrustComponent
tc = TrustComponent("<your_api_key>")
events = tc.platform.events.get_events_of_agency(UUID("<agency_id>"), page_size=10)
Example request
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);
Example request
using TrustComponent;
using var tc = new TrustComponentClient("<your_api_key>");
var events = await tc.Platform.Events.GetEventsOfAgencyAsync(Guid.Parse("<agency_id>"), pageSize: 10);
Example request
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)
}
Example request
require 'trustcomponent'
tc = TrustComponent::Client.new('<your_api_key>')
events = tc.platform.events.get_events_of_agency('<agency_id>', page_size: 10)
Example request
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?;
Example response (200)
{
"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

NameTypeDescription
agencyIdrequiredstring (uuid)Id of the agency

Query parameters

NameTypeDescription
fromoptionalstringStart of the time range (inclusive), ISO 8601 in UTC. Defaults to 24 hours before to.
tooptionalstringEnd of the time range (inclusive), ISO 8601 in UTC. Defaults to now.
cursoroptionalstringPosition to continue after, taken from nextCursor of the previous response. When set, page is ignored.
pageoptionalintegerZero-based page index, ignored when cursor is set · 0 to ∞, default 0
pageSizeoptionalintegerNumber of entries per page · 1 to 1000, default 100

Response 200 · application/json

FieldTypeDescription
fromstringStart of the requested time range
tostringEnd of the requested time range
contentarray of objectEvents of this page, newest first
pageintegerZero-based index of this page
pageSizeintegerRequested number of entries per page
totalElementsintegerNumber of events in the whole time range
nextCursormay be nullstringPass as cursor to read the next page; null when this page is the last one

Status codes

StatusMeaning
200One page of events
400Invalid time range, cursor, page or page size
401API key missing (code: credentials_missing) or invalid (code: credentials_invalid)
402Audit log access not included in the plan (code: feature_not_included)
403The API key has no access to this agency or lacks its Auditor role (code: access_denied)
429Too many requests (code: rate_limit_exceeded); retry after the seconds in Retry-After
FieldMeaning
idUnique id of the event. An event is never delivered with two different ids, so use it to skip duplicates.
schemaVersion2 for events since API keys, automations and anonymous callers are told apart; 1 for older events, which only know USER and SYSTEM.
typeKind of the subject followed by the action, for example platform.user.authentication-failed.
subject / scopesThe 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.
originWhere in TrustComponent the event was recorded. Quote the traceId when you ask support about an event.
actorWho caused the event, see below.
changesThe fields the action changed. Secret values are never recorded; such a change has isRedacted: true.
detailsFacts 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 typeMeaning
USERA signed-in person, identified by userId.
API_KEYA request authenticated with an API key, identified by apiKeyId.
AUTOMATIONA 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.
ANONYMOUSA caller that is not signed in, for example a failed sign-in or a password reset through the link in an e-mail.
SYSTEMTrustComponent itself, when no more specific actor applies.