openapi: 3.0.0
info:
  description: Authory API for 3rd parties.
  version: "0.9"
  title: Authory Public Api
  contact:
    email: emanuel@authory.com
servers:
  - url: https://api-production.authory.com
paths:
  /api/v1/add-webhook:
    post:
      tags:
        &a1
        - PublicApi
      summary: ""
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublicApiAddWebhookBodyParams"
      responses:
        "200":
          description: Returns a response type PublicApiWebhookResponsePayload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicApiWebhookResponsePayload"
  /api/v1/delete-webhook:
    post:
      tags: *a1
      summary: ""
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublicApiDeleteWebhookBodyParams"
      responses:
        "200":
          description: Returns a response type EmptyResponse
  /api/v1/list-content:
    get:
      tags: *a1
      summary: ""
      parameters:
        - in: query
          name: skip
          description: skip QUERY parameter
          schema:
            pattern: ^[-+]?[0-9]+$
            type: string
        - in: query
          name: take
          description: take QUERY parameter
          schema:
            pattern: ^[-+]?[0-9]+$
            type: string
        - in: query
          name: collection
          description: collection QUERY parameter
          schema:
            type: string
      responses:
        "200":
          description: Returns a response type PublicApiContentListPayload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicApiContentListPayload"
  /api/v1/list-collections:
    get:
      tags: *a1
      summary: ""
      parameters: []
      responses:
        "200":
          description: Returns a response type PublicApiCollectionListPayload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicApiCollectionListPayload"
  /api/v1/list-webhooks:
    get:
      tags: *a1
      summary: ""
      parameters: []
      responses:
        "200":
          description: Returns a response type PublicApiWebhookListPayload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicApiWebhookListPayload"
components:
  schemas:
    PublicApiAddWebhookBodyParams:
      properties:
        hookUrl:
          format: url
          type: string
        type:
          enum:
            - ArticleAdded
            - ArticleAddedToCollection
          type: string
        collectionId:
          type: string
      type: object
      required:
        - hookUrl
        - type
    PublicApiDeleteWebhookBodyParams:
      properties:
        hookId:
          type: string
      type: object
      required:
        - hookId
    PublicApiListContentQueryParams:
      properties:
        skip:
          pattern: ^[-+]?[0-9]+$
          type: string
        take:
          pattern: ^[-+]?[0-9]+$
          type: string
        collection:
          type: string
      type: object
    PublicApiWebhookResponsePayload:
      properties:
        id:
          type: string
        hookUrl:
          format: url
          type: string
        type:
          enum:
            - ArticleAdded
            - ArticleAddedToCollection
          type: string
        collectionId:
          type: string
      type: object
      required:
        - id
        - hookUrl
        - type
    PublicApiWebhookListPayload:
      properties:
        hooks:
          items:
            $ref: "#/components/schemas/PublicApiWebhookResponsePayload"
          type: array
      type: object
      required:
        - hooks
    PublicApiUserInfoPayload:
      properties:
        firstName:
          type: string
        lastName:
          type: string
        slug:
          type: string
      type: object
      required:
        - firstName
        - lastName
        - slug
    PublicApiCollectionResponsePayload:
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
      type: object
      required:
        - id
        - name
        - description
    PublicApiCollectionListPayload:
      properties:
        collections:
          items:
            $ref: "#/components/schemas/PublicApiCollectionResponsePayload"
          type: array
        user:
          items:
            $ref: "#/components/schemas/PublicApiUserInfoPayload"
          type: array
      type: object
      required:
        - collections
        - user
    PublicApiContentResponsePayload:
      properties:
        type:
          enum:
            - Article
            - VideoPost
            - TextPost
            - ImagePost
            - ReplyPost
            - PodcastItem
            - PdfFile
            - Video
            - Thread
          type: string
        title:
          type: string
        description:
          type: string
        plainText:
          type: string
        source:
          type: string
        date:
          oneOf:
            - format: date
              type: string
            - format: date-time
              type: string
          type: string
        textLength:
          type: integer
        wordCount:
          type: integer
        pageUrl:
          format: url
          type: string
        content:
          type: object
        previewImage:
          format: url
          type: string
      type: object
      required:
        - type
        - plainText
        - textLength
        - wordCount
        - content
    PublicApiContentListPayload:
      properties:
        content:
          items:
            $ref: "#/components/schemas/PublicApiContentResponsePayload"
          type: array
        user:
          items:
            $ref: "#/components/schemas/PublicApiUserInfoPayload"
          type: array
      type: object
      required:
        - content
        - user
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: key
security:
  - ApiKeyAuth: []
