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

# Get Agent Tags

> Get the settings and status that apply to all versions of an agent, such as its environment tags.

Works for voice and chat agents. To learn how tags route calls, see [environment tags](https://docs.retellai.com/agent/version.md#environment-tags). To change them, use [Update Agent Tags](https://docs.retellai.com/api-references/update-agent-root.md).


## OpenAPI

````yaml openapi-final get /get-agent-root/{agent_id}
openapi: 3.0.3
info:
  title: Retell SDK
  version: 3.0.0
  x-retell-spec-revision: 2026-11-22-669f372
  contact:
    name: Retell Support
    url: https://www.retellai.com/
    email: support@retellai.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.retellai.com
    description: The production server.
security:
  - api_key: []
paths:
  /get-agent-root/{agent_id}:
    get:
      description: >-
        Get the settings and status that apply to all versions of an agent, such
        as its environment tags.
      operationId: getAgentRoot
      parameters:
        - in: path
          name: agent_id
          schema:
            type: string
            minLength: 1
            example: agent_xxx
          required: true
          description: Unique id of the agent.
      responses:
        '200':
          description: Agent settings returned successfully.
          headers:
            ETag:
              schema:
                type: string
              description: Pass this value in If-Match when you update the agent settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRootResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Retell from 'retell-sdk';

            const client = new Retell({
              apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
            });

            const agentRootResponse = await client.agent.getRoot('agent_xxx');

            console.log(agentRootResponse.agent_id);
        - lang: Python
          source: |-
            import os
            from retell import Retell

            client = Retell(
                api_key=os.environ.get("RETELL_API_KEY"),  # This is the default and can be omitted
            )
            agent_root_response = client.agent.get_root(
                "agent_xxx",
            )
            print(agent_root_response.agent_id)
components:
  schemas:
    AgentRootResponse:
      type: object
      required:
        - agent_id
        - is_suspended
        - tags
        - user_modified_timestamp
      properties:
        agent_id:
          type: string
          example: agent_xxx
          description: Unique id of the agent.
        is_suspended:
          type: boolean
          example: false
          description: Whether the agent is currently suspended.
        tags:
          type: object
          description: >-
            Environment tags for this agent, keyed by tag name. Every agent has
            prod and staging tags.
          example:
            prod:
              version: 3
            staging: {}
          additionalProperties:
            $ref: '#/components/schemas/AgentRootTagState'
        user_modified_timestamp:
          type: integer
          format: int64
          example: 1746105600000
          description: >-
            User modification timestamp (milliseconds since epoch). Either the
            time of last update or creation if no updates available.
    AgentRootTagState:
      type: object
      properties:
        version:
          type: integer
          minimum: 0
          example: 15
          description: >-
            Version that the tag points to. Absent when the tag follows the
            latest version.
        dynamic_variables:
          type: object
          additionalProperties:
            type: string
          description: Dynamic variable values supplied when a call uses this tag.
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Invalid request format, please check API reference.
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: API key is missing or invalid.
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: The requested resource was not found.
    UnprocessableContent:
      description: Unprocessable Content
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Cannot find requested asset under given api key.
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: An unexpected server error occurred.
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: string
      description: >-
        Authentication header containing API key (find it in dashboard). The
        format is "Bearer YOUR_API_KEY"

````

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