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

# List closed-loop prompt-improvement deployments

> Returns the tenant's prompt deployments — proposed, A/B-tested,
shipped, monitoring, regressed, or rolled-back. Dashboard-only;
Team+ plan. TRU-369.




## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/prompts/deployments
openapi: 3.1.0
info:
  title: TruLayer API
  version: 0.1.0
  description: |
    Trace ingestion, evaluation, query, and feedback API for TruLayer AI.

    ### Authentication

    Two auth schemes coexist: SDK API keys (`Authorization: Bearer tl_...`)
    and Clerk session JWTs (dashboard). Routes marked "requires Clerk auth"
    in their summary are unreachable via API key.

    ### Roles (TRU-234)

    Dashboard requests carry one of three organization roles: `owner`,
    `member`, `viewer`. Endpoints enforce role allowlists, not rank
    comparisons. See `docs/security.md` for the full role-permission
    matrix.

    - **owner** — full control including billing, member management,
      destructive deletes on failure-rules/model-routes/webhooks/eval-rules,
      control-loop execution, and DLQ resolution.
    - **member** — read + write (ingest, feedback, evals, API keys,
      projects, failure-rules, model-routes, webhooks).
    - **viewer** — read-only dashboard access plus compliance read access
      to `/v1/audit-log` and `/v1/dlq`.
servers:
  - url: https://api.trulayer.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: health
  - name: ingest
  - name: traces
  - name: metrics
  - name: feedback
  - name: evals
  - name: eval-rules
  - name: control
  - name: apikeys
  - name: model-routes
  - name: datasets
  - name: search
  - name: anomaly
  - name: webhooks
  - name: failure-rules
  - name: eval-runs
  - name: ci
  - name: otlp
  - name: billing
  - name: deprecations
  - name: audit
  - name: failures
  - name: projects
  - name: compliance
  - name: dsr
  - name: policies
  - name: members
paths:
  /v1/prompts/deployments:
    get:
      tags:
        - prompts
      summary: List closed-loop prompt-improvement deployments
      description: |
        Returns the tenant's prompt deployments — proposed, A/B-tested,
        shipped, monitoring, regressed, or rolled-back. Dashboard-only;
        Team+ plan. TRU-369.
      operationId: listPromptDeployments
      parameters:
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - proposed
              - ab_running
              - ab_passed
              - ab_failed
              - shipped
              - monitoring
              - regressed
              - rolled_back
              - rejected
        - name: project_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Prompt deployment list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptDeploymentListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Plan upgrade required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PromptDeploymentListResponse:
      type: object
      required:
        - items
        - total
        - limit
        - offset
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PromptDeployment'
        total:
          type: integer
          format: int64
        limit:
          type: integer
        offset:
          type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    PromptDeployment:
      type: object
      description: |
        A closed-loop prompt-improvement deployment record (TRU-369).
        Tracks one cluster-targeted proposal through its lifecycle:
        `proposed → ab_running → ab_passed → shipped → monitoring →
        (regressed → rolled_back)` (or `→ rejected` from any non-terminal
        state, `→ ab_failed` from `ab_running`).
      required:
        - id
        - tenant_id
        - project_id
        - cluster_signature
        - status
        - current_prompt
        - proposed_prompt
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        cluster_signature:
          type: string
          description: >-
            Stable hash of (project_id, cluster_error) so the same cluster
            across runs maps to the same signature.
        status:
          type: string
          enum:
            - proposed
            - ab_running
            - ab_passed
            - ab_failed
            - shipped
            - monitoring
            - regressed
            - rolled_back
            - rejected
        current_prompt:
          type: string
          description: System prompt at the time of proposal — the "before" side.
        proposed_prompt:
          type: string
          description: LLM-generated improved prompt — the "after" side.
        rationale:
          type: string
          description: One-sentence explanation from the LLM, rendered next to the diff.
        ab_report:
          type: object
          additionalProperties: true
          nullable: true
          description: Full delta report from internal/promptab once the harness completes.
        regression_metric:
          type: number
          format: double
          nullable: true
          description: Rolling regression metric while in monitoring/regressed status.
        shipped_at:
          type: string
          format: date-time
          nullable: true
        rolled_back_at:
          type: string
          format: date-time
          nullable: true
        approved_by:
          type: string
          nullable: true
          description: >-
            Clerk user ID of the actor (or "system:autoship" /
            "system:auto_rollback").
        rejection_reason:
          type: string
          description: Optional short reason on reject; empty string when not set.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: SDK API key (`tl_...`) or Clerk session JWT

````