> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sidenet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get agent

> Returns the agent and exactly ONE of its versions. Which one is up to `version`; by default it is the active (published) version, falling back to the draft when nothing has been activated yet. The `agent` object always reports `activeVersionNumber`, `latestPublishedVersionNumber` and `draftDirty`, so a client can tell what else exists — unpublished edits, or a newer published version than the one serving traffic — and ask for it by number in a second call. `referencedBlocks` and `variables` describe the version that was returned. `variables` is the {{placeholders}} it and its subagents consume, as a nested object mirroring the dot paths — `{{instance.store_count}}` comes back as `{"instance":{"store_count":null}}`. Each leaf is the default it renders without a value, or null when it has none (an unsupplied value stays visible in the prompt). Fill the nulls in and send the same object as a chat body's or an experiment's `variables`; leaves left null are ignored.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/agents/{id}
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/agents/{id}:
    get:
      tags:
        - Agents
      summary: Get agent
      description: >-
        Returns the agent and exactly ONE of its versions. Which one is up to
        `version`; by default it is the active (published) version, falling back
        to the draft when nothing has been activated yet. The `agent` object
        always reports `activeVersionNumber`, `latestPublishedVersionNumber` and
        `draftDirty`, so a client can tell what else exists — unpublished edits,
        or a newer published version than the one serving traffic — and ask for
        it by number in a second call. `referencedBlocks` and `variables`
        describe the version that was returned. `variables` is the
        {{placeholders}} it and its subagents consume, as a nested object
        mirroring the dot paths — `{{instance.store_count}}` comes back as
        `{"instance":{"store_count":null}}`. Each leaf is the default it renders
        without a value, or null when it has none (an unsupplied value stays
        visible in the prompt). Fill the nulls in and send the same object as a
        chat body's or an experiment's `variables`; leaves left null are
        ignored.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: 6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10
        - name: version
          in: query
          required: false
          schema:
            type: string
            example: active
          description: >-
            Which version of the agent to return. Takes any of: a version number
            (`3`, or `v3`); `0` or `draft` for the unpublished draft; `latest`
            for the newest published version; `active` for the one serving
            traffic; or the version row's uuid. Defaults to `active`, falling
            back to the draft when nothing has been activated yet.
      responses:
        '200':
          description: The agent, the version that was selected, and its variables
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      org_id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      active_version_id:
                        type: string
                        format: uuid
                        nullable: true
                        description: Null until a published version is activated.
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      activeVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Version number currently serving traffic. Null until a
                          published version is activated.
                      latestPublishedVersionNumber:
                        type: integer
                        nullable: true
                        description: >-
                          Newest published version number. Higher than
                          `activeVersionNumber` when a newer version is
                          published but not activated. Null before the first
                          publish.
                      draftDirty:
                        type: boolean
                        description: >-
                          True when the draft's config differs from the latest
                          published version — i.e. there are unpublished edits.
                          Fetch them with `?version=draft`.
                  version:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      agent_id:
                        type: string
                        format: uuid
                      version_number:
                        type: integer
                        description: >-
                          0 is the mutable draft; every published version is 1
                          or above.
                      rev:
                        type: integer
                        description: >-
                          Server-owned change counter, bumped on every save of
                          the draft. Read-only — useful to tell whether a draft
                          moved since you last read it.
                      instructions:
                        type: array
                        description: >-
                          The system prompt, as ordered blocks. Entries are
                          `{type:"text"}`, `{type:"prompt_block"}` or
                          `{type:"prompt_block_ref"}`. On a published version
                          each ref also carries the `versionId` it was frozen to
                          at publish time; on the draft that pin is absent.
                        items:
                          type: object
                      model_slug:
                        type: string
                        nullable: true
                        description: >-
                          The concrete model this version runs. Ignored when
                          `policy_slug` is set.
                      policy_slug:
                        type: string
                        nullable: true
                        description: >-
                          Routing policy to run instead of a fixed model.
                          Overrides `model_slug`.
                      model_options:
                        type: object
                        nullable: true
                        description: >-
                          Model-level options passed to the router (reasoning
                          effort, native options).
                      model_settings:
                        type: object
                        nullable: true
                        description: 'Generation settings: temperature, maxTokens, etc.'
                      max_steps:
                        type: integer
                        nullable: true
                      agentTools:
                        type: array
                        description: Tool references this version can call.
                        items:
                          type: object
                      workflows:
                        type: array
                        description: Attached workflows.
                        items:
                          type: object
                      agents:
                        type: array
                        description: >-
                          Subagents this version can delegate to, as `[{ agentId
                          }]`.
                        items:
                          type: object
                      scorers:
                        type: array
                        items:
                          type: object
                      memory:
                        type: object
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                    nullable: true
                    description: >-
                      The one version this call selected, in full — the active
                      version by default, or whatever `version` named.
                      `version_number` says which it is (0 is the draft). Null
                      only for an agent with neither an active version nor a
                      draft.
                  referencedBlocks:
                    type: array
                    description: >-
                      Every prompt block the returned version's instructions
                      reference, with the version it pins and the block's
                      current active version.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                          nullable: true
                        pinnedVersionId:
                          type: string
                          format: uuid
                          nullable: true
                        pinnedVersionNumber:
                          type: integer
                          nullable: true
                        activeVersionId:
                          type: string
                          format: uuid
                          nullable: true
                        activeVersionNumber:
                          type: integer
                          nullable: true
                        outdated:
                          type: boolean
                          description: >-
                            The pinned version is no longer the block's active
                            one — republish (or POST
                            /v1/prompt-blocks/{id}/rollout) to catch up.
                  blocksOutdated:
                    type: boolean
                    description: True when any entry in `referencedBlocks` is outdated.
                  variables:
                    type: object
                    description: >-
                      The {{placeholders}} the returned version and its
                      subagents consume, nested to mirror the dot paths. Each
                      leaf is the default it renders without a value, or null
                      when it has none.
              example:
                agent:
                  id: 6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10
                  org_id: 2b9d7c31-8e4f-4a2b-9d61-77c0a3f5e812
                  name: Support agent
                  description: Answers billing and account questions
                  active_version_id: b3f7a2c8-5d19-4e6b-8f02-1a4c9e7d3b55
                  activeVersionNumber: 3
                  latestPublishedVersionNumber: 3
                  draftDirty: true
                  created_at: '2026-07-02T09:14:22.418Z'
                  updated_at: '2026-08-11T16:03:47.902Z'
                version:
                  id: b3f7a2c8-5d19-4e6b-8f02-1a4c9e7d3b55
                  agent_id: 6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10
                  version_number: 3
                  rev: 1
                  instructions:
                    - type: prompt_block_ref
                      id: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
                      versionId: 7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f
                    - type: text
                      content: Answer in {{locale || 'English'}}.
                  model_slug: anthropic/claude-sonnet-4-5
                  model_settings:
                    temperature: 0.2
                  max_steps: 8
                  agentTools:
                    - toolId: a7c3e1d5-6b48-4f92-8a03-e5c9b2d417f6
                  workflows: []
                  agents: []
                  scorers: []
                  memory: null
                  created_at: '2026-08-04T10:22:05.117Z'
                  updated_at: '2026-08-04T10:22:05.117Z'
                referencedBlocks:
                  - id: d41a8f6b-9c27-4b13-a5e8-2f60c1d7b394
                    name: Brand voice
                    pinnedVersionId: 7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f
                    pinnedVersionNumber: 2
                    activeVersionId: 7e2b5a90-3c48-4d61-b9f7-05a8c2e14d6f
                    activeVersionNumber: 2
                    outdated: false
                blocksOutdated: false
                variables:
                  locale: English
                  instance:
                    store_count: null
        '400':
          description: >-
            Missing identity headers, an unparseable `version`, or the agent
            belongs to another organization
        '404':
          description: Agent not found, or it has no such version
      security:
        - bearerAuth: []
        - sessionToken: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.
    sessionToken:
      type: http
      scheme: bearer
      description: >-
        Session token (`snat_…`) minted by POST /v1/token. Carries the
        organization and the end user; safe in a browser.

````