Skip to content
NewNexus 2.0 is here, and it’s open source. Read the launch post

API reference

Audit log

The append-only audit log: who changed what, through which credential, from which surface, before and after.

View as Markdown

List audit events

get/v1/audit

The audit log, newest first: everything for owners and admins, a lead's teams (and those under them), else your own actions.

audit.read_ownEvery memberTry it in the API Explorer

Parameters

  • sincequery · string

    ISO time, or relative: 30m, 24h, 7d, 2w

  • untilquery · string

    ISO time, or relative

  • actionquery · string

    An action, a comma-separated list, or a prefix ending in * (team.*)

  • actorquery · string

    The actor's user id or email

  • targetquery · string

    The target's id or slug

  • teamquery · string

    A team slug or id: events of that team and every team under it

  • limitquery · integer

    Events per page, 1 to 500 (default 50)

  • cursorquery · string

    NextCursor from the previous page

Responses

200OKapplication/json

  • scope"all" | "team" | "own"required
  • eventsarray of AuditEventrequired
    • idstringrequired
    • atstring (date-time)required
    • actorobjectrequired
      • userIdstring
      • emailstring

        Filled in when the log is read, from the person's user record: a new event stores the actor by user id alone. Absent for an erased person and for an operator in a customer's log.

      • keyIdstringrequired

        The credential: a token id, ui (Nexus UI's server), a module's scoped key (scoped:<product>/<capability>/smk_…), a sandbox session's id (sbs_…), an agent link (agl_…), github, clerk or system

      • kind"person" | "api_key" | "cli" | "ui" | "module" | "service" | "sandbox" | "operator" | "agent" | "platform" | "system"required
      • erasedboolean

        True when the person was erased: no email is shown for them.

    • surface"api" | "cli" | "mcp" | "ui" | "chat" | "webhook" | "system"required
    • action"org.created" | "org.settings_changed" | "org.recovery_key_changed" | "org.team_key_rotated" | "synced_session.audit_read" | "synced_session.made_private" | "synced_session.made_team_visible" | "cloud_history.break_glass_read" | "devices.recovered" | "org.budget_changed" | "app.cap_changed" | "app.claim_requested" | "app.deleted" | "budget.person_default_changed" | "budget.person_limit_changed" | "budget.team_changed" | "budget.product_changed" | "budget.limit_manager_granted" | "budget.limit_manager_revoked" | "org.owner_transferred" | "org.relinked" | "member.joined" | "member.role_changed" | "member.removed" | "member.recovered" | "account.deleted" | "member.default_team_changed" | "invitation.sent" | "invitation.revoked" | "domain.added" | "domain.removed" | "key.created" | "key.revoked" | "provider_key.added" | "provider_key.replaced" | "provider_key.disabled" | "provider_key.enabled" | "provider_key.removed" | "provider_key.rejected" | "connector_credential.added" | "connector_credential.replaced" | "connector_credential.revoked" | "connector_credential.needs_reconnect" | "vault.master_changed" | "auth.device_approved" | "auth.device_denied" | "auth.token_issued" | "auth.token_revoked" | "policy.changed" | "policy.control_set" | "policy.control_cleared" | "team.created" | "team.updated" | "team.moved" | "team.deleted" | "team.member_added" | "team.member_role_changed" | "team.member_removed" | "team.pending_added" | "team.pending_cancelled" | "team.import_applied" | "github.installation_linked" | "github.installation_unlinked" | "github.installation_removed" | "github.repositories_changed" | "chat_workspace.installed" | "chat_workspace.confirmed" | "chat_workspace.revoked" | "chat_workspace.token_refresh_failed" | "chat_channel.bound" | "chat_channel.unbound" | "chat_channel.moved" | "chat_workspace.runtime_read" | "chat_workspace.revoke_refused" | "chat.session_created" | "chat.session_deleted" | "artifact.shared" | "artifact.updated" | "artifact.revoked" | "artifact.continued" | "subsidy.granted" | "subsidy.used" | "subsidy.paid" | "subsidy.expired" | "credit.purchased" | "credit.reversed" | "credit.restored" | "credit.auto_topup_changed" | "artifact.access_changed" | "artifact.access_requested" | "artifact.reported" | "ledger.reservation_released" | "ledger.reservation_settled_late" | "connector_grant.granted" | "connector_grant.revoked" | "connector_availability.changed" | "connector.write" | "connector.write_attempt" | "connector.read" | "chat_write_setting.changed" | "agent_write_setting.changed" | "review_event_setting.changed" | "policy.approval.requested" | "policy.approval.confirmed" | "policy.approval.denied" | "policy.approval.cancelled" | "policy.approval.used" | "page.created" | "page.version_written" | "page.restored" | "page.deleted" | "page.trashed" | "page.restored_from_trash" | "page_query.saved" | "page_query.deleted" | "design_system.saved" | "design_system.default_set" | "design_system.deleted" | "skill.created" | "skill.version_written" | "skill.deleted" | "skill.promotion_requested" | "skill.promotion_approved" | "skill.promotion_refused" | "skill.promotion_withdrawn" | "billing.customer_created" | "billing.customer_deleted" | "billing.payment_method_changed" | "billing.invoice_sent" | "billing.invoice_paid" | "billing.invoice_failed" | "billing.plan_changed" | "billing.plan_change_scheduled" | "billing.after_the_fact_changed" | "billing.usage_charged" | "billing.usage_charge_failed" | "billing.payment_disputed" | "billing.dispute_closed" | "observability.exported" | "observability.directory_exported" | "service_account.created" | "service_account.key_created" | "service_account.key_rotated" | "service_account.key_revoked" | "service_account.revoked" | "sandbox_session.started" | "sandbox_session.ended" | "agent_session.started" | "agent_session.ended" | "operator_grant.issued" | "operator_grant.revoked" | "operator.request" | "org.marked" | "person.marked" | "desktop.revocations_changed" | "staff.person_viewed" | "staff.list_viewed" | "agent.linked" | "agent.unlinked" | "agent.memory_written" | "agent.memory_deleted" | "agent.memory_cleared" | "agent.profile_created" | "agent.profile_updated" | "agent.profile_deleted" | "project.created" | "project.updated" | "project.archived" | "project.moved_to_org" | "project.repo_added" | "project.repo_removed" | "project.member_set" | "project.member_removed" | "secret.set" | "secret.deleted" | "project.setup_saved" | "subscription.changed" | "subscription.status_changed" | "referral.recorded" | "referral.reward_voided" | "invite.created" | "invite.revoked" | "invite.approved" | "platform_role.granted" | "platform_role.revoked" | "schedule.upserted" | "schedule.paused" | "schedule.resumed" | "schedule.deleted"required

      Stable and dotted

    • targetobjectrequired
      • typestringrequired
      • idstringrequired
      • slugstring
    • beforeany

      The record before the change (credentials redacted)

    • afterany

      The record after the change (credentials redacted)

    • requestIdstring

      The request's x-request-id

    • metadataobject
  • nextCursorstring

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/audit" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.audit({ since: "7d", action: "team.*" });

Export audit events

get/v1/audit/export.csv

Every matching audit event you may read, newest first, streamed as CSV (owners, admins and team leads).

audit.exportOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • sincequery · string

    ISO time, or relative: 30m, 24h, 7d, 2w

  • untilquery · string

    ISO time, or relative

  • actionquery · string

    An action, a comma-separated list, or a prefix ending in * (team.*)

  • actorquery · string

    The actor's user id or email

  • targetquery · string

    The target's id or slug

  • teamquery · string

    A team slug or id: events of that team and every team under it

Responses

200CSV: id, at, action, actor_email, actor_user_id, actor_kind, key_id, surface, target_type, target_id, target_slug, request_id, before, after, metadatatext/csv

string

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/audit/export.csv" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.auditCsv({ since: "30d" });