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

API reference

Sessions

View as Markdown

List session pins

get/v1/session-pins

List the caller's saved session pins, including unpinned revisions for offline reconciliation.

chat.useEvery memberTry it in the API Explorer

Responses

200The caller's pin settings in this organization.application/json

  • pinsarray of SessionPinrequired
    • source"chat" | "synced"required
    • sessionIdstringrequired
    • pinnedbooleanrequired
    • versionintegerrequired
    • updatedAtstring (date-time) | nullrequired
  • chatsarray of ChatSessionrequired
    • idstringrequired
    • titlestringrequired

      The first question until you rename it

    • mode"chat" | "ask"required

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • modelstringrequired

      The model asked for: nexus/auto by default

    • lastModelstring

      The model that ran last

    • teamstring

      The team its spend is attributed to

    • archivedbooleanrequired
    • webSearchboolean

      Whether the model may search the web in this session (default false)

    • messageCountintegerrequired
    • costUsdnumberrequired

      The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required
    • visibility"private" | "shared"

      Private (the default) or shared: at least one active artifact

    • sharingChatSessionSharing

      How a shared session is shared: its newest active artifact

      • artifactIdstringrequired
      • versionintegerrequired
      • audienceArtifactAudiencerequired

        Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

        • kind"org" | "teams" | "people" | "external" | "public"required
        • teamsarray of stringrequired

          Team slugs (kind teams)

        • peoplearray of stringrequired

          Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

      • allowContinuebooleanrequired
      • urlstringrequired

        The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

      • pathstringrequired

        /app/<org>/artifacts/<id>

      • viewerUrlstring

        The fast viewer: <origin>/a/<id>

      • publicUrlstring

        Kind public: <origin>/a/<token>

      • expiresAtstring (date-time)

        Kind public: when the link stops opening

    • artifactsarray of ArtifactLink

      Every version shared from this session, newest first (revoked ones included)

      • idstringrequired
      • versionintegerrequired

        min 1

      • status"active" | "revoked"required
      • audience"org" | "teams" | "people" | "external" | "public"required
      • createdAtstring (date-time)required
      • revokedAtstring (date-time)
    • authorArtifactAuthor

      You (listed and read sessions)

      • emailstring
      • namestring
    • forkedFromobject

      The artifact this session continues (POST /v1/artifacts/{id}/continue)

      • artifactIdstringrequired
      • versionintegerrequired
      • titlestring
  • threadsarray of SyncedThreadrequired
    • threadIdstringrequired
    • personIdstringrequired

      The thread's person (users.id): you, unless an auditor or a teammate reads it.

    • agentstring | nullrequired

      The latest event's agent: claude, codex or nexus; null before the first event.

    • modelstring | nullrequired
    • status"running" | "completed" | "interrupted" | "error" | nullrequired
    • totalsSyncedTotalsrequired

      A thread's usage totals.

      • inputTokensintegerrequired
      • outputTokensintegerrequired
      • cacheReadTokensintegerrequired
      • cacheWriteTokensintegerrequired
      • costUsdstringrequired

        A decimal string.

    • lastSeqinteger | nullrequired

      The highest event number stored; null before the first event.

    • keyVersioninteger | nullrequired

      The newest content key version of a sealed event.

    • privatebooleanrequired

      Whether its owner keeps it from their teammates (setSyncedThreadPrivate). Otherwise it is team-visible: any member reads it while the organization's multiplayerSessions is on.

    • followersarray of stringrequired

      Who follows it: members' ids (users.id), in the order they followed it (followSyncedThread).

    • lastEventAtstring (date-time) | nullrequired
    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/session-pins" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set session pin

put/v1/session-pins/{source}/{id}

Set a personal session pin if the caller's revision matches.

chat.useEvery memberTry it in the API Explorer

Parameters

  • sourcepath · "chat" | "synced"required
  • idpath · stringrequired

Request body · application/json

  • pinnedbooleanrequired
  • expectedVersionintegerrequired

Responses

200The matching pin, also returned on a retry when the requested state already holds.application/json

  • source"chat" | "synced"required
  • sessionIdstringrequired
  • pinnedbooleanrequired
  • versionintegerrequired
  • updatedAtstring (date-time) | nullrequired

404The caller cannot pin this session.

409Another device changed this pin (`session_pin_changed`). Read the current list before retrying.

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
404not_foundNothing matches the path in your organization
404The caller cannot pin this session.
409Another device changed this pin (`session_pin_changed`). Read the current list before retrying.
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/session-pins/<source>/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pinned": false,
    "expectedVersion": 1
  }'