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

# Get guidelines

> Read the guidelines saved on an agent's draft

This returns the draft: what you see in the **Guidelines** editor in Studio, and what **Talk** and the test **Chat** use. On a published agent, live calls, website chats and emails use the published guidelines until the next **Publish**, `needs_publish` is `true` when the agent has any unpublished change, not only to its guidelines, and it can stay `true` after an edit is changed back: it says a publish may be needed, not what is in it. `live_version` names the version that is live.

Guidelines refer to actions and variables with `{{...}}` placeholders, and the API returns them by ID, such as `{{action.<id>}}`, where Studio shows names. Keep them exactly as returned when you send the text back with [Replace guidelines](https://docs.squawkvoice.ai/api-reference/agents/replace-guidelines.md).


## OpenAPI

````yaml api-reference/openapi.yaml GET /api/v1/assistants/{assistantId}/guidelines
openapi: 3.1.0
info:
  title: SquawkVoice API
  version: '1.0'
  description: >-
    Place on-demand campaign calls, and manage and publish an agent's
    guidelines, from your own systems. Every request is authenticated with an
    API key sent in the `X-API-Key` header.
servers:
  - url: https://api.squawkvoice.ai
security:
  - apiKey: []
tags:
  - name: on-demand-calls
    x-group: On-Demand Calls
    description: Place a campaign call for one contact, and cancel it before it is dialed.
  - name: agents
    x-group: Agents
    description: >-
      Read and replace an agent's guidelines, publish the agent, and see which
      version is live.
paths:
  /api/v1/assistants/{assistantId}/guidelines:
    get:
      tags:
        - agents
      summary: Get guidelines
      description: Returns the guidelines saved on the agent's draft.
      operationId: getGuidelines
      parameters:
        - $ref: '#/components/parameters/assistantId'
      responses:
        '200':
          description: The agent's guidelines.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    required:
                      - assistant_id
                      - guidelines
                      - needs_publish
                      - live_version
                    properties:
                      assistant_id:
                        type: string
                        format: uuid
                        description: The agent's ID.
                      guidelines:
                        type: string
                        description: >-
                          The guidelines on the agent's draft, as Markdown. An
                          empty string when the agent has none. Placeholders for
                          actions and variables appear by ID, such as
                          `{{action.<id>}}`.
                      needs_publish:
                        $ref: '#/components/schemas/NeedsPublish'
                      live_version:
                        $ref: '#/components/schemas/LiveVersion'
              example:
                success: true
                data:
                  assistant_id: 3c7e1a52-8d4f-4b9a-a0e6-5f2d9c8b1e74
                  guidelines: >-
                    ## Role

                    You book appointments for Bodywell Clinic.


                    ## Booking

                    Check availability with
                    {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before
                    offering a time.
                  needs_publish: false
                  live_version:
                    version_id: 5e0b9c41-7a2d-4f6e-b8c3-1d9a0e4f7b62
                    version_number: 3
                    name: null
                    published_at: '2026-10-29T14:02:11.000Z'
                    activated_at: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AgentForbidden'
        '404':
          $ref: '#/components/responses/AgentNotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    assistantId:
      name: assistantId
      in: path
      required: true
      description: >-
        The agent's ID. Open the agent in Studio and select **Copy ID** in its
        header.
      schema:
        type: string
        format: uuid
  schemas:
    NeedsPublish:
      type: boolean
      description: >-
        `true` when the agent has been published and has an edit that isn't live
        yet, anywhere in the agent and not only in its guidelines, so phone
        calls, website chats and emails get it only after a publish, with
        **Publish** in Studio or [Publish an
        agent](/api-reference/agents/publish-agent). It is set by the edit, so
        it can stay `true` after an edit is changed back: a publish then answers
        `400` with nothing to publish, which you can treat as nothing to do.
        Always `false` for an agent that has never been published.
    LiveVersion:
      description: >-
        The version phone calls, website chats and emails use now. `null` when
        the agent has never been published: its conversations use the draft.
      oneOf:
        - type: object
          required:
            - version_id
            - version_number
            - name
            - published_at
            - activated_at
          properties:
            version_id:
              type: string
              format: uuid
              description: >-
                The version's ID. A conversation on a published version records
                that version's ID in the variable
                `interaction.AGENT_VERSION_ID`. A conversation on the draft,
                such as **Talk** or the test **Chat**, records `draft`.
            version_number:
              type: integer
              description: >-
                The version's number, as **Version History** in Studio shows it
                (V1, V2, and so on).
            name:
              type:
                - string
                - 'null'
              description: The version's name, or `null` when it has none.
            published_at:
              type: string
              format: date-time
              description: When this version was published.
            activated_at:
              type:
                - string
                - 'null'
              format: date-time
              description: >-
                When this version was last made live again with **Make this
                version active** in Studio, or `null` if never.
        - type: 'null'
    Error:
      type: object
      description: >-
        Most errors have `success: false` and a readable `error`. Some agent
        errors and rate-limit errors carry `message` instead.
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
          description: What went wrong.
        details:
          description: More detail, when there is any.
        message:
          type: string
          description: What went wrong, on errors that don't use `error`.
        data:
          type: object
          description: >-
            Extra detail on a few errors, such as the live version when there is
            nothing to publish, or the running publish on a `409`.
  responses:
    Unauthorized:
      description: >-
        The API key is missing, unknown, revoked or expired. The reply is the
        same in every case.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: 'Unauthorized: Invalid credentials'
    AgentForbidden:
      description: The agent isn't in your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: 'Forbidden: Workspace does not belong to your account.'
    AgentNotFound:
      description: Agent not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Assistant not found.
    TooManyRequests:
      description: >-
        Too many requests. Wait for the number of seconds in the `Retry-After`
        header, then retry.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                const: error
              message:
                type: string
          example:
            status: error
            message: Too many requests, please try again later.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        An API key from **Manage → API Keys** in Studio. See
        [Authentication](/api-reference/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.