openapi: 3.0.1
info:
  title: Meltwater Copilot Integration
  description: Meltwater Data Source for Copilot Plugin
  version: "0.1"
servers:
  - url: https://pluginowler.owler.com
    description: Production Server URL
paths:
  /openai/news:
    post:
      tags:
        - open-ai-controller
      summary: Get data about news article by id and url of the article. The response
        will have the details about the news article and the details about the company
        mentioned in the news
      operationId: getNewsData
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedSearchRequest'
        required: true
      responses:
        "400":
          description: Invalid company name
        "404":
          description: Company not found
        "200":
          description: Details about the Article
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedDataResponse'
  /openai/news/company:
    post:
      tags:
        - open-ai-controller
      summary: Get latest news for the company or the watchlist created by user on
        meltwater product by watchlist id. Users can also filter news by category.
      operationId: getLatestNewsForCompany
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LatestCompanyFeedSearchRequest'
        required: true
      responses:
        "400":
          description: Invalid company name
        "404":
          description: Company not found
        "200":
          description: Details about the Article
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestCompanyFeedResponse'
  /openai/company:
    post:
      tags:
        - open-ai-controller
      summary: "Get company details by the company name or website of the company.\
        \ The response will contain the company's overview and key data points like\
        \ revenue chart, list of key people in leadership position ,10 latest news,\
        \ Key events,Company data about top 3 competitors for the company"
      operationId: getCompanyDetails
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanySearchRequest'
        required: true
      responses:
        "200":
          description: Found details about the company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyDataResponse'
        "400":
          description: Invalid company name
        "404":
          description: Company not found
  /openai/company/socialMedia:
    post:
      tags:
        - open-ai-controller
      summary: Get latest tweets for the company.
      operationId: getLatestSocialMediaForCompany
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SocialMediaRequest'
        required: true
      responses:
        "200":
          description: Details about the Article
          content:
            application/json:
              schema:
                type: string
        "400":
          description: Invalid company name
        "404":
          description: Company not found
  /openai/company/socialMedia/mentions:
    post:
      tags:
        - open-ai-controller
      operationId: getLatestSocialMediaMentions
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SocialMediaRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SocialMediaResponse'
  /openai/company/competitor:
    post:
      tags:
        - open-ai-controller
      summary: "Get competitor list for the company by the company name or website\
        \ of the company. The response will contain the competitor's overview and\
        \ key data points like revenue chart, list of key people in leadership position\
        \ ,10 latest news, Key events."
      operationId: getCompetitors
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanySearchRequest'
        required: true
      responses:
        "400":
          description: Invalid company name
        "404":
          description: Company not found
        "200":
          description: Found list of competitors for given company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyListDataResponse'
  /openai/company/advanceSearch:
    post:
      tags:
        - open-ai-controller
      summary: "Get data for list of top 3 companies in the same industry, sector\
        \ or location. Location can be city state or country"
      operationId: findCompaniesByAdvanceSearch
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyAdvanceSearchRequest'
        required: true
      responses:
        "404":
          description: No data match the request
        "200":
          description: found List of company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdvanceSearchResponse'
        "400":
          description: Invalid Search request
components:
  schemas:
    FeedSearchRequest:
      type: object
      properties:
        id:
          type: string
          description: unique id of the news or feed
        url:
          type: string
          description: URL of the news article
        userQuery:
          type: string
          description: Entire prompt entered by the user in the Chat UI
      description: Details about the News article.
    CeoDetail:
      type: object
      properties:
        firstName:
          type: string
          description: First name of the CEO
        lastName:
          type: string
          description: Last name of the CEO
        designation:
          type: string
          description: Designation of the CEO
        ceoRating:
          type: integer
          description: Rating for the CEO
          format: int32
        ceoPic:
          type: string
          description: Picture of the CEO
        linkedIn:
          type: string
          description: Linkedin of the CEO
        twitter:
          type: string
          description: Twitter of the CEO
      description: Details about the CEO of the company
    Company:
      type: object
      properties:
        companyId:
          type: integer
          description: Unique company id of the company. Dont display this data to
            user
          format: int64
        companyName:
          type: string
          description: Name of the company
        description:
          type: string
          description: Description of the company
        shortName:
          type: string
          description: Short Name of the company
        domainName:
          type: string
          description: Domain of the company
        logo:
          type: string
          description: Logo of the company
        founded:
          type: string
          description: Founded date of the company
        ownership:
          type: string
          description: Ownership status of the company
        revenueString:
          type: string
          description: Revenue of the company in USD
        employeeString:
          type: string
          description: Employee count of the company
        industrySectors:
          type: array
          description: Sectors the company belongs to
          items:
            type: string
            description: Sectors the company belongs to
        links:
          type: array
          description: Social links of the company
          items:
            $ref: '#/components/schemas/Link'
        ceoDetail:
          $ref: '#/components/schemas/CeoDetail'
        city:
          type: string
          description: City of the company Headquarters
        state:
          type: string
          description: State of the company Headquarters
        country:
          type: string
          description: Country of the company Headquarters
        statusInfo:
          $ref: '#/components/schemas/StatusInfo'
        cpLink:
          type: string
          description: Company profile link to vew more details
        exchange:
          type: string
          description: Stock exchange of the company
        ticker:
          type: string
          description: Ticker symbol of the company
        totalFunding:
          type: integer
          description: Total funding raised by the company
          format: int64
        street1Address:
          type: string
          description: Street address 1 of the company Headquarters
        street2Address:
          type: string
          description: Street address 2 of the company Headquarters
        zipcode:
          type: string
          description: Zipcode of the company Headquarters
        phoneNumber:
          type: string
          description: Phone number of the company Headquarters
        leaderShipDetails:
          type: array
          description: List of key leadership in the company
          items:
            $ref: '#/components/schemas/LeaderShipDetail'
        sicCode:
          type: array
          description: SIC Code of the company
          items:
            type: string
            description: SIC Code of the company
        website:
          type: string
          description: Website of the company
        industries:
          type: array
          description: Industries the company belongs to
          items:
            type: string
            description: Industries the company belongs to
        investmentCount:
          type: integer
          description: Total number of investment made by the company
          format: int32
        acquisitionCount:
          type: integer
          description: Total number of acquisition of the company
          format: int32
        revenueChartData:
          type: array
          description: Revenue chart data for the company
          items:
            $ref: '#/components/schemas/RevenueChartDatum'
        competitorData:
          type: array
          description: Competitor data of the searched company
          items:
            $ref: '#/components/schemas/Competitor'
        latestCompanyNews:
          type: array
          description: "Latest news articles,press release,blog and videos published\
            \ by or about the company "
          items:
            $ref: '#/components/schemas/FeedData'
        topEvents:
          type: array
          description: Top events happened for the company with event category
          items:
            $ref: '#/components/schemas/FeedData'
      description: List company and its details
    Competitor:
      type: object
      properties:
        companyId:
          type: integer
          description: Unique company id of the company. Dont display this data to
            user
          format: int64
        companyName:
          type: string
          description: Name of the company
        description:
          type: string
          description: Description of the company
        shortName:
          type: string
          description: Short Name of the company
        domainName:
          type: string
          description: Domain of the company
        logo:
          type: string
          description: Logo of the company
        founded:
          type: string
          description: Founded date of the company
        ownership:
          type: string
          description: Ownership status of the company
        revenueString:
          type: string
          description: Revenue of the company in USD
        employeeString:
          type: string
          description: Employee count of the company
        industrySectors:
          type: array
          description: Sectors the company belongs to
          items:
            type: string
            description: Sectors the company belongs to
        links:
          type: array
          description: Social links of the company
          items:
            $ref: '#/components/schemas/Link'
        ceoDetail:
          $ref: '#/components/schemas/CeoDetail'
        city:
          type: string
          description: City of the company Headquarters
        state:
          type: string
          description: State of the company Headquarters
        country:
          type: string
          description: Country of the company Headquarters
        statusInfo:
          $ref: '#/components/schemas/StatusInfo'
        cpLink:
          type: string
          description: Company profile link to vew more details
        exchange:
          type: string
          description: Stock exchange of the company
        ticker:
          type: string
          description: Ticker symbol of the company
        totalFunding:
          type: integer
          description: Total funding raised by the company
          format: int64
        street1Address:
          type: string
          description: Street address 1 of the company Headquarters
        street2Address:
          type: string
          description: Street address 2 of the company Headquarters
        zipcode:
          type: string
          description: Zipcode of the company Headquarters
        phoneNumber:
          type: string
          description: Phone number of the company Headquarters
        leaderShipDetails:
          type: array
          description: List of key leadership in the company
          items:
            $ref: '#/components/schemas/LeaderShipDetail'
        sicCode:
          type: array
          description: SIC Code of the company
          items:
            type: string
            description: SIC Code of the company
        website:
          type: string
          description: Website of the company
        industries:
          type: array
          description: Industries the company belongs to
          items:
            type: string
            description: Industries the company belongs to
        investmentCount:
          type: integer
          description: Total number of investment made by the company
          format: int32
        acquisitionCount:
          type: integer
          description: Total number of acquisition of the company
          format: int32
        revenueChartData:
          type: array
          description: Revenue chart data for the company
          items:
            $ref: '#/components/schemas/RevenueChartDatum'
        latestCompanyNews:
          type: array
          description: "Latest news articles,press release,blog and videos published\
            \ by or about the company "
          items:
            $ref: '#/components/schemas/FeedData'
        topEvents:
          type: array
          description: Top events happened for the company with event category
          items:
            $ref: '#/components/schemas/FeedData'
      description: Competitor data of the searched company
    FeedData:
      type: object
      properties:
        title:
          type: string
          description: Title of the news
        source:
          type: string
          description: Publisher Source of the news
        description:
          type: string
          description: Short description of the news
        feedPublishDate:
          type: integer
          description: Publish date of the news
          format: int64
        url:
          type: string
          description: Source URL news
        companyName:
          type: string
          description: Name of the company mentioned in the article
        companyPageURL:
          type: string
          description: Url to see more information about the company at owler
        category:
          type: string
          description: Category of the news
          enum:
            - corona_virus
            - FUNDING
            - ACQUISITION
            - PEOPLE
            - product_launch
            - info_leak
            - partnership
            - joint_venture
            - awards
            - conference_presentation
            - rebrand
            - restructuring
            - layoffs
            - regulatory
            - new_office
            - ipo_announcement
            - hiring
            - esg
            - employee
            - bankruptcy
            - fraud
            - cyber_attack
            - revenue
            - NEWS
            - PRESS
            - BLOG
            - VIDEOS
        companyId:
          type: integer
          format: int64
      description: Top events happened for the company with event category
    FeedDataResponse:
      type: object
      properties:
        feedData:
          $ref: '#/components/schemas/FeedData'
        company:
          $ref: '#/components/schemas/Company'
        Details about user for the assistant for personalization:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
    LeaderShipDetail:
      type: object
      properties:
        firstName:
          type: string
          description: First name of the Leader
        lastName:
          type: string
          description: Last name of the Leader
        designation:
          type: string
          description: Designation of the Leader
        ceoPic:
          type: string
          description: Rating for the Leader
        linkedIn:
          type: string
          description: Linkedin of the Leader
        twitter:
          type: string
          description: Twitter of the Leader
      description: List of key leadership in the company
    Link:
      type: object
      properties:
        linkType:
          type: string
        link:
          type: string
      description: Social links of the company
    RevenueChartDatum:
      type: object
      properties:
        key:
          type: string
          description: Revenue Quarter date
        value:
          type: string
          description: Revenue value
      description: Revenue chart data for the company
    StatusInfo:
      type: object
      properties:
        parent_date:
          type: string
          description: Parent acquisition date for company
        parent_name:
          type: string
          description: Parent company name
        parent_website:
          type: string
          description: Parent website of the company
        status:
          type: string
          description: Status of the company
      description: Status Info about the company
    UserData:
      type: object
      properties:
        name:
          type: string
          description: User Name
        employer:
          type: string
          description: User Employer
        jobRole:
          type: string
          description: User Job Role
        aboutCompany:
          type: string
          description: details about the company user work for
        memberId:
          type: integer
          description: Product details of the company offering
          format: int64
    LatestCompanyFeedSearchRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the company
        domain:
          type: string
          description: website url of the company
        filter:
          type: array
          description: List of news category to filter
          items:
            type: string
            description: List of news category to filter
            enum:
              - corona_virus
              - FUNDING
              - ACQUISITION
              - PEOPLE
              - product_launch
              - info_leak
              - partnership
              - joint_venture
              - awards
              - conference_presentation
              - rebrand
              - restructuring
              - layoffs
              - regulatory
              - new_office
              - ipo_announcement
              - hiring
              - esg
              - employee
              - bankruptcy
              - fraud
              - cyber_attack
              - revenue
              - NEWS
              - PRESS
              - BLOG
              - VIDEOS
          enum:
            - corona_virus
            - FUNDING
            - ACQUISITION
            - PEOPLE
            - product_launch
            - info_leak
            - partnership
            - joint_venture
            - awards
            - conference_presentation
            - rebrand
            - restructuring
            - layoffs
            - regulatory
            - new_office
            - ipo_announcement
            - hiring
            - esg
            - employee
            - bankruptcy
            - fraud
            - cyber_attack
            - revenue
            - NEWS
            - PRESS
            - BLOG
            - VIDEOS
        savedListId:
          type: string
          description: Saved list id if the user wants to get the news by watchlist
            create in owler
        userQuery:
          type: string
          description: Entire prompt entered by the user in the Chat UI
      description: Search request to get news by company name or website
    LatestCompanyFeedResponse:
      type: object
      properties:
        feedDataList:
          type: array
          description: List news articles and its details
          items:
            $ref: '#/components/schemas/FeedData'
        company:
          $ref: '#/components/schemas/Company'
        Details about user for the assistant for personalization:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
    CompanySearchRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the company
        domain:
          type: string
          description: website url of the company
        userQuery:
          type: string
          description: Entire prompt entered by the user in the Chat UI
      description: Details about the Company to be searched
    CompanyDataResponse:
      type: object
      properties:
        companyData:
          $ref: '#/components/schemas/Company'
        suggestedLinks:
          type: array
          description: List of links that assistant can use to suggest user the next
            steps
          items:
            $ref: '#/components/schemas/SuggestedLinks'
        USER_DETAILS_TO_ASSISTANT:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
    SuggestedLinks:
      type: object
      properties:
        title:
          type: string
          description: The title for the links that assistant can be use to suggest
            user the next steps
        link:
          type: string
          description: The links that assistant can be use to suggest user the next
            steps
      description: List of links that assistant can use to suggest user the next steps
    SocialMediaRequest:
      type: object
      properties:
        days:
          type: integer
          format: int32
        count:
          type: integer
          format: int32
        name:
          type: string
        domain:
          type: string
      description: Search request to get news by company name or website
    SocialMedia:
      type: object
      properties:
        publishDate:
          type: string
          format: date-time
        hashTags:
          type: array
          items:
            type: string
        authorHandle:
          type: string
        authorName:
          type: string
        sourceLink:
          type: string
        authorFollowers:
          type: integer
          format: int32
        content:
          type: string
      description: List posts and its details
    SocialMediaResponse:
      type: object
      properties:
        socialMediaList:
          type: array
          description: List posts and its details
          items:
            $ref: '#/components/schemas/SocialMedia'
        company:
          $ref: '#/components/schemas/Company'
        Details about user for the assistant for personalization:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
    CompanyListDataResponse:
      type: object
      properties:
        companyData:
          type: array
          description: List of competitors for the company
          items:
            $ref: '#/components/schemas/Competitor'
        suggestedLinks:
          type: array
          description: List of links that assistant can use to suggest user the next
            steps
          items:
            $ref: '#/components/schemas/SuggestedLinks'
        USER_DETAILS_TO_ASSISTANT:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
    CompanyAdvanceSearchRequest:
      type: object
      properties:
        industryOrSector:
          type: string
          description: The industry or sector name
        location:
          type: string
          description: "Location Information like city, state, country"
        companyType:
          type: string
          description: type of the company
          enum:
            - Private
            - Product/Brand/Service
            - Investment Company
            - Government
            - NGO/NPO/NFP/Organization/Association
            - SPAC
        revenueMinimum:
          type: integer
          description: Minimum annual revenue the company
          format: int64
        revenueMaximum:
          type: integer
          description: Maximum annual revenue the company
          format: int64
        employeeCountMinimum:
          type: integer
          description: Minimum employee count of the company
          format: int64
        employeeCountMaximum:
          type: integer
          description: Maximum employee count of the company
          format: int64
        includeEvents:
          type: boolean
          description: Include latest news and events in the response
        userQuery:
          type: string
          description: Entire prompt entered by the user in the Chat UI
      description: Search Parameters to get list of companies
    AdvanceSearchResponse:
      type: object
      properties:
        companies:
          type: array
          description: List company and its details
          items:
            $ref: '#/components/schemas/Company'
        Details about user for the assistant for personalization:
          $ref: '#/components/schemas/UserData'
        EXTRA_INFORMATION_TO_ASSISTANT:
          type: string
