> ## 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.

# Get a recommendation

> Gets one recommendation, with the history of what has happened to it. Internal PolyAI notes are never included.

Accepts a personal access token or a workspace API key.



## OpenAPI

````yaml GET /v1/accounts/{accountId}/projects/{projectId}/recommendations/{number}
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/{number}:
    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
      - name: number
        in: path
        required: true
        description: >-
          The recommendation's `id`, a positive whole number unique within its
          project.
        schema:
          type: integer
          minimum: 1
    get:
      tags:
        - Recommendations
      summary: Get a recommendation
      description: >-
        Gets one recommendation, with the history of what has happened to it.
        Internal PolyAI notes are never included.


        Accepts a personal access token or a workspace API key.
      operationId: getWrenRecommendation
      responses:
        '200':
          description: The recommendation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendationDetail'
        '400':
          description: The recommendation number is not a positive whole number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid recommendation number
        '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
        '404':
          description: No recommendation with that number exists in the project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Recommendation not found
        '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:
    RecommendationDetail:
      type: object
      required:
        - id
        - title
        - description
        - type
        - status
        - severity
        - impact
        - nextStep
        - createdAt
        - updatedAt
        - history
      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
        history:
          type: array
          items:
            type: object
            required:
              - at
              - kind
              - summary
            properties:
              at:
                type: string
                format: date-time
              kind:
                type: string
                enum:
                  - created
                  - updated
                  - status_changed
                  - comment
                  - evidence_added
                  - question_asked
                  - question_answered
                  - fix_proposed
                  - needs_attention
                  - fix_published
                  - recovered
                description: >-
                  What happened. `status_changed` is a move between statuses,
                  such as being closed or reopened. `recovered` is an alert
                  whose condition cleared.
              summary:
                type: string
                description: >-
                  A short sentence saying what happened. For a `comment`, the
                  comment itself, as Markdown.
          description: What has happened to the recommendation, oldest first.
    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`.

````