Knownwell portfolios API

The portfolios API from Knownwell — 2 operation(s) for portfolios.

OpenAPI Specification

knownwell-portfolios-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Knownwell api-keys portfolios API
  description: API for accessing Knownwell client data and Knownwell scores
  version: v1
tags:
- name: portfolios
paths:
  /v1/portfolios:
    get:
      tags:
      - portfolios
      summary: List Portfolios
      operationId: list_portfolios_v1_portfolios_get
      security:
      - APIKeyHeader: []
      parameters:
      - name: include_system
        in: query
        required: false
        schema:
          type: boolean
          default: true
          title: Include System
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/portfolios/{portfolio_id}:
    get:
      tags:
      - portfolios
      summary: Get Portfolio
      operationId: get_portfolio_v1_portfolios__portfolio_id__get
      security:
      - APIKeyHeader: []
      parameters:
      - name: portfolio_id
        in: path
        required: true
        schema:
          type: string
          title: Portfolio Id
      - name: include_clients
        in: query
        required: false
        schema:
          type: boolean
          default: true
          title: Include Clients
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 500
          minimum: 1
          default: 100
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PortfolioUser:
      properties:
        id:
          type: string
          title: Id
        displayName:
          anyOf:
          - type: string
          - type: 'null'
          title: Displayname
        email:
          anyOf:
          - type: string
          - type: 'null'
          title: Email
      type: object
      required:
      - id
      title: PortfolioUser
      description: User information for portfolio access.
    ClientMetadata:
      properties:
        accountOwner:
          anyOf:
          - type: string
          - type: 'null'
          title: Accountowner
        annualRevenue:
          anyOf:
          - type: string
          - type: 'null'
          title: Annualrevenue
        industry:
          anyOf:
          - type: string
          - type: 'null'
          title: Industry
        location:
          anyOf:
          - type: string
          - type: 'null'
          title: Location
        active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Active
        accountStatus:
          anyOf:
          - type: string
          - type: 'null'
          title: Accountstatus
        domain:
          anyOf:
          - type: string
          - type: 'null'
          title: Domain
        clientType:
          anyOf:
          - type: string
          - type: 'null'
          title: Clienttype
        revenueTTM:
          anyOf:
          - type: number
          - type: 'null'
          title: Revenuettm
        revenueF12M:
          anyOf:
          - type: number
          - type: 'null'
          title: Revenuef12M
      type: object
      title: ClientMetadata
      description: Client metadata.
    ScoreChange:
      properties:
        change:
          type: number
          title: Change
          description: Absolute change in score
        percentage:
          anyOf:
          - type: number
          - type: 'null'
          title: Percentage
          description: Percentage change
        previousScore:
          type: number
          title: Previousscore
          description: Score at start of period
      type: object
      required:
      - change
      - previousScore
      title: ScoreChange
      description: Score change over a time period.
    ScoreChanges:
      properties:
        7day:
          anyOf:
          - $ref: '#/components/schemas/ScoreChange'
          - type: 'null'
          description: 7-day change
        30day:
          anyOf:
          - $ref: '#/components/schemas/ScoreChange'
          - type: 'null'
          description: 30-day change
      type: object
      title: ScoreChanges
      description: Score changes over different time periods.
    PortfolioDetailResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        customerId:
          type: string
          title: Customerid
        clientCount:
          type: integer
          title: Clientcount
          description: Number of clients in portfolio
        userIds:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Userids
          description: User IDs with access
        isSystem:
          type: boolean
          title: Issystem
          description: Whether this is a system portfolio
          default: false
        createdAt:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Createdat
        updatedAt:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updatedat
        clients:
          items:
            $ref: '#/components/schemas/ClientResponse'
          type: array
          title: Clients
        users:
          anyOf:
          - items:
              $ref: '#/components/schemas/PortfolioUser'
            type: array
          - type: 'null'
          title: Users
        health:
          anyOf:
          - $ref: '#/components/schemas/PortfolioHealthResponse'
          - type: 'null'
      type: object
      required:
      - id
      - name
      - customerId
      - clientCount
      - clients
      title: PortfolioDetailResponse
      description: Detailed portfolio response with clients and health metrics.
    PortfolioHealthResponse:
      properties:
        score:
          type: integer
          title: Score
        breakdown:
          additionalProperties:
            type: integer
          type: object
          title: Breakdown
        distribution:
          additionalProperties:
            type: integer
          type: object
          title: Distribution
        customerId:
          type: string
          title: Customerid
        chr2CutoverDate:
          anyOf:
          - type: string
          - type: 'null'
          title: Chr2Cutoverdate
          description: CHR 2.0 cutover date if enabled
      type: object
      required:
      - score
      - breakdown
      - distribution
      - customerId
      title: PortfolioHealthResponse
      description: Portfolio health metrics.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    PortfolioListResponse:
      properties:
        portfolios:
          items:
            $ref: '#/components/schemas/PortfolioResponse'
          type: array
          title: Portfolios
        total:
          type: integer
          title: Total
        customerId:
          type: string
          title: Customerid
      type: object
      required:
      - portfolios
      - total
      - customerId
      title: PortfolioListResponse
      description: Response model for list of portfolios.
    PortfolioResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        customerId:
          type: string
          title: Customerid
        clientCount:
          type: integer
          title: Clientcount
          description: Number of clients in portfolio
        userIds:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Userids
          description: User IDs with access
        isSystem:
          type: boolean
          title: Issystem
          description: Whether this is a system portfolio
          default: false
        createdAt:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Createdat
        updatedAt:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updatedat
      type: object
      required:
      - id
      - name
      - customerId
      - clientCount
      title: PortfolioResponse
      description: Response model for portfolio list.
    ClientResponse:
      properties:
        id:
          type: string
          title: Id
        customerId:
          type: string
          title: Customerid
        name:
          type: string
          title: Name
        score:
          type: integer
          title: Score
        scoreSource:
          anyOf:
          - type: string
          - type: 'null'
          title: Scoresource
          description: 'Score data source: chr1 or chr2'
        scoreChanges:
          anyOf:
          - $ref: '#/components/schemas/ScoreChanges'
          - type: 'null'
          description: Score changes over time
        lastContactDate:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Lastcontactdate
        lastUpdatedAt:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Lastupdatedat
        hasInsufficientData:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Hasinsufficientdata
        metadata:
          anyOf:
          - $ref: '#/components/schemas/ClientMetadata'
          - type: 'null'
        extraColumns:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Extracolumns
          description: Custom column values
        historicalData:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Historicaldata
        archived:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Archived
      type: object
      required:
      - id
      - customerId
      - name
      - score
      title: ClientResponse
      description: Response model for client data.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key