---
openapi: 3.0.3
info:
  title: Sources API
  description: API to search for sources monitored by Knewin
  contact:
    name: Knewin
    url: https://www.knewin.com/contato/
    email: contato@knewin.com
  version: 1.0.0
tags:
- name: sources
paths:
  /flip:
    post:
      tags:
      - sources
      summary: Search for all flip sources
      description: You can search by id or by query
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SourcesRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewsSourcesResponse"
      security:
      - sources-auth: []
  /online:
    post:
      tags:
      - sources
      summary: Search for all online sources
      description: You can search by id or by query
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SourcesRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewsSourcesResponse"
      security:
      - sources-auth: []
  /radio:
    post:
      tags:
      - sources
      summary: Search for all radio sources
      description: You can search by id or by query
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SourcesRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MediaSourcesResponse"
      security:
      - sources-auth: []
  /tv:
    post:
      tags:
      - sources
      summary: Search for all tv sources
      description: You can search by id or by query
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SourcesRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MediaSourcesResponse"
      security:
      - sources-auth: []
  /video:
    post:
      tags:
      - sources
      summary: Search for all video sources
      description: You can search by id or by query
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SourcesRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewsSourcesResponse"
      security:
      - sources-auth: []
components:
  schemas:
    Locality:
      type: object
      properties:
        country:
          type: string
        state:
          type: string
    MediaSource:
      type: object
      properties:
        sourceId:
          format: int64
          type: integer
        name:
          type: string
        locality:
          $ref: "#/components/schemas/Locality"
    MediaSourcesResponse:
      type: object
      properties:
        numDocs:
          format: int32
          type: integer
        offset:
          format: int32
          type: integer
        count:
          format: int32
          type: integer
        sources:
          type: array
          items:
            $ref: "#/components/schemas/MediaSource"
    NewsSource:
      type: object
      properties:
        sourceId:
          format: int64
          type: integer
        name:
          type: string
        locality:
          $ref: "#/components/schemas/Locality"
        url:
          type: string
    NewsSourcesResponse:
      type: object
      properties:
        numDocs:
          format: int32
          type: integer
        offset:
          format: int32
          type: integer
        count:
          format: int32
          type: integer
        sources:
          type: array
          items:
            $ref: "#/components/schemas/NewsSource"
    SourcesRequest:
      type: object
      properties:
        query:
          type: string
        ids:
          type: array
          items:
            format: int64
            type: integer
        offset:
          format: int32
          type: integer
  securitySchemes:
    sources-auth:
      type: http
      description: The authorization is your company access key
      scheme: Bearer
