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

# List Prompts

> Browse through all your prompts to see what you're using across your AI applications. Returns all prompts by default (both active and inactive versions), or filter by product or version to narrow down the results.

**Filtering & Pagination:**
- Filter by `productId` to see prompts for a specific product
- Filter by `versionId` to see a specific version
- Choose your pagination style: cursor-based (`limit` + `cursor`) or page-based (`page` + `pageSize`)
- Check the `Link` header for easy pagination navigation

**Note:** This returns lightweight data with just component IDs. Use `GET /prompts/:id` to fetch the full prompt content.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi get /prompts
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /prompts:
    get:
      tags:
        - Prompts
      summary: List Prompts
      description: >-
        Browse through all your prompts to see what you're using across your AI
        applications. Returns all prompts by default (both active and inactive
        versions), or filter by product or version to narrow down the results.


        **Filtering & Pagination:**

        - Filter by `productId` to see prompts for a specific product

        - Filter by `versionId` to see a specific version

        - Choose your pagination style: cursor-based (`limit` + `cursor`) or
        page-based (`page` + `pageSize`)

        - Check the `Link` header for easy pagination navigation


        **Note:** This returns lightweight data with just component IDs. Use
        `GET /prompts/:id` to fetch the full prompt content.
      parameters:
        - schema:
            type: number
            maximum: 100
            default: 50
            description: >-
              Page size limit (cursor-based pagination). Use either limit/cursor
              OR page/pageSize, not both.
          required: false
          description: >-
            Page size limit (cursor-based pagination). Use either limit/cursor
            OR page/pageSize, not both.
          name: limit
          in: query
        - schema:
            type: number
            minimum: 1
            description: >-
              Page number (page-based pagination). Use either page/pageSize OR
              limit/cursor, not both.
          required: false
          description: >-
            Page number (page-based pagination). Use either page/pageSize OR
            limit/cursor, not both.
          name: page
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 30
            description: >-
              Number of items per page (page-based pagination). Use either
              page/pageSize OR limit/cursor, not both.
          required: false
          description: >-
            Number of items per page (page-based pagination). Use either
            page/pageSize OR limit/cursor, not both.
          name: pageSize
          in: query
        - schema:
            type: boolean
            default: false
            description: Include archived prompts.
          required: false
          description: Include archived prompts.
          name: includeArchived
          in: query
        - schema:
            type: string
            format: uuid
            description: Filter prompts by specific version ID.
          required: false
          description: Filter prompts by specific version ID.
          name: versionId
          in: query
        - schema:
            type: string
            format: uuid
            description: Filter prompts by product ID.
          required: false
          description: Filter prompts by product ID.
          name: productId
          in: query
        - schema:
            type: boolean
            default: false
            description: >-
              Filter to only show prompts that are part of active versions. When
              true, only returns prompts associated with versions where
              isActive=true.
          required: false
          description: >-
            Filter to only show prompts that are part of active versions. When
            true, only returns prompts associated with versions where
            isActive=true.
          name: activeOnly
          in: query
      responses:
        '200':
          description: >-
            Prompts retrieved successfully. Check the Link header for pagination
            URLs (first, prev, next).
          headers:
            Link:
              description: >-
                Pagination links following RFC 8288. May include rel="first",
                rel="prev", and rel="next" links.
              schema:
                type: string
                example: >-
                  <https://api.greenflash.com/v1/prompts?page=1&pageSize=50>;
                  rel="first",
                  <https://api.greenflash.com/v1/prompts?page=3&pageSize=50>;
                  rel="next"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPromptsResponse'
              example:
                - id: 123e4567-e89b-12d3-a456-426614174000
                  externalPromptId: support-v1
                  name: Customer Support Prompt
                  versionId: 123e4567-e89b-12d3-a456-426614174001
                  productId: 123e4567-e89b-12d3-a456-426614174003
                  archivedAt: null
                  createdAt: '2025-10-01T12:00:00Z'
                  updatedAt: '2025-10-02T14:30:00Z'
                  components:
                    - id: 123e4567-e89b-12d3-a456-426614174002
                      externalComponentId: base-instructions
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for ListPrompts operations.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Greenflash from 'greenflash';

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

            const listPromptsResponse = await client.prompts.list();

            console.log(listPromptsResponse);
        - lang: Python
          source: |-
            import os
            from greenflash import Greenflash

            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )
            list_prompts_response = client.prompts.list()
            print(list_prompts_response)
components:
  schemas:
    ListPromptsResponse:
      type: array
      items:
        $ref: '#/components/schemas/SlimPrompt'
      description: Array of prompts.
    SlimPrompt:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The Greenflash prompt ID.
        externalPromptId:
          type:
            - string
            - 'null'
          description: Your external identifier for the prompt.
        name:
          type:
            - string
            - 'null'
          description: Prompt name.
        versionId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The version ID this prompt is associated with, or null if the prompt
            is not part of any version.
        productId:
          type:
            - string
            - 'null'
          format: uuid
          description: The product ID this prompt is associated with.
        archivedAt:
          type:
            - string
            - 'null'
          description: ISO 8601 timestamp when archived, or null if active.
        createdAt:
          type: string
          description: ISO 8601 timestamp when created.
        updatedAt:
          type: string
          description: ISO 8601 timestamp when last updated.
        components:
          type: array
          items:
            $ref: '#/components/schemas/SlimPromptComponent'
          description: Array of prompt component IDs that make up this prompt.
      required:
        - id
        - externalPromptId
        - name
        - versionId
        - productId
        - archivedAt
        - createdAt
        - updatedAt
        - components
    SlimPromptComponent:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The Greenflash component ID.
        externalComponentId:
          type:
            - string
            - 'null'
          description: Your external identifier for the component.
      required:
        - id
        - externalComponentId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````