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

# List an agent's prompts

> Returns the agent's prompt lineages. Each lineage is an independent version history, labelled by its `source` (USER, API, CONFIG, or a provider integration). `prompt` is the current content.



## OpenAPI

````yaml /api-reference/openapi.documented.json get /v1/agent/{agentId}/prompts
openapi: 3.1.0
info:
  title: Roark Analytics API
  description: >-
    The Roark Analytics API gives you access to the same API that powers the
    award winning Roark Analytics platform.
  version: 1.0.0
servers:
  - description: Production
    url: https://api.roark.ai
security:
  - Bearer: []
tags:
  - name: Agent
  - name: Agent Endpoint
  - name: Call
  - name: Chat
  - name: Metric
  - name: Metric Policy
  - name: Metric Collection Job
  - name: Customer Flow
  - name: Customer Flow Edge Case
  - name: Simulation
  - name: Simulation Persona
  - name: Simulation Environment
  - name: Simulation Scenario
  - name: Simulation Run Plan
  - name: Simulation Template
  - name: Simulation Run Plan Job
  - name: Simulation Job
  - name: HTTP Request Definition
  - name: Webhook
  - name: Issue
  - name: Knowledge Base
  - name: Config
  - name: CLI Auth
  - name: Call Analysis
  - name: Health
paths:
  /v1/agent/{agentId}/prompts:
    get:
      tags:
        - Agent
      summary: List an agent's prompts
      description: >-
        Returns the agent's prompt lineages. Each lineage is an independent
        version history, labelled by its `source` (USER, API, CONFIG, or a
        provider integration). `prompt` is the current content.
      operationId: getV1AgentByAgentIdPrompts
      parameters:
        - in: path
          name: agentId
          schema:
            type: string
            format: uuid
          required: true
      responses:
        '200':
          description: The agent's prompt lineages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAgentPromptsResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Authentication error
              example:
                type: authentication
                code: unauthorized
                message: Authentication required
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Not found error
              example:
                type: not_found
                code: resource_not_found
                message: The requested resource could not be found
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
                description: Server error
              example:
                type: internal
                code: internal_error
                message: Internal server error
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Roark from '@roarkanalytics/sdk';


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


            const agentPrompts = await
            client.agentPrompt.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(agentPrompts.data);
        - lang: Python
          source: |-
            import os
            from roark_analytics import Roark

            client = Roark(
                bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"),  # This is the default and can be omitted
            )
            agent_prompts = client.agent_prompt.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(agent_prompts.data)
components:
  schemas:
    GetAgentPromptsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AgentPromptResponse'
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - validation
            - authentication
            - forbidden
            - not_found
            - conflict
            - payment_required
            - rate_limit
            - internal
          description: The error type category
          examples:
            - validation
            - authentication
        code:
          type: string
          description: Machine-readable error code identifier
          examples:
            - invalid_parameter
            - missing_required_field
            - unauthorized
        message:
          type: string
          description: Human-readable error message
          examples:
            - The request was invalid
            - Authentication required
        param:
          type: string
          description: The parameter that caused the error (if applicable)
          examples:
            - email
            - user_id
        details:
          description: Additional error context information
      required:
        - type
        - code
        - message
    AgentPromptResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Prompt lineage ID (its own version history).
        source:
          type: string
          enum:
            - USER
            - RETELL_INTEGRATION
            - VAPI_INTEGRATION
            - ELEVEN_LABS_INTEGRATION
            - BLAND_INTEGRATION
            - PIPECAT_CLOUD_INTEGRATION
            - PIPECAT_SELF_HOSTED_INTEGRATION
            - LIVEKIT_SELF_HOSTED_INTEGRATION
            - API
            - CONFIG
            - API_MANAGED
          description: >-
            Where this prompt came from: USER (edited in the app), API (provided
            via the API or on calls), CONFIG (managed by config-as-code), or a
            provider integration.
        prompt:
          type: string
          description: Current prompt content (the latest version).
        updatedAt:
          type: string
          description: When the current version was recorded (ISO 8601).
        createdAt:
          type: string
          description: When this prompt lineage was first created (ISO 8601).
      required:
        - id
        - source
        - prompt
        - updatedAt
        - createdAt
      description: A prompt lineage on an agent.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````