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

# Update insights

> Enable or disable pull request insight collection. Enabling starts the initial refresh when needed.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/insights
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/insights:
    patch:
      tags:
        - Insights
      summary: Update insights
      description: >-
        Enable or disable pull request insight collection. Enabling starts the
        initial refresh when needed.
      operationId: updateInsight
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
              required:
                - enabled
              additionalProperties: false
      responses:
        '200':
          description: Update insights
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  status:
                    type:
                      - string
                      - 'null'
                    enum:
                      - syncing
                      - ready
                      - failed
                      - null
                  rangeStart:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  rangeEnd:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  lastSyncedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  enabled:
                    type: boolean
                  data:
                    type:
                      - object
                      - 'null'
                    properties:
                      summary:
                        type: object
                        properties:
                          tasksCompleted:
                            type: integer
                          prsCreated:
                            type: integer
                          prsMerged:
                            type: integer
                          temboContribution:
                            type: number
                          changes:
                            type: object
                            properties:
                              prsCreated:
                                type: number
                              prsMerged:
                                type: number
                              tasksCompleted:
                                type: number
                              temboContribution:
                                type: number
                            required:
                              - prsCreated
                              - prsMerged
                              - tasksCompleted
                              - temboContribution
                            additionalProperties: false
                        required:
                          - tasksCompleted
                          - prsCreated
                          - prsMerged
                          - temboContribution
                          - changes
                        additionalProperties: false
                      timeSeries:
                        type: array
                        items:
                          type: object
                          properties:
                            month:
                              type: string
                            prsWithTembo:
                              type: integer
                            prsWithoutTembo:
                              type: number
                            prsMerged:
                              type: integer
                            prsCreated:
                              type: integer
                            temboContribution:
                              type: number
                          required:
                            - month
                            - prsWithTembo
                            - prsWithoutTembo
                            - prsMerged
                            - prsCreated
                            - temboContribution
                          additionalProperties: false
                    required:
                      - summary
                      - timeSeries
                    additionalProperties: false
                required:
                  - id
                  - status
                  - rangeStart
                  - rangeEnd
                  - lastSyncedAt
                  - enabled
                  - data
                additionalProperties: false
        '400':
          description: Validation error or missing resource scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Insight operation conflicts with its current state
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Insight operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````