DevelopersAPI

@rustrak/client

The official TypeScript client for the Rustrak REST API: installation, authentication, typed errors and every method, generated from OpenAPI.

@rustrak/client is the official TypeScript client for the Rustrak REST API. It is generated from the server’s OpenAPI spec, so it has one method for every endpoint the server documents, validates requests and responses with Zod, retries transient failures, and returns a Result that never throws for an expected failure. HTTP is the platform’s fetch; the only runtime dependency is Zod.

npm install @rustrak/client
# or
pnpm add @rustrak/client
# or
yarn add @rustrak/client
Shell

Requirements: Node.js ≥ 20, TypeScript ≥ 5

Quick Start

Every method returns a Result<T, RustrakError>: a plain object that is either { success: true, data } or { success: false, error }. Check success before reading data, and TypeScript narrows the rest.

import { RustrakClient } from '@rustrak/client';

const client = new RustrakClient({
  baseUrl: 'https://your-rustrak-instance.example.com',
  token: process.env.RUSTRAK_API_TOKEN!,
});

const projects = await client.projects.list();
if (!projects.success) {
  console.error(projects.error.kind); // 'unauthenticated' | 'network' | ...
  return;
}

console.log(projects.data.items);
TypeScript

The shape deliberately mirrors Zod’s safeParse, and it is the same shape for every method.

Configuration

const client = new RustrakClient({
  baseUrl: 'https://rustrak.example.com', // required
  token: 'your-bearer-token',             // create one in Settings → Tokens; omit to use the session cookie
  timeout: 30000,                         // optional, ms per attempt (default: 30000)
  maxRetries: 2,                          // optional (default: 2)
  headers: {},                            // optional custom headers
});
TypeScript

Calling an endpoint

Methods hang off the client by area, client.<area>.<method>, and take one object holding the request’s parts, named exactly as the API names them:

const issues = await client.issues.list({
  path: { project_id: projectId },
  query: { sort: 'last_seen', order: 'desc', per_page: 50 },
});

const resolved = await client.issues.update({
  path: { project_id: projectId, issue_id: issueId },
  body: { status: 'resolved' },
});
TypeScript

Besides path, query and body, every method accepts headers and an AbortSignal as signal. The API reference below lists them all.

Paginating

let cursor: string | undefined;
do {
  const page = await client.events.list({
    path: { project_id: projectId, issue_id: issueId },
    query: { cursor },
  });
  if (!page.success) break; // a failed page is not an empty page

  process(page.data.items);
  cursor = page.data.next_cursor ?? undefined;
} while (cursor);
TypeScript

That break is the point of the whole API. Stopping on a failure is a decision the caller has to make, and it can no longer be skipped by accident.

Error Handling

There are no error classes. Every failure is one member of a single closed union, discriminated by kind:

import { isRetryable, type RustrakError } from '@rustrak/client';

const result = await client.projects.list();

if (!result.success) {
  switch (result.error.kind) {
    case 'unauthenticated':
      redirect('/login');           // ONLY this kind means "log in again"
      break;
    case 'rate_limited':
      wait(result.error.retryAfter ?? 30);
      break;
    case 'network':
      // Branch on `reason`, not on `message`: the message is a fixed string by
      // design, because the underlying one names the host and port.
      console.log(result.error.reason); // 'timeout' | 'unreachable'
      break;
    default:
      if (isRetryable(result.error)) scheduleRetry();
  }
}
TypeScript
kindHTTPRetryableDescription
validation400❌The server rejected the request
unauthenticated401❌No session, or an invalid/expired token
forbidden403❌Authenticated, but not allowed
not_found404❌The resource does not exist
conflict409❌Uniqueness violation: a taken name or slug
gone410❌The resource was retired
payload_too_large413❌Envelope ingestion only
rate_limited429✅Rate limit exceeded; carries retryAfter?: number
client_errorother < 500408 onlyAny sub-500 status no other member claims
server_error500+500, 502, 503, 504Any 5xx; the server’s own message is discarded
invalid_requestn/a❌Your input failed a pre-flight check; never sent
networkn/a✅DNS, connection refused, TLS, timeout, abort
invalid_responsen/a❌A 2xx arrived with a body the schema rejects

The union is closed, so a switch on kind with a default covers every case that exists. status is a plain number rather than a literal union, so a proxy-generated 502 or a future status is a value you can log rather than a type error.

What the union will not carry

DroppedWhy
the server’s 5xx messageIt can interpolate a pool error, an OS errno, or a filesystem path. Replaced by the fixed SERVER_ERROR_MESSAGE.
a cause on networkfetch builds that message by interpolating the request URL, which is your deployment’s internal host and port. Read reason instead.
Zod issues on invalid_responseThey embed the offending response body.

Field errors

A 4xx that blamed specific inputs carries fields, so a form can mark the input the server rejected instead of showing a toast the user has to translate back into an edit:

const created = await client.projects.create({ body: { name: 'My App' } });

if (!created.success && created.error.kind === 'conflict') {
  for (const field of created.error.fields ?? []) {
    console.log(field.field, field.code);
    // e.g. 'slug' 'already_exists'
  }
}
TypeScript

field is a dot path into the request body (slug, credentials.webhook_url), which is exactly what a form library’s setError takes. Pick the copy you show from (field, code) rather than from message; that is what makes it translatable. message is populated only for code: 'custom', where the code set genuinely cannot express the reason.

One rule when wiring this to a form: only call setError for names your form actually registers. A path naming an input the form does not have registers a phantom field that nothing can ever clear, and the form then refuses to submit with nothing on screen explaining why. Route the rest to a form-level error.

Escape hatches

import { unwrap, unwrapOr, mapResult } from '@rustrak/client';
TypeScript

unwrap throws on a failure: the caller explicitly opting back into exceptions. unwrapOr substitutes a fallback.

Do not reach for unwrapOr to make a page compile. unwrapOr(await client.projects.list(), []) renders the same empty state for “this account has no projects” and “the server is unreachable”, which is exactly the regression this API exists to prevent. It is appropriate only where the fallback is genuinely correct regardless of why the call failed: a cached-count optimisation, a best-effort telemetry read, a script that already logged the error.

Next.js Integration

These examples are for your own Next.js application calling a Rustrak server through the client. RUSTRAK_API_URL and RUSTRAK_API_TOKEN are your app’s settings: the server’s address and an API token.

A Result is a plain object with no prototype chain, so it survives structuredClone and therefore React’s server/client boundary. A thrown error class does not: it reaches the browser as an opaque digest, which is why returning the failure is the recommended shape.

Server Component

import { RustrakClient } from '@rustrak/client';
import { redirect } from 'next/navigation';

export default async function ProjectsPage() {
  const client = new RustrakClient({
    baseUrl: process.env.RUSTRAK_API_URL!,
    token: process.env.RUSTRAK_API_TOKEN!,
  });

  const projects = await client.projects.list();

  if (!projects.success) {
    // `kind` decides. Redirecting on 'network' or 'server_error' turns a flaky
    // connection into a login loop that logging in cannot fix.
    if (projects.error.kind === 'unauthenticated') redirect('/login'); // your app's sign-in page
    return <LoadFailed error={projects.error} />;
  }

  return <ProjectsList projects={projects.data.items} />;
}
TypeScript

Server Action

'use server';
import { RustrakClient } from '@rustrak/client';

export async function resolveIssue(projectId: number, issueId: string) {
  const client = new RustrakClient({
    baseUrl: process.env.RUSTRAK_API_URL!,
    token: process.env.RUSTRAK_API_TOKEN!,
  });

  // Returned as-is: the calling component gets the actual failure rather than
  // an "An error occurred in the Server Components render" digest.
  return client.issues.update({
    path: { project_id: projectId, issue_id: issueId },
    body: { status: 'resolved' },
  });
}
TypeScript

Client Component with SWR

'use client';
import useSWR from 'swr';

export function IssuesList({ projectId }: { projectId: number }) {
  // The fetcher never rejects, so SWR's `error` stays empty: the failure is in
  // `data`. Unwrap it in the fetcher if you want SWR's retry behaviour.
  const { data } = useSWR(['issues', projectId], () =>
    client.issues.list({ path: { project_id: projectId } }),
  );

  if (!data) return <Spinner />;
  if (!data.success) return <LoadFailed error={data.error} />;

  return <List items={data.data.items} />;
}
TypeScript

TypeScript Types

Every request and response type in the spec is exported under the name the spec gives it:

import type {
  ProjectResponse,
  IssueResponse,
  EventDetailResponse,
  IssuesListData,      // what client.issues.list takes
  IssuesListResponse,  // what it returns on success
  // the Result API
  Result,
  RustrakError,
  RustrakErrorKind,
  FieldError,
  FieldErrorCode,
} from '@rustrak/client';
TypeScript

Value exports for the same API: Ok, Err, unwrap, unwrapOr, mapResult, isRetryable, FIELD_ERROR_CODES, SERVER_ERROR_MESSAGE, NETWORK_ERROR_MESSAGE, TIMEOUT_ERROR_MESSAGE.

API Reference

Every method, grouped as it hangs off the client.

Access

MethodEndpointDescription
access.catalog()GET /api/access/catalogLists every resource a permission can name, with its module, scope and actions.
access.me()GET /api/access/meReturns what the caller may do, on the instance and on each project.
roles.create({ body })POST /api/rolesCreates a role from permissions the caller holds themselves.
roles.delete({ path })DELETE /api/roles/{id}Deletes a role nobody holds.
roles.list()GET /api/rolesLists every role with its permissions and how often it is assigned.
roles.update({ path, body })PUT /api/roles/{id}Replaces a role’s name, description and permissions.
users.assignments({ path })GET /api/users/{id}/assignmentsLists the roles a user holds, on the instance and on each project.
users.setAssignments({ path, body })PUT /api/users/{id}/assignmentsReplaces every role and personal permission a user holds.

Agents

MethodEndpointDescription
agents.conversation({ path })GET /api/projects/{project_id}/agents/conversations/{conversation_id}Returns every AI span of a conversation’s turns, oldest first, with its input and output.
agents.conversations({ path, query? })GET /api/projects/{project_id}/agents/conversationsLists conversations — traces sharing a gen_ai.conversation.id — the most recently active first.
agents.duration({ path, query? })GET /api/projects/{project_id}/agents/durationTime-bucketed avg/p95 duration for agent/ai_client spans.
agents.environments({ path })GET /api/projects/{project_id}/agents/environmentsThe options the environment filter offers, read from the data rather than hardcoded — an installation may name its environments anything.
agents.modelsCalls({ path, query? })GET /api/projects/{project_id}/agents/models/callsTop models by LLM call count (gen_ai.operation.type:ai_client).
agents.modelsTable({ path, query? })GET /api/projects/{project_id}/agents/modelsLists the AI models a project’s agents called, with requests, tokens and latency.
agents.modelsTokens({ path, query? })GET /api/projects/{project_id}/agents/models/tokensTop models by total tokens used (gen_ai.operation.type:ai_client).
agents.runs({ path, query? })GET /api/projects/{project_id}/agents/runsTime-bucketed count of agent-run spans (gen_ai.operation.type:agent).
agents.summary({ path, query? })GET /api/projects/{project_id}/agents/summaryAgent runs, LLM calls, tool calls, errors, tokens and latency over the selected window — the numbers the six charts cannot state outright.
agents.tools({ path, query? })GET /api/projects/{project_id}/agents/toolsTop tools by call count (gen_ai.operation.type:tool).
agents.toolsTable({ path, query? })GET /api/projects/{project_id}/agents/tools/statsLists the tools a project’s agents called, with calls, errors and latency.
agents.traces({ path, query? })GET /api/projects/{project_id}/agents/tracesPaginated per-trace_id aggregate (duration, tokens, tool usage) across all AI spans sharing that trace, regardless of origin.

Alert Channels

MethodEndpointDescription
alertChannels.create({ body })POST /api/integrationsCreates a notification integration (webhook, Slack, email…).
alertChannels.delete({ path })DELETE /api/integrations/{id}Deletes a notification integration.
alertChannels.get({ path })GET /api/integrations/{id}Gets one notification integration.
alertChannels.list()GET /api/integrationsLists the channels alerts can go through.
alertChannels.previewTemplate({ body })POST /api/integrations/preview-templateRenders a Custom Webhook template against a sample payload and hands back the body that would be sent.
alertChannels.test({ path, body })POST /api/integrations/{id}/testSends a test notification through an integration.
alertChannels.update({ path, body })PATCH /api/integrations/{id}Updates a notification integration.

Alert Rules

MethodEndpointDescription
alertRules.create({ path, body })POST /api/projects/{project_id}/alert-rulesCreates an alert rule in a project.
alertRules.delete({ path })DELETE /api/projects/{project_id}/alert-rules/{rule_id}Deletes an alert rule.
alertRules.get({ path })GET /api/projects/{project_id}/alert-rules/{rule_id}Gets one alert rule.
alertRules.historyByDay({ path, query? })GET /api/projects/{project_id}/alert-history/dailyCount a project’s alert deliveries per day, by outcome.
alertRules.list({ path })GET /api/projects/{project_id}/alert-rulesLists a project’s alert rules.
alertRules.listHistory({ path, query? })GET /api/projects/{project_id}/alert-historyLists the alerts a project sent, newest first.
alertRules.update({ path, body })PATCH /api/projects/{project_id}/alert-rules/{rule_id}Updates an alert rule.

Auth

MethodEndpointDescription
auth.acceptInvitation({ body })POST /auth/accept-invitationAccept a pending invitation: creates the user (with the invite’s email + role) and logs in.
auth.changePassword({ body })POST /auth/me/passwordChange the current user’s password.
auth.confirmSsoLink({ body })POST /auth/sso/linkLink the pending SSO identity to its account once the account’s password is given, and sign in.
auth.getCurrentUser()GET /auth/meGet current authenticated user
auth.getInvitation({ path })GET /auth/invitation/{token}Returns the invitation’s details if it is still acceptable (for the accept page).
auth.login({ body })POST /auth/loginAuthenticate user and create session
auth.logout()POST /auth/logoutClear session
auth.ssoCallback({ query? })GET /auth/sso/callbackValidate the provider response, resolve or provision the local account, and establish the normal Rustrak session.
auth.ssoConfig()GET /auth/sso/configPublic, non-sensitive information used to render the login page.
auth.ssoLink()GET /auth/sso/linkThe account an SSO login matched, shown while its owner confirms.
auth.ssoStart()POST /auth/sso/startCreate a one-time OIDC authorization request and retain its protections in the session.
auth.updateCurrentUser({ body })PATCH /auth/meUpdate the current user’s presentation preferences

Events

MethodEndpointDescription
events.downloadAttachment({ path })GET /api/projects/{project_id}/attachments/{attachment_id}Downloads an attachment.
events.get({ path })GET /api/projects/{project_id}/issues/{issue_id}/events/{event_id}Gets a single event with full data
events.getBySentryId({ path })GET /api/projects/{project_id}/events/sentry/{event_id}Resolve the ID returned by a Sentry SDK without already knowing the issue.
events.list({ path, query? })GET /api/projects/{project_id}/issues/{issue_id}/eventsLists events for an issue with cursor-based pagination
events.listAttachments({ path })GET /api/projects/{project_id}/issues/{issue_id}/events/{event_id}/attachmentsLists the files sent with an event, such as a feedback’s screenshot.

GitHub

MethodEndpointDescription
github.callback({ query })GET /api/github/callbackGitHub sends the browser here after creating the app; the code trades for its credentials.
github.createIssue({ path, body })POST /api/projects/{project_id}/issues/{issue_id}/github/issuesOpens a GitHub issue and links it.
github.deleteProjectRepository({ path })DELETE /api/projects/{project_id}/githubUnlinks a project from its GitHub repository.
github.disconnect()DELETE /api/githubDisconnects the GitHub App from this instance.
github.getMyLogin()GET /api/github/meThe GitHub username assignees sync through.
github.getProjectRepository({ path })GET /api/projects/{project_id}/githubGets the GitHub repository a project is linked to.
github.installed({ query })GET /api/github/installedGitHub sends the browser here after the app is installed on an account.
github.issue({ path })GET /api/projects/{project_id}/issues/{issue_id}/githubThe issue’s links, the commits that may have caused it, and who owns its culprit file.
github.issueDraft({ path })GET /api/projects/{project_id}/issues/{issue_id}/github/draftWhat creating a GitHub issue sends by default, with the templates applied, for the person to edit first.
github.linkIssue({ path, body })POST /api/projects/{project_id}/issues/{issue_id}/github/linksLinks an existing GitHub issue or pull request.
github.manifest({ body })POST /api/github/manifestWhat the dashboard posts to GitHub so GitHub creates an app already configured for this server.
github.putIssueTemplate({ body })PUT /api/github/issue-templateThe labels, title prefix and body footer every GitHub issue starts with, before a project’s own.
github.putMyLogin({ body })PUT /api/github/meSets or clears the caller’s GitHub username, which assignees sync through.
github.putProjectRepository({ path, body })PUT /api/projects/{project_id}/githubLinks a project to a GitHub repository.
github.repositories({ query })GET /api/github/repositoriesThe repositories a project can point at, for whoever may change that project’s settings.
github.status()GET /api/githubShows whether a GitHub App is connected, and how.
github.syncCodeowners({ path })POST /api/projects/{project_id}/github/codeownersCopies the repository’s CODEOWNERS so ownership can be answered without asking GitHub each time.
github.unlinkIssue({ path })DELETE /api/projects/{project_id}/issues/{issue_id}/github/links/{link_id}
github.webhook({ body })POST /api/github/webhookPublic, and trusted only through the signature GitHub computes with the app’s webhook secret.

Health

MethodEndpointDescription
health.liveness()GET /healthLiveness check - is the process running?
health.readiness()GET /health/readyReadiness check - is the service ready to handle requests?
health.version()GET /health/versionVersion check - returns the server version compiled from Cargo.toml.

Invitations

MethodEndpointDescription
invitations.create({ body })POST /api/invitationsCreate an invitation (needs invitations:create)
invitations.emailStatus()GET /api/invitations/email-statusWhether invitation emails can be sent (needs invitations:read)
invitations.list()GET /api/invitationsList invitations (needs invitations:read)
invitations.resend({ path })POST /api/invitations/{id}/resendEmail the invite link again (needs invitations:create)
invitations.revoke({ path })DELETE /api/invitations/{id}Revoke a pending invitation (needs invitations:delete)

Issues

MethodEndpointDescription
environments.list({ path })GET /api/projects/{project_id}/environmentsLists the environments a project’s issues have been seen in, by name.
feedback.list({ path, query? })GET /api/projects/{project_id}/feedbackLists user feedback with what each user submitted.
feedback.listAll({ query? })GET /api/feedbackLists user feedback across every project the reader can read issues on.
issues.bulkDelete({ path, body })DELETE /api/projects/{project_id}/issuesDeletes many issues at once, selected by id or by filter.
issues.bulkUpdate({ path, body })PUT /api/projects/{project_id}/issuesSets the status or priority of many issues at once, by id.
issues.createComment({ path, body })POST /api/projects/{project_id}/issues/{issue_id}/commentsAdd a note.
issues.createUserReport({ path, body })POST /api/projects/{project_id}/issues/{issue_id}/user-reportsAttach user feedback to an issue.
issues.delete({ path })DELETE /api/projects/{project_id}/issues/{issue_id}Hard-deletes an issue and all associated events
issues.get({ path })GET /api/projects/{project_id}/issues/{issue_id}Gets a single issue by ID
issues.getActivity({ path })GET /api/projects/{project_id}/issues/{issue_id}/activityChronological activity log (incl. comments).
issues.getAggregates({ path })GET /api/projects/{project_id}/issues/{issue_id}/aggregatesReturns the unique user count and top tags for the issue.
issues.getHashes({ path })GET /api/projects/{project_id}/issues/{issue_id}/hashesLists the grouping hashes that map to an issue.
issues.getStats({ path, query? })GET /api/projects/{project_id}/issues/{issue_id}/statsZero-filled event-count timeseries.
issues.getTagValues({ path })GET /api/projects/{project_id}/issues/{issue_id}/tags/{key}Lists the distinct values (with counts) for a tag key across the issue.
issues.list({ path, query? })GET /api/projects/{project_id}/issuesLists issues for a project with offset-based pagination
issues.listAll({ query? })GET /api/issuesLists issues across every project the reader can read issues on, in the same shape and pages as a project’s list.
issues.listUserReports({ path, query? })GET /api/projects/{project_id}/issues/{issue_id}/user-reportsList user feedback for an issue.
issues.markSeen({ path })POST /api/projects/{project_id}/issues/{issue_id}/seenMark the issue as seen by the current user.
issues.setBookmark({ path, body })PUT /api/projects/{project_id}/issues/{issue_id}/bookmarkSet/clear the per-user bookmark.
issues.setSubscription({ path, body })PUT /api/projects/{project_id}/issues/{issue_id}/subscriptionSet/clear the per-user subscription.
issues.update({ path, body })PATCH /api/projects/{project_id}/issues/{issue_id}Updates issue state (resolve, mute, etc.)

Logs

MethodEndpointDescription
logs.attributeValues({ path })GET /api/projects/{project_id}/logs/attributes/{key}/valuesLists the values a string attribute takes in a project’s recent logs, the most common first.
logs.attributes({ path })GET /api/projects/{project_id}/logs/attributesLists the attributes a project’s recent logs carry, each with its type, for the search to offer as filters.
logs.get({ path })GET /api/projects/{project_id}/logs/{log_id}Returns one of a project’s logs, wherever it falls in the list.
logs.list({ path, query? })GET /api/projects/{project_id}/logsLists logs for a project with offset-based pagination (newest first by log timestamp), optionally filtered by level, trace id, message and window.
logs.volume({ path, query? })GET /api/projects/{project_id}/logs/volumeCounts a project’s logs per level over time, with the list’s filters.

Members

MethodEndpointDescription
members.candidates({ path })GET /api/projects/{project_id}/members/candidatesLists the people and the roles the caller can give on the project, so it takes neither users:read nor roles:read to manage its members.
members.list({ path })GET /api/projects/{project_id}/membersLists everyone holding a role on the project, with those roles; personal permissions are not roles.
members.remove({ path })DELETE /api/projects/{project_id}/members/{user_id}Removes the roles a user holds on this project; roles on all projects and personal permissions stay.
members.upsert({ path, body })PUT /api/projects/{project_id}/membersSets the roles a user holds on the project.

Monitors

MethodEndpointDescription
monitors.create({ path, body })POST /api/projects/{project_id}/monitorsCreates a cron monitor in a project.
monitors.delete({ path })DELETE /api/projects/{project_id}/monitors/{slug}Deletes a cron monitor and its check-ins.
monitors.get({ path })GET /api/projects/{project_id}/monitors/{slug}Gets one cron monitor.
monitors.list({ path })GET /api/projects/{project_id}/monitorsLists a project’s cron monitors.
monitors.listCheckins({ path, query? })GET /api/projects/{project_id}/monitors/{slug}/checkinsLists a cron monitor’s check-ins, newest first.
monitors.stats({ path, query? })GET /api/projects/{project_id}/monitor-statsCounts the check-ins of a project’s monitors by status over a window, bucket by bucket.
monitors.update({ path, body })PUT /api/projects/{project_id}/monitors/{slug}Updates a cron monitor.

OAuth

MethodEndpointDescription
oauth.decideAuthorization({ body })POST /api/oauth/authorizeApproves or denies an authorization request as the signed-in user.
oauth.getAuthorization({ query })GET /api/oauth/authorizeVerifies an authorization request and says who is asking.
oauth.listGrants()GET /api/oauth/grantsLists the assistants connected to the signed-in user’s account.
oauth.revokeGrant({ path })DELETE /api/oauth/grants/{id}Disconnects an assistant: its tokens stop working at once.

Projects

MethodEndpointDescription
projects.create({ body })POST /api/projectsCreate a new project
projects.delete({ path })DELETE /api/projects/{id}Delete a project.
projects.get({ path })GET /api/projects/{id}Get a project by ID
projects.getRateLimits()GET /api/rate-limitsWhat a project without limits of its own follows
projects.list({ query? })GET /api/projectsList projects with pagination.
projects.update({ path, body })PATCH /api/projects/{id}Update a project

Releases

MethodEndpointDescription
releases.create({ path, body })POST /api/0/projects/{org_slug}/{project_slug}/releases/Sentry-compatible release creation.
releases.createDeploy({ path, body })POST /api/0/organizations/{org_slug}/releases/{version}/deploys/Records that a release went out to an environment, in each of its projects or the listed ones: sentry-cli releases deploys new.
releases.createInOrganization({ path, body })POST /api/0/organizations/{org_slug}/releases/Creates a release in each listed project, as sentry-cli releases new does.
releases.deleteInOrganization({ path })DELETE /api/0/organizations/{org_slug}/releases/{version}/Deletes a release from every project that has it, unless an issue started in it or it has health data, as Sentry refuses to.
releases.finalize({ path, body })PUT /api/0/projects/{org_slug}/{project_slug}/releases/{version}/Generic partial update (ref, url, dateReleased).
releases.get({ path, query? })GET /api/projects/{project_id}/releases/{release}Gets one release with its events, new issues, environments and session health.
releases.getInOrganization({ path })GET /api/0/organizations/{org_slug}/releases/{version}/Across the projects the caller can read, as sentry-cli releases info reads it.
releases.list({ path, query? })GET /api/projects/{project_id}/releasesLists a project’s releases, newest first, with the events, new issues, environments and session health of each.
releases.listCommits({ path })GET /api/0/organizations/{org_slug}/releases/{version}/commits/Commits in the order they were set: sentry-cli releases info --show-commits.
releases.listDeploys({ path })GET /api/0/organizations/{org_slug}/releases/{version}/deploys/Deploys, the latest per project and environment: sentry-cli releases deploys list.
releases.listInOrganization({ path })GET /api/0/organizations/{org_slug}/releases/The releases of every project the caller can read, newest first: sentry-cli releases list without a project.
releases.listInProject({ path })GET /api/0/projects/{org_slug}/{project_slug}/releases/One project’s releases, newest first: sentry-cli releases list with a project.
releases.newIssues({ path, query? })GET /api/projects/{project_id}/releases/{release}/new-issuesLists the issues first seen in a release.
releases.previousWithCommits({ path })GET /api/0/organizations/{org_slug}/releases/{version}/previous-with-commits/The release before this one that has commits, or {}: where sentry-cli releases set-commits starts reading git.
releases.updateInOrganization({ path, body })PUT /api/0/organizations/{org_slug}/releases/{version}/Updates a release in every project that has it: ref, url and dateReleased, which is what sentry-cli releases finalize sends.

Saved Views

MethodEndpointDescription
savedViews.create({ path, body })POST /api/projects/{project_id}/viewsSaves a project page’s address as a view, personal unless visibility is project.
savedViews.delete({ path })DELETE /api/projects/{project_id}/views/{view_id}Deletes a project view.
savedViews.list({ path, query })GET /api/projects/{project_id}/viewsLists the views of one project page the caller sees: their own and the shared ones.
savedViews.setDefault({ path, body })PUT /api/projects/{project_id}/views/defaultSets or clears the view a project page opens on, for the caller or the project.
savedViews.update({ path, body })PATCH /api/projects/{project_id}/views/{view_id}Renames a project view, or changes its address or who sees it.
workspaceViews.create({ body })POST /api/viewsSaves a workspace page’s address as a view, personal unless visibility is project.
workspaceViews.delete({ path })DELETE /api/views/{view_id}Deletes a workspace view.
workspaceViews.list({ query })GET /api/viewsLists the views of one workspace page (one that spans every project).
workspaceViews.setDefault({ body })PUT /api/views/defaultSets or clears the view a workspace page opens on, for the caller or everyone.
workspaceViews.update({ path, body })PATCH /api/views/{view_id}Renames a workspace view, or changes its address or who sees it.

Schedules

MethodEndpointDescription
schedules.preview({ body })POST /api/schedules/previewValidates a schedule and lists its next five runs from now, so no client ever parses a crontab itself.

Sentry API

MethodEndpointDescription
sentry.getIssue({ path })GET /api/0/issues/{issue_id}/One issue with its releases and its 24h and 30d series (Sentry’s GroupDetailsEndpoint).
sentry.getLatestEvent({ path })GET /api/0/issues/{issue_id}/events/latest/The issue’s most recent event (Sentry’s GroupEventDetailsEndpoint, issues/endpoints/group_event_details.py).
sentry.listIssues({ path, query? })GET /api/0/projects/{org_slug}/{project_slug}/issues/Issues, filtered by query, sorted by sort and paginated by cursor (Sentry’s ProjectGroupIndexEndpoint, issues/endpoints/project_group_index.py).
sentry.listOrganizationIssues({ path, query? })GET /api/0/organizations/{org_slug}/issues/Issues across projects, narrowed by project, filtered by query, sorted by sort and paginated by cursor (Sentry’s OrganizationGroupIndexEndpoint, issues/endpoints/organization_group_index.py).
sentry.listOrganizations()GET /api/0/organizations/The organizations the token belongs to (Sentry’s OrganizationIndexEndpoint): always the one synthetic org.
sentry.listProjects({ query? })GET /api/0/projects/The projects the token can see, newest first (Sentry’s ProjectIndexEndpoint, core/endpoints/project_index.py).
sentry.listRepos({ path })GET /api/0/organizations/{org_slug}/repos/The code repositories connected to the organization (Sentry’s OrganizationRepositoriesEndpoint).
sentry.openIssue({ path })GET /{org_slug}/{project_slug}/issues/{issue_id}The issue page GitLab’s “View in Sentry” opens: Sentry redirects this legacy path to the issue (static/app/router/routes.tsx), Rustrak to its dashboard.
sentry.submitUserFeedback({ path, body })POST /api/0/projects/{org_slug}/{project_slug}/user-feedback/Submit a user report about an error event (Sentry’s ProjectUserReportsEndpoint, feedback/endpoints/project_user_reports.py).
sentry.updateIssue({ path, body })PUT /api/0/issues/{issue_id}/Sets an issue’s status and returns the issue (Sentry’s GroupDetailsEndpoint.put).

Sessions

MethodEndpointDescription
sessions.getStats({ path, query? })GET /api/projects/{project_id}/sessions/statsSession counts by release, for release health.
sessions.getSummary({ path, query? })GET /api/projects/{project_id}/sessions/summaryTotals and crash-free rates for a project’s sessions.
sessions.getTimeseries({ path, query? })GET /api/projects/{project_id}/sessions/timeseriesSession counts over time, bucketed for a chart.

Settings

MethodEndpointDescription
settings.getMcp()GET /api/settings/mcpWhether the MCP endpoint at /mcp is on.
settings.updateMcp({ body })PUT /api/settings/mcpTurns the MCP endpoint at /mcp on or off (needs mcp:update).
MethodEndpointDescription
sidebar.getProjects()GET /api/sidebar/projectsHow your sidebar lists the projects.
sidebar.updateProjects({ body })PUT /api/sidebar/projectsReplace how your sidebar lists the projects.

Source Maps

MethodEndpointDescription
debugFiles.assemble({ path, body })POST /api/0/projects/{org_slug}/{project_slug}/files/difs/assemble/Assemble uploaded chunks into debug information files (ProGuard mappings, JVM source bundles).
debugFiles.upload({ path, body })POST /api/0/projects/{org_slug}/{project_slug}/files/dsyms/Upload a zip of debug information files (the path sentry-cli upload-proguard takes).
sourceMaps.artifactBundleAssemble({ path, body })POST /api/0/organizations/{org_slug}/artifactbundle/assemble/Assembles uploaded chunks into an artifact bundle (sentry-cli sourcemaps upload).
sourceMaps.chunkUpload({ path, body })POST /api/0/organizations/{org_slug}/chunk-upload/Receives chunks of a source map or debug file upload from sentry-cli.
sourceMaps.chunkUploadCapability({ path })GET /api/0/organizations/{org_slug}/chunk-upload/Describes how sentry-cli should upload chunks: size, concurrency and accepted kinds.
sourceMaps.list({ path })GET /api/0/projects/{org_slug}/{project_slug}/files/source-maps/Lists a project’s uploaded source map artifacts (sentry-cli).
sourceMaps.orgDetails({ path })GET /api/0/organizations/{org_slug}/Always returns 200 with synthetic org data — sentry-cli validates this before uploading.

Spans

MethodEndpointDescription
spans.get({ path })GET /api/projects/{project_id}/spans/{span_id}Returns one span together with its attributes and tags — the gen_ai.* payload (prompts, responses, tool arguments and results) that the list response deliberately omits, since spans.data is untrimmed and a whole trace’s worth of it would dwarf the waterfall it is drawn from.
spans.list({ path, query? })GET /api/projects/{project_id}/spansLists spans for a project with offset-based pagination (newest by start_timestamp first), optionally filtered by op/status/trace_id, over a window of 90 days at most (every span of a trace when only trace_id is given).

Stats

MethodEndpointDescription
stats.getEventTimeseries({ path, query? })GET /api/projects/{project_id}/events/statsCounts a project’s events over time, bucketed for a chart.
stats.getSummary({ path, query? })GET /api/projects/{project_id}/stats/summaryHeadline figures for a project’s overview: events, new and open issues.

Storage

MethodEndpointDescription
storage.compact()POST /api/storage/compactionGives the space deleted data held back to the disk: on SQLite it rewrites a file created before incremental mode, on Postgres it rewrites each table retention deletes from (VACUUM FULL), locking that table while it does.
storage.executeCleanup({ body })POST /api/storage/cleanupStarts deleting old data and the issues it empties.
storage.gcSourceMaps()POST /api/storage/source-maps/gcDelete orphaned source maps (DB + disk).
storage.getAge()GET /api/storage/ageRows per age bucket, per project and kind.
storage.getCleanupStatus()GET /api/storage/cleanup/statusProgress of the running cleanup, or the outcome of the last one.
storage.getCompaction()GET /api/storage/compactionWhether the database file shrinks when data is deleted, and the disk a one-off compaction needs.
storage.getPlugins()GET /api/storage/pluginsLists each installed plugin’s data: its file, its quota, and its history (the tables with created_at) against its retention.
storage.getProjects()GET /api/storage/projectsPer-project counts and estimated weight.
storage.getRetention()GET /api/storage/retentionGets the retention settings and the cleanup schedule.
storage.getSummary()GET /api/storage/summaryRow counts, DB size, and source-map weight.
storage.previewCleanup({ body })POST /api/storage/cleanup/previewDry-run count, mutates nothing.
storage.previewRetention({ body })POST /api/storage/retention/previewWhat saving these settings would delete on the next cleanup, without saving or deleting anything.
storage.previewSourceMapGc()POST /api/storage/source-maps/gc/previewDry-run orphan count, deletes nothing.
storage.runRetention()POST /api/storage/retention/runEnforces the saved retention now, without waiting for the schedule.
storage.updateRetention({ body })PUT /api/storage/retentionUpdates the retention settings; the next cleanup is scheduled at once.

Team

MethodEndpointDescription
team.deleteUser({ path })DELETE /api/team/{user_id}Remove a user from the instance (needs users:delete)
team.list()GET /api/teamList all users (needs users:read)
team.updateRole({ path, body })PATCH /api/team/{user_id}/roleChange a user’s global role (needs users:update)

Telemetry

MethodEndpointDescription
telemetry.preview()GET /api/telemetry/previewShows the exact anonymous telemetry report this instance would send.

Tokens

MethodEndpointDescription
tokens.create({ body })POST /api/tokensCreate a new token (from a signed-in session only)
tokens.delete({ path })DELETE /api/tokens/{id}Revoke a token
tokens.get({ path })GET /api/tokens/{id}Token details, masked
tokens.list()GET /api/tokensList tokens (masked)

Transactions

MethodEndpointDescription
transactions.get({ path })GET /api/projects/{project_id}/transactions/{transaction_id}Returns a single transaction with its full Sentry payload (spans, contexts, measurements, tags) for the performance detail view.
transactions.getOverview({ path, query? })GET /api/projects/{project_id}/transactions/overviewReturns how the project is doing over a window: calls, failure rate, p50 and p95 against the window of the same length just before it, and the window’s trend bucket by bucket.
transactions.getQuery({ path, query? })GET /api/projects/{project_id}/transactions/queries/{group}Returns one query shape over a window: how often it ran, its average and p95, its trend, the endpoints and jobs it runs in and its slowest calls.
transactions.getSpans({ path })GET /api/projects/{project_id}/transactions/{transaction_id}/spansReturns the indexed spans extracted from a transaction, ordered for the waterfall view (by start_timestamp ascending).
transactions.getStatGroup({ path, query })GET /api/projects/{project_id}/transactions/stats/groupReturns the aggregate stats for a single transaction group — a direct lookup so the summary header works regardless of how many groups the project has.
transactions.getStatGroupBreakdown({ path, query })GET /api/projects/{project_id}/transactions/stats/group/breakdownReturns where one endpoint’s time goes, averaged per call over its latest calls in the window: database, outgoing HTTP, cache, templates and the app’s own code.
transactions.getStatGroupTimeseries({ path, query })GET /api/projects/{project_id}/transactions/stats/group/timeseriesReturns one endpoint’s trend over the window, every bucket present: how often it ran and failed, and its p50 and p95.
transactions.getStats({ path, query? })GET /api/projects/{project_id}/transactions/statsReturns paginated aggregate performance stats (count, time spent, p50/p95/p99 latency, failure rate) grouped by transaction name + op, the most time spent first unless sort asks otherwise.
transactions.list({ path, query? })GET /api/projects/{project_id}/transactionsLists transactions for a project with offset-based pagination (newest or slowest first), over a window of 90 days at most.
transactions.listQueries({ path, query? })GET /api/projects/{project_id}/transactions/queriesLists the database queries of a window grouped by their shape (values, comments and layout taken out), the most time spent in the database first, with how often each ran, its average, its slowest run and its share of that time.

Web Vitals

MethodEndpointDescription
webVitals.getBreakdown({ path, query })GET /api/projects/{project_id}/web-vitals/breakdownReturns one vital on each device or on each browser: where it is good and where it is not, the most measured first.
webVitals.getSummary({ path, query? })GET /api/projects/{project_id}/web-vitalsReturns the project’s performance score over the window, or one page’s, with each vital’s 75th percentile and the spread around it, average score and how many of its measurements rate good, needing improvement and poor.
webVitals.getTimeseries({ path, query? })GET /api/projects/{project_id}/web-vitals/timeseriesReturns how the window’s measurements rate bucket by bucket, every bucket present: how many were good, needed improvement and were poor.
webVitals.listPages({ path, query? })GET /api/projects/{project_id}/web-vitals/pagesReturns the pages with web vitals in the window, the one whose improvement would raise the project’s score the most first, or its score for one vital when vital names it.
webVitals.listSamples({ path, query? })GET /api/projects/{project_id}/web-vitals/samplesReturns the window’s worst measurements, ten at most, with where each happened: the page and its URL, the element, the browser, the device, the network and the page load’s transaction.
webVitals.listTargets({ path, query? })GET /api/projects/{project_id}/web-vitals/targetsReturns what the window’s vitals were about: an LCP’s element and the resource it loaded, a layout shift’s element, an interaction’s target.

plugins

MethodEndpointDescription
plugins.configure({ path, body })PUT /api/settings/plugins/{plugin}Chooses where an installed plugin runs.
plugins.install({ body })POST /api/settings/pluginsInstalls a plugin package, or replaces the installed version of it.
plugins.installFromRegistry({ path })POST /api/settings/plugins/registry/{plugin}Installs a published plugin, its newest version this Rustrak runs, verified against the signed index.
plugins.list()GET /api/pluginsLists the installed plugins and what each adds to the dashboard.
plugins.projectSettings({ path })GET /api/projects/{project_id}/plugin-settings/{plugin}Reads a plugin’s settings in one project, without its secrets.
plugins.registry()GET /api/settings/plugins/registryLists the plugins the signed registry publishes, with the version this Rustrak runs.
plugins.registryReadme({ path })GET /api/settings/plugins/registry/{plugin}/readmeReads a published plugin’s README before it is installed, from the package the signed index lists.
plugins.setProjectSettings({ path, body })PUT /api/projects/{project_id}/plugin-settings/{plugin}Writes a plugin’s settings in one project: only its project settings.
plugins.setSettings({ path, body })PUT /api/settings/plugins/{plugin}/settingsWrites a plugin’s settings for the whole instance, checked against its schema.
plugins.settings({ path })GET /api/settings/plugins/{plugin}/settingsReads a plugin’s settings for the whole instance, without its secrets.
plugins.uninstall({ path, query? })DELETE /api/settings/plugins/{plugin}Uninstalls a plugin, keeping its data unless purge.
  • MCP server: built into the Rustrak server; gives Claude, Cursor and other MCP clients direct access to your instance
  • API Reference: Full REST API documentation
  • API Tokens: How to create and manage tokens
Esc

Type to search guides, configuration and the API.