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

# List recommendations

> Lists a project's Wren recommendations, newest first by default. Only open recommendations are returned unless `all` or `status` is set, and recommendations saved for later are left out unless `saved` or `all` is set.

Accepts a personal access token or a workspace API key.



## OpenAPI

````yaml GET /v1/accounts/{accountId}/projects/{projectId}/recommendations
openapi: 3.1.0
info:
  title: PolyAI Wren API
  version: 1.0.0
  description: Drive Wren from your own code, and read the recommendations it raises.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - ApiKeyAuth: []
tags:
  - name: Turns
    description: Run Wren from your own code.
  - name: Recommendations
    description: Read the recommendations Wren raises on a project.
paths:
  /v1/accounts/{accountId}/projects/{projectId}/recommendations:
    parameters:
      - name: accountId
        in: path
        required: true
        description: The account the project belongs to.
        schema:
          type: string
      - name: projectId
        in: path
        required: true
        description: The project whose recommendations you want.
        schema:
          type: string
    get:
      tags:
        - Recommendations
      summary: List recommendations
      description: >-
        Lists a project's Wren recommendations, newest first by default. Only
        open recommendations are returned unless `all` or `status` is set, and
        recommendations saved for later are left out unless `saved` or `all` is
        set.


        Accepts a personal access token or a workspace API key.
      operationId: listWrenRecommendations
      parameters:
        - name: limit
          in: query
          required: false
          description: Page size, clamped to 1 to 100.
          schema:
            type: integer
            default: 20
        - name: offset
          in: query
          required: false
          description: How many to skip; the response names the next offset.
          schema:
            type: integer
            default: 0
        - name: all
          in: query
          required: false
          description: Include closed recommendations. Ignored when `status` is set.
          schema:
            type: boolean
            default: false
        - name: saved
          in: query
          required: false
          description: >-
            Only recommendations saved for later. They are left out otherwise,
            unless `all` is set.
          schema:
            type: boolean
            default: false
        - name: status
          in: query
          required: false
          description: Statuses to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - open
                - in_progress
                - done
                - cancelled
                - archived
        - name: nextStep
          in: query
          required: false
          description: Next steps to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - needs_attention
                - question
                - answered
                - fix_proposed
                - fix_ready
        - name: severity
          in: query
          required: false
          description: Severities to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - high
                - medium
                - low
        - name: impact
          in: query
          required: false
          description: Impact levels to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - high
                - medium
                - low
        - name: type
          in: query
          required: false
          description: Recommendation types to include.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - defect
                - knowledge_gap
                - opportunity
                - alert
                - best_practice
        - name: sort
          in: query
          required: false
          description: Field to sort by.
          schema:
            type: string
            enum:
              - updated
              - created
              - title
              - progress
              - severity
              - type
              - affected
              - impact
            default: created
        - name: order
          in: query
          required: false
          description: Sort direction.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: A page of recommendations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRecommendationsResponse'
        '400':
          description: >-
            A query parameter has a value that is not allowed. `invalid` names
            the parameters at fault.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid list query
                invalid:
                  - nextStep
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid API key
        '403':
          description: >-
            The key has no access to the project, or Wren recommendations are
            not enabled for the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Forbidden
        '500':
          description: >-
            Something went wrong on our side, for example the permissions check
            could not be completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: API key validation error
components:
  schemas:
    ListRecommendationsResponse:
      type: object
      required:
        - recommendations
        - pagination
      properties:
        recommendations:
          type: array
          items:
            type: object
            required:
              - id
              - title
              - description
              - type
              - status
              - severity
              - impact
              - nextStep
              - createdAt
              - updatedAt
            properties:
              id:
                type: integer
                description: The recommendation’s number, unique within its project.
              title:
                type: string
                description: A short name for the recommendation.
              description:
                type: string
                description: What happens and who it affects, as Markdown.
              cause:
                type: string
                description: >-
                  Why it happens, as Markdown. Left out when the description
                  already covers the cause.
              conversationSnippet:
                type: object
                required:
                  - turns
                properties:
                  turns:
                    type: array
                    items:
                      type: object
                      required:
                        - speaker
                        - text
                      properties:
                        speaker:
                          type: string
                          enum:
                            - user
                            - agent
                            - system
                            - gap
                          description: >-
                            `user` is the caller or customer and `agent` is the
                            voice or chat agent. `system` is something that
                            happened between turns, such as an API call or a
                            transfer. `gap` stands for a part of the
                            conversation that is left out, and its text says
                            what happened there.
                        text:
                          type: string
                          description: What was said or what happened.
                        mark:
                          type: string
                          description: >-
                            A short note on this turn, pointing at what goes
                            wrong.
                description: >-
                  A short example conversation that shows the problem. It is
                  illustrative: written to show the pattern, and not a
                  transcript of a real call.
              changeSnippet:
                type: object
                required:
                  - turns
                properties:
                  turns:
                    type: array
                    items:
                      type: object
                      required:
                        - speaker
                        - text
                      properties:
                        speaker:
                          type: string
                          enum:
                            - user
                            - agent
                            - system
                            - gap
                          description: >-
                            `user` is the caller or customer and `agent` is the
                            voice or chat agent. `system` is something that
                            happened between turns, such as an API call or a
                            transfer. `gap` stands for a part of the
                            conversation that is left out, and its text says
                            what happened there.
                        text:
                          type: string
                          description: What was said or what happened.
                        mark:
                          type: string
                          description: >-
                            A short note on this turn, pointing at what the fix
                            changes.
                description: >-
                  The same example conversation as it would go with the proposed
                  fix. Present only while that fix is the one awaiting a
                  decision. Illustrative, like `conversationSnippet`.
              tags:
                type: object
                properties:
                  flow:
                    type: string
                    description: The flow involved.
                  step:
                    type: string
                    description: The step of that flow.
                  function:
                    type: string
                    description: The function involved.
                  topic:
                    type: string
                    description: The knowledge topic involved.
                description: >-
                  The parts of the project the recommendation is about. Any of
                  them may be missing.
              type:
                type: string
                enum:
                  - defect
                  - knowledge_gap
                  - opportunity
                  - alert
                  - best_practice
                description: >-
                  `defect`: the agent does not do what it is set up to do.
                  `knowledge_gap`: callers ask about something the knowledge
                  base does not cover. `opportunity`: nothing is broken, but the
                  project could do better. `alert`: a monitored condition was
                  confirmed. `best_practice`: a suggestion backed by PolyAI’s
                  best practices.
              status:
                type: string
                enum:
                  - open
                  - in_progress
                  - done
                  - cancelled
                  - archived
                description: >-
                  `open` and `in_progress` recommendations still need a
                  decision. `done`, `cancelled` and `archived` ones are closed.
              severity:
                type: string
                enum:
                  - high
                  - medium
                  - low
                description: How badly an affected conversation goes wrong.
              impact:
                type: string
                enum:
                  - high
                  - medium
                  - low
                description: >-
                  How much fixing this would improve the project, from its
                  severity and how often it happens.
              nextStep:
                type:
                  - string
                  - 'null'
                enum:
                  - needs_attention
                  - question
                  - answered
                  - fix_proposed
                  - fix_ready
                  - null
                description: >-
                  What an open recommendation is waiting for, or null once it is
                  closed. `needs_attention`: it is identified, and yours to act
                  on. `question`: it has a question for you. `answered`: the
                  question is answered and a fix is still to come.
                  `fix_proposed`: a fix is proposed. `fix_ready`: a fix is
                  proposed and has been checked.
              questions:
                type: array
                items:
                  type: object
                  required:
                    - question
                    - options
                  properties:
                    question:
                      type: string
                      description: The question, as Markdown.
                    options:
                      type: array
                      items:
                        type: string
                      description: >-
                        The answers offered. May be empty, for a question
                        answered in free text.
                    recommendedOption:
                      type: string
                      description: The option Wren recommends, when it has one.
                    answer:
                      type: object
                      required:
                        - selected
                      properties:
                        selected:
                          type: array
                          items:
                            type: string
                          description: The options that were picked.
                        text:
                          type: string
                          description: What was typed, if anything.
                      description: The answer given. Left out until there is one.
                description: >-
                  The questions an open recommendation is waiting on, when
                  `nextStep` is `question`. A get also returns them with their
                  answers while `nextStep` is `answered`. Left out otherwise.
              proposedFix:
                type: object
                required:
                  - change
                  - branchId
                properties:
                  change:
                    type: string
                    description: What the fix changes, as Markdown.
                  branchId:
                    type: string
                    description: >-
                      The branch the fix is on, as the `branchId` the Agents API
                      takes.
                description: >-
                  The fix awaiting a decision, when `nextStep` is `fix_proposed`
                  or `fix_ready`. Left out otherwise.
              createdAt:
                type: string
                format: date-time
              updatedAt:
                type: string
                format: date-time
        pagination:
          type: object
          required:
            - hasMore
          properties:
            hasMore:
              type: boolean
            nextOffset:
              type: integer
              description: The `offset` for the next page, when there is one.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong.
        invalid:
          type: array
          items:
            type: string
          description: On a `400` from the list endpoint, the query parameters at fault.
        feature:
          type: string
          description: On a `403` for a feature that is not enabled, the feature's name.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        A personal access token, or for the recommendations endpoints a
        workspace API key. Include it in a header parameter called `X-API-KEY`.

````