---
openapi: 3.0.1
info:
  title: API V1 with Rswag
  version: v1
  termsOfService: http://localhost/manage_terms
  contact:
    name: Junkipedia Help
    url: http://localhost/contact
  description: |
    **The API follows the JSON:API specification, version 1.0.**

    #### Authentication
    All API requests require authentication.
    The auth mechanism is OAuth 2.0 Bearer Token.
    Authenticated users in Junkipedia with a role of manager or above can gain access to this API by:

    1. Logging in to Junkipedia
    2. Click your user name in the top right corner of the application
    3. Click "Manage User Account"
    4. Click "Manage API Keys"
    5. Click "Create"
    6. An API Key will be generated; this API Key is the bearer token for authentication.
    7. Pass a header with every API request that includes: "Authorization: bearer [your token]"

    ### Base Path: https://www.junkipedia.org/api/v1
    All Junkipedia URLs are accessibile at: https://www.junkipedia.org/api/v1
    This means that if you wish to access the posts api, the full path would be: https://www.junkipedia.org/api/v1/posts

    #### Authorization
    An API Key that you create within Junkipedia grants the same permissions as the user who generated it.
    That is, possessing an API Key created by User X allows you to see the same data (issues, submissions, lists) that User X can see in Junkipedia, and allows you to perform the same actions that User X can perform in Junkipedia.
    When you perform actions via the API using User X's API Key, then Junkipedia will record the action as being performed by User X.
    For these reasons, it is imperative to treat these API Keys as akin to passwords and manage them similarly to how you would manage passwords.

    #### Using Your API Key In Requests
    Step by step instructions for issuing API requests with your API Key are given at
    [docs.junkipedia.org/reference-material/api/using-your-api-key](https://docs.junkipedia.org/reference-material/api/using-your-api-key).
    Examples are included with these instructions.

    #### Scope of APIs
    Currently, only a subset of the functionality that Junkipedia offers is available via this API.
    See the following documentation for a description of what actions can be performed, and what data can be accessed.
externalDocs:
  description: JSON:API Specification
  url: https://jsonapi.org/format/1.0/
paths:
  "/api/v1/agents/{agent_id}/observations":
    parameters:
    - name: agent_id
      in: path
      description: The record ID of agent
      required: true
      schema:
        type: string
    get:
      summary: Retrieve all observations for an agent
      tags:
      - Agents
      security:
      - Bearer: []
      description: Returns an array of all observations made by an agent
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Observation records
                    items:
                      "$ref": "#/components/schemas/observation"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/project_post"
                      - "$ref": "#/components/schemas/post"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/agents/{agent_id}/tasks":
    parameters:
    - name: agent_id
      in: path
      description: The record ID of agent
      required: true
      schema:
        type: string
    get:
      summary: Retrieve all tasks assigned to an agent
      tags:
      - Agents
      security:
      - Bearer: []
      description: Returns an array of all training tasks assigned to an agent
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Task records
                    items:
                      "$ref": "#/components/schemas/task"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/assigned_tasks/{id}":
    parameters:
    - name: id
      in: path
      description: Id of the assigned task being edited
      required: true
      schema:
        type: string
    patch:
      summary: update assigned_task
      tags:
      - Assigned Task
      security:
      - Bearer: []
      parameters:
      - name: status
        in: query
        required: true
        schema:
          type: string
          enum:
          - unseen
          - incomplete
          - completed
        description: 'Values: unseen, incomplete, completed'
      - name: responded_at
        in: query
        required: true
        description: DateTime String
        schema:
          type: string
      - name: response_values
        in: query
        schema:
          type: array
          items:
            type: string
        required: true
        description: List of responses recorded by user
      responses:
        '200':
          description: task updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
        '500':
          description: invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
  "/api/v1/channels/{channel_id}/get_posts":
    parameters:
    - name: channel_id
      in: path
      description: The record ID of a channel
      required: true
      schema:
        type: string
    get:
      summary: Retrieve all posts from a channel
      tags:
      - Channels
      security:
      - Bearer: []
      description: Returns an array of all posts from a channel
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Post records
                    items:
                      "$ref": "#/components/schemas/post_full"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/channels/search":
    get:
      summary: search channel
      tags:
      - Channels
      security:
      - Bearer: []
      description: |+
        This endpoint provides the ability to find channels based on their metadata.
        In junkipedia, a channel is record that stores metadata related to a social media account.

        Smaple CURL request:
        ```
          curl -X 'GET' 'https://www.junkipedia.org/api/v1/channels/search?handle=elonmusk' -H 'accept: application/json' -H 'Authorization: Bearer {auth_token}'
        ```

      parameters:
      - name: channel_uid
        in: query
        description: |+
          Use this parameter to search a channel based on the unique id from social media platform


          Example -- To search for this channel "https://facebook.com/100044504436603", copy the id from URL and use this parameter as following:


          GET /channels/search?channel_uid=100044504436603

        schema:
          type: string
      - name: handle
        in: query
        description: |
          This parameter searches channels based on the handle from social media platform


          Example -- To search for this channel "https://www.twitter.com/elonmusk", copy handle from the URL and use this parameter as following:


          GET /channels/search?handle=elonmusk
        schema:
          type: string
      - name: platform_name
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          This parameter searches channels based on the social media platform ids on Junkipedia.



          Possible values: `Facebook, Instagram, YouTube, TikTok, Parler, Rumble, Gab, GETTR, Twitter, Bitchute, VK, OK, Telegram, TruthSocial, Podcast, Substack, Threads, InstagramDirect, FacebookDirect, Line, Weibo, Bluesky, LinkedIn, Snapchat`



          **Note on Instagram:** `Instagram` and `InstagramDirect` are treated as equivalent for filtering. Passing either name (or either underlying platform id) returns results from both — your filter is automatically expanded to cover the full Instagram catalog. `InstagramDirect` is retained for backward compatibility and will be removed in a future release.


          Example -- To search for all facebook and instagram channels use this parameter as following:


          GET /channels/search?platform_name[]=Facebook&platform_name[]=Instagram
      - name: term
        in: query
        description: |
          This parameter searches for channels based on a keyword within metadata fields.



          These fields include: channel_uid, handle, link, channel_name



          Example -- To search for all channels that contain "news" in their metadata fields, you can use this parameter as following:


          GET /channels/search?keyword=news
        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `term` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assigning this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /channels?keyword=climate+change+-hoax&simple_query=true

          Note: When `simple_query` is enabled, substring query matching is automatically disabled.
        schema:
          type: string
      - name: indexed_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches channels based on when they were indexed in Junkipedia.


          Example -- To search for channels indexed after 2025-01-01, use this parameter as following:


          GET /channels/search?indexed_at_from=1735708800
        schema:
          type: string
      - name: indexed_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches channels based on when they were indexed in Junkipedia.


          Example -- To search for channels indexed before 2025-01-01, use this parameter as following:


          GET /channels/search?indexed_at_to=1735708800
        schema:
          type: string
      - name: page
        in: query
        description: |
          The `page` parameter selects a page of channel records within a paginated series. It works in combination with the `per_page` parameter.


          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      - name: per_page
        in: query
        description: |
          The `per_page` parameter determines the number of channel records to return for one request within a paginated series. It works in combination with the `page` parameter.


          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Channel records
                    items:
                      "$ref": "#/components/schemas/channel"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  meta:
                    type: object
                    properties:
                      total_channels:
                        type: integer
                      channels_count:
                        type: integer
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '422':
          description: Unprocessable Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: array
                    items:
                      type: object
                      properties:
                        detail:
                          type: string
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
  "/api/v1/channels":
    post:
      summary: create channel
      tags:
      - Channels
      security:
      - Bearer: []
      description: |
        Add a channel to the Junkipedia database from a social media URL. Uses real-time channel creation
        (the same process that occurs when adding a channel to a list), including fetching platform metadata
        and reindexing. If the channel already exists, the existing record is returned.

        Sample CURL requests:
        ```
          # Create a channel without tracking
          curl -X 'POST' 'https://www.junkipedia.org/api/v1/channels' \
            -H 'accept: application/json' \
            -H 'Authorization: Bearer {auth_token}' \
            -H 'Content-Type: application/json' \
            -d '{"channel_url": "https://www.twitter.com/IowaSOS"}'

          # Create a channel with tracking enabled
          curl -X 'POST' 'https://www.junkipedia.org/api/v1/channels' \
            -H 'accept: application/json' \
            -H 'Authorization: Bearer {auth_token}' \
            -H 'Content-Type: application/json' \
            -d '{"channel_url": "https://www.twitter.com/IowaSOS", "is_tracked": 1}'
        ```
      parameters:
      - name: channel_url
        in: query
        required: true
        description: 'The full URL of the social media channel to add (e.g., `https://www.twitter.com/IowaSOS`).

          '
        schema:
          type: string
      - name: is_tracked
        in: query
        required: false
        description: |
          Set to `1` to mark the channel as tracked and begin collecting posts. When set to `0` or omitted,
          the channel is added to the database but not tracked.
        schema:
          type: integer
      - name: collect_post_engagement_steps
        in: query
        required: false
        description: |
          Set to `1` to enable collection of engagement time-series data for individual posts on this channel.
          When set to `0` or omitted, engagement steps are not collected.
        schema:
          type: integer
      responses:
        '200':
          description: successful - channel created or existing channel returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/channel"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '422':
          description: Unprocessable Request - missing channel_url
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: array
                    items:
                      type: object
                      properties:
                        detail:
                          type: string
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
  "/api/v1/channels/{id}":
    parameters:
    - name: id
      in: path
      description: The record ID of a channel
      required: true
      schema:
        type: string
    get:
      summary: show channel
      tags:
      - Channels
      security:
      - Bearer: []
      description: Returns channel data for the given ID
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/channel"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/engagement_steps":
    get:
      summary: Retrieve all engagements for a channel or post
      tags:
      - Engagement Steps
      security:
      - Bearer: []
      description: Returns an array of all engagement steps for a channel or a post
      parameters:
      - name: type
        in: query
        required: true
        schema:
          type: string
          enum:
          - channel
          - post
        description: The model type for which engagement steps are required
      - name: record_id
        in: query
        required: true
        description: The record ID of post or channel
        schema:
          type: string
      - name: start_date
        in: query
        format: date-time
        description: A Unix Epoch timestamp (or integer number of seconds since the
          beginning of 1970) used to exclude engagement steps recorded before the
          given time.
        schema:
          type: string
      - name: end_date
        in: query
        format: date-time
        description: A Unix Epoch timestamp (or integer number of seconds since the
          beginning of 1970) used to exclude engagement steps recorded after the given
          time.
        schema:
          type: string
      - name: page
        in: query
        description: The `page` parameter selects a page of posts within a paginated
          series. It works in combination with the `per_page` parameter.
        schema:
          type: integer
      - name: per_page
        in: query
        description: The `per_page` parameter determines the number of post per page
          within a paginated series. It works in combination with the `page` parameter.
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Posts records
                    items:
                      "$ref": "#/components/schemas/engagement_step"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  meta:
                    type: object
                    properties:
                      total_steps:
                        type: integer
                      steps_count:
                        type: integer
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '422':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/issues":
    get:
      summary: list issues
      tags:
      - Issues
      security:
      - Bearer: []
      parameters:
      - name: filter[threat_level]
        in: query
        schema:
          type: integer
          enum:
          - 1
          - 2
          - 3
          - 4
          - 5
        description: 'One integer in the set: 1, 2, 3, 4, and 5'
      - name: filter[engagement_total]
        in: query
        description: Engagement total of the issue is greater than the supplied value
        schema:
          type: integer
      - name: filter[created_at]
        in: query
        description: Issue was created less than this many days ago
        schema:
          type: integer
      - name: filter[states]
        in: query
        schema:
          type: array
          items:
            type: integer
        description: |
          Query String Value: A 2 character acronym for a US state

          (You can have specify this query parameter multiple times with different values)

          Issue relates to this US state
      - name: filter[problems]
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Query String Value: A string with the name of the problem

          (You can have specify this query parameter multiple times with different values)

          Issue relates to this problem
      - name: filter[tags]
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Query String Value:  A string with the tag name

          (You can have specify this query parameter multiple times with different values)

          Issue is tagged with this tag
      - name: filter[platforms]
        in: query
        schema:
          type: array
          items:
            type: string
        description: "Query String Value:  A string with the platform name in the
          set: \n\n(You can have specify this query parameter multiple times with
          different values)\n\nIssue relates to this platform\n"
      - name: filter[media_types]
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - photo
            - video
            - link
            - page
            - tweet
            - article
            - status
        description: |
          Query String Value:  A string with the media type in the set: photo, video, link, page, tweet, article, and status

          (You can have specify this query parameter multiple times with different values)

          Issue relates to this media type
      - name: filter[tipline_types]
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - web
            - email
            - sms
            - whatsapp
            - slack
            - api
            - extension
        description: |
          Query String Value:  A string with the tipline type in the set: web, email, sms, whatsapp, slack, api, and extension

          (You can have specify this query parameter multiple times with different values)

          Issue relates to this tipline type
      - name: filter[languages]
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Query String Value:  A string with the language name

          (You can have specify this query parameter multiple times with different values)

          Issue relates to this language
      - name: filter[is_fact_checked]
        in: query
        description: |
          Query String Value:  A string with one of the boolean values "true" or "false"

          Issue is fact checked
        schema:
          type: boolean
      - name: filter[is_reviewed]
        in: query
        description: |
          Query String Value:  A string with one of the boolean values "true" or "false"

          Issue is reviewed
        schema:
          type: boolean
      - name: filter[is_public]
        in: query
        description: |
          Query String Value:  A string with one of the boolean values "true" or "false"

          Issue is public
        schema:
          type: boolean
      - name: include
        in: query
        description: "Query String Value:  A comma-separated list of relationship
          paths specifying which related resources to include in the response. Valid
          top level relationship paths are: comments, submissions, media_items.\n\n"
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Issue records
                    items:
                      "$ref": "#/components/schemas/issue"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/submission"
                      - "$ref": "#/components/schemas/media_item"
                      - "$ref": "#/components/schemas/comment"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
  "/api/v1/issues/{id}":
    parameters:
    - name: id
      in: path
      description: id
      required: true
      schema:
        type: string
    get:
      summary: show issue
      tags:
      - Issues
      security:
      - Bearer: []
      parameters:
      - name: include
        in: query
        description: "Query String Value:  A comma-separated list of relationship
          paths specifying which related resources to include in the response. Valid
          top level relationship paths are: comments, submissions, media_items.\n\n"
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/issue"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/submission"
                      - "$ref": "#/components/schemas/media_item"
                      - "$ref": "#/components/schemas/comment"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists/{list_id}/get_channels":
    parameters:
    - name: list_id
      in: path
      description: list_id
      required: true
      schema:
        type: string
    get:
      summary: get_channels list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Returns all channels from a list with the given ID
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Channel records
                    items:
                      "$ref": "#/components/schemas/channel"
                  meta:
                    type: object
                    properties:
                      total_channels:
                        type: integer
                      channels_count:
                        type: integer
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists/{list_id}/add_component":
    parameters:
    - name: list_id
      in: path
      description: list_id
      required: true
      schema:
        type: string
    post:
      summary: add_component list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Returns the created component object
      parameters:
      - name: handle
        in: query
        required: false
        description: The profile handle of the channel (only for line platform)
        schema:
          type: string
      - name: component_id
        in: query
        required: true
        description: The ID or URL of a channel or the search term
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/channel_full"
                  channel_id:
                    type: integer
                    nullable: true
                  channel_data:
                    type: object
                    nullable: true
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists/{list_id}/add_channels":
    parameters:
    - name: list_id
      in: path
      description: The record ID of list to be retrieved
      required: true
      schema:
        type: string
    post:
      summary: add_channels to list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Given list of ids of channels that exist in junkipedia, add them
        to the list
      parameters:
      - name: channel_ids
        in: query
        required: true
        description: Comma-separated IDs of channels to be added to the list
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists/{list_id}/remove_component":
    parameters:
    - name: list_id
      in: path
      description: list_id
      required: true
      schema:
        type: string
    delete:
      summary: remove_component list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Removes channel or a search_term from a list
      parameters:
      - name: component_id
        in: query
        required: true
        description: The record ID of the channel or the search term
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  channel:
                    "$ref": "#/components/schemas/channel_full"
                  message:
                    type: string
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists/{list_id}/get_posts":
    parameters:
    - name: list_id
      in: path
      description: The record ID of list to be retrieved
      required: true
      schema:
        type: string
    get:
      summary: get_posts list
      tags:
      - Lists
      security:
      - Bearer: []
      description: "Returns all posts from a list with the given ID. \n\n Note: This
        endpoint is only able to return a maximum of 10k records"
      parameters:
      - name: keyword
        in: query
        description: |
          Use this parameter to specify search terms. Results will include posts containing the words specified.


          Example -- To search for "climate change", separate the words with either `+` or `%20`.
          Note that `%20` represents the hex code for a space character but that a literal space character is not allowed in a URL.
          The two query strings below have the same effect.


          GET /posts?keyword=climate+change

          GET /posts?keyword=climate%20change



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters.
        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `keyword` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assignming this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /posts?keyword=climate+change+-hoax&simple_query=true
        schema:
          type: boolean
      - name: platform_names
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of strings with the names of platforms, possible values: ([])


          If this parameter is omitted, posts from all platforms will be included. If one or more platforms are given, only those specified will be included.


          Example -- To restrict the search only to YouTube and TikTok posts, insert these two platforms into the platform_names array using the following query string syntax:


          GET /posts?platform_names[]=YouTube&platform_names[]=TikTok



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: post_type
        in: query
        schema:
          type: string
          enum:
          - video
          - photo
          - link
          - status
        description: |
          An array of type names containing the following possible values: [video, photo, link, status]


          If this parameter is omitted, posts of all types will be included. If one or more types are given, only those specified will be included.


          Example -- To restrict the search only posts consisting of videos or photos, insert these two types into the post_type array using the following query string syntax:


          GET /posts?post_type[]=video&post_type[]=photo



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: engagement_from
        in: query
        description: |
          Any positive integer value specifying a lower bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements below 100:


          GET /posts?engagement_from=100.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: engagement_to
        in: query
        description: |
          Any positive integer value specifying a higher bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements above 5500:


          GET /posts?engagement_to=5500.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published before the given time.

          Example -- Omit posts with published before 2022:


          GET /posts?published_at_from=1641038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: published_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published after the given time.

          Example -- Omit posts with published after 2021:


          GET /posts?published_at_to=1641038399



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: language_code
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Language codes can be used to filter records of specified languages.
          This parameter uses URL encoded array syntax to allow any number of languages to be specified.

          Example -- Limit results to posts published in English or Spanish:


          GET /posts?language_code[]=EN&language_code[]=ES



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/language-code.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of categories to be excluded. Possible categories to be excluded are: [replies, ads, posts, retweets, quotes]


          Example -- The following request will omit ads from the results:


          GET /posts?exclude[]=ads



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/exclude.
      - name: channel
        in: query
        description: |
          The `channel` parameter filters posts based on properties of the channels (ie. accounts of organizations) that published them.
          This parameter uses URL encoded array syntax to allow any number of key-value pairs to be specified.


          Example -- Apply a filter to select posts from accounts belonging to organizations whose posts are blocked in Ukraine:


          GET /posts?channel[blocked_in_countries]=UA




          Example input:
          ```
          {
            "channel": {
              "blocked_in_countries": "USA"
            }
          }
          ```
          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/channel-properties.
        schema:
          type: object
      - name: page
        in: query
        description: |
          The `page` parameter selects a page of posts within a paginated series. It works in combination with the `per_page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      - name: per_page
        in: query
        description: |
          The `per_page` parameter determines the number of post per page within a paginated series. It works in combination with the `page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Post records
                    items:
                      "$ref": "#/components/schemas/post"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/lists":
    get:
      summary: list lists
      tags:
      - Lists
      security:
      - Bearer: []
      description: Returns all lists from the monitoring system
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: List records
                    items:
                      "$ref": "#/components/schemas/list"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
    post:
      summary: create list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Create a new list
      parameters:
      - name: name
        in: query
        required: true
        description: The name of the list being created
        schema:
          type: string
      - name: platform_name
        in: query
        required: true
        description: 'Name of the platform, possible values are ([]). Note: `Instagram`
          and `InstagramDirect` are treated as equivalent — either name resolves to
          the same underlying Instagram platform.'
        schema:
          type: string
      - name: enabled
        in: query
        description: Set the value for enabled field, possible values
        schema:
          type: boolean
      - name: list_type
        in: query
        schema:
          type: string
          enum:
          - LIST
          - SAVED_SEARCH
        description: String indicating the type of the list being created, possible
          values (LIST, SAVED_SEARCH)
      - name: public
        in: query
        description: Boolean that identifies if the list is public
        schema:
          type: boolean
      - name: description
        in: query
        description: Text containing the details about the list
        schema:
          type: string
      - name: update_frequency
        in: query
        schema:
          type: integer
          enum:
          - '1'
          - '2'
          - '4'
          - '6'
          - '12'
          - '24'
          - '48'
        description: 'Integer value that sets the update frequency for the list, possible
          values: (1, 2, 4, 6, 12, 24, 48)'
      - name: shared_with_my_organization
        in: query
        description: Boolean value to indicate if the list should be shared to the
          current user's organization
        schema:
          type: boolean
      - name: historical_collection
        in: query
        description: Boolean value to indicate if the list should collect historical
          posts for it's components
        schema:
          type: boolean
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  id:
                    type: integer
  "/api/v1/lists/{id}":
    parameters:
    - name: id
      in: path
      description: id
      required: true
      schema:
        type: string
    get:
      summary: show list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Returns list data for the given ID
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/list"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
    patch:
      summary: update list
      tags:
      - Lists
      security:
      - Bearer: []
      description: Update an existing list
      parameters:
      - name: name
        in: query
        description: The name of the list being created
        schema:
          type: string
      - name: enabled
        in: query
        description: Set the value for enabled field, possible values
        schema:
          type: boolean
      - name: list_type
        in: query
        schema:
          type: string
          enum:
          - LIST
          - SAVED_SEARCH
        description: String indicating the type of the list being created, possible
          values (LIST, SAVED_SEARCH)
      - name: public
        in: query
        description: Boolean that identifies if the list is public
        schema:
          type: boolean
      - name: description
        in: query
        description: Text containing the details about the list
        schema:
          type: string
      - name: update_frequency
        in: query
        schema:
          type: integer
          enum:
          - '1'
          - '2'
          - '4'
          - '6'
          - '12'
          - '24'
          - '48'
        description: 'Integer value that sets the update frequency for the list, possible
          values: (1, 2, 4, 6, 12, 24, 48)'
      - name: shared_with_my_organization
        in: query
        description: Boolean value to indicate if the list should be shared to the
          current user's organization
        schema:
          type: boolean
      - name: historical_collection
        in: query
        description: Boolean value to indicate if the list should collect historical
          posts for it's components
        schema:
          type: boolean
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/observations/potential":
    post:
      summary: create observation
      tags:
      - Observations
      security:
      - Bearer: []
      description: Create a new observation with status as potential
      parameters:
      - name: agent_id
        in: query
        required: true
        description: The id of agent that is creating this observation
        schema:
          type: integer
      - name: observed_at
        in: query
        required: true
        description: A timestamp at which the observation was observed by the agent
        schema:
          type: integer
      - name: tiktok_id
        in: query
        required: true
        description: The id of the tiktok post being observed
        schema:
          type: integer
      - name: is_ad
        in: query
        description: Boolean that identifies if the tiktok is an ad
        schema:
          type: boolean
      - name: is_live
        in: query
        description: Boolean that identifies if the tiktok is a live video
        schema:
          type: boolean
      - name: raw_observation_data
        in: query
        description: Contains all json data related to the tiktok and agent activity
          in string form
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
  "/api/v1/observations/rewatch_decision":
    post:
      summary: rewatch_decision observation
      tags:
      - Observations
      security:
      - Bearer: []
      description: Update observation status to watching and get rewatch information
        in json format
      parameters:
      - name: agent_id
        in: query
        required: true
        description: The id of agent of the observation
        schema:
          type: integer
      - name: observed_at
        in: query
        required: true
        description: A timestamp at which the observation was observed by the agent
        schema:
          type: integer
      - name: tiktok_id
        in: query
        required: true
        description: The id of the tiktok post being observed
        schema:
          type: integer
      - name: content_viewed_at
        in: query
        description: A timestamp at which the tiktok was viewed by the agent
        schema:
          type: integer
      - name: watch_data
        in: query
        description: Contains all data seen by the crawler in json format
        schema:
          type: string
      - name: task_id
        in: query
        description: The id of the task record
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  rewatch_decision:
                    type: boolean
                  rewatch_duration:
                    type: integer
                  observation_id:
                    type: integer
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/observations/actual":
    post:
      summary: Update a potential/watching observation to actual
      tags:
      - Observations
      security:
      - Bearer: []
      description: Create a new observation with status as actual
      parameters:
      - name: agent_id
        in: query
        required: true
        description: The id of agent of the observation
        schema:
          type: integer
      - name: observation_id
        in: query
        required: true
        description: The id of the observation to update
        schema:
          type: integer
      - name: reported_observation_duration
        in: query
        description: The reported observation time in seconds
        schema:
          type: integer
      - name: calculated_observation_duration
        in: query
        description: The calculated observation time in seconds
        schema:
          type: integer
      - name: counted_observation_duration
        in: query
        description: The counted observation time in seconds
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
  "/api/v1/observations":
    post:
      summary: create observation
      tags:
      - Observations
      security:
      - Bearer: []
      description: Create a new observation with status as actual
      parameters:
      - name: agent_id
        in: query
        required: true
        description: The id of agent that is creating this observation
        schema:
          type: integer
      - name: observed_at
        in: query
        required: true
        description: A timestamp at which the observation was observed by the agent
        schema:
          type: integer
      - name: tiktok_id
        in: query
        description: The id of the tiktok post being observed
        schema:
          type: integer
      - name: post_link
        in: query
        description: The url of the post being observed
        schema:
          type: string
      - name: is_ad
        in: query
        description: Boolean that identifies if the post is an ad
        schema:
          type: boolean
      - name: is_live
        in: query
        description: Boolean that identifies if the post is a live video
        schema:
          type: boolean
      - name: raw_observation_data
        in: query
        description: Contains all json data related to the post and agent activity
          in string form
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
        '403':
          description: Invalid Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
  "/api/v1/observations/{id}":
    parameters:
    - name: id
      in: path
      description: id
      required: true
      schema:
        type: string
    get:
      summary: show observation
      tags:
      - Observations
      security:
      - Bearer: []
      description: Returns observation data for the given ID
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/observation"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/project_post"
                      - "$ref": "#/components/schemas/post"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/posts/stats":
    get:
      summary: Get chart stats for all posts
      tags:
      - Posts
      security:
      - Bearer: []
      description: Returns all statistics for charts shown in the monitoring system
      parameters:
      - name: keyword
        in: query
        description: |
          Use this parameter to specify search terms. Results will include posts containing the words specified.


          Example -- To search for "climate change", separate the words with either `+` or `%20`.
          Note that `%20` represents the hex code for a space character but that a literal space character is not allowed in a URL.
          The two query strings below have the same effect.


          GET /posts?keyword=climate+change

          GET /posts?keyword=climate%20change



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters.
        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `keyword` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assignming this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /posts?keyword=climate+change+-hoax&simple_query=true
        schema:
          type: string
      - name: platform_names
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of strings with the names of platforms, possible values: ([])


          If this parameter is omitted, posts from all platforms will be included. If one or more platforms are given, only those specified will be included.


          Example -- To restrict the search only to YouTube and TikTok posts, insert these two platforms into the platform_names array using the following query string syntax:


          GET /posts?platform_names[]=YouTube&platform_names[]=TikTok



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: post_type
        in: query
        schema:
          type: string
          enum:
          - video
          - photo
          - link
          - status
        description: |
          An array of type names containing the following possible values: [video, photo, link, status]


          If this parameter is omitted, posts of all types will be included. If one or more types are given, only those specified will be included.


          Example -- To restrict the search only posts consisting of videos or photos, insert these two types into the post_type array using the following query string syntax:


          GET /posts?post_type[]=video&post_type[]=photo



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: is_short
        in: query
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
        description: |+
          An array of type names containing the following possible values: [true, false]
          Note: This parameter is only supported for youtube posts.


          This parameter filters videos based on their type i.e. short videos or normal videos.


          Example -- To restrict the search only videos consisting of short videos, set is_short parameter to true:


          GET /posts?is_short=true



      - name: in_reply_to_id
        in: query
        description: |+
          This parameter is used to filter posts that are replies to a specific post.


          Example -- To restrict the search only posts that are comments to a specific post, insert the ID of that post into the in_reply_to_id parameter using the following query string syntax:


          GET /posts?in_reply_to_id=123456789


        schema:
          type: integer
      - name: engagement_from
        in: query
        description: |
          Any positive integer value specifying a lower bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements below 100:


          GET /posts?engagement_from=100.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: engagement_to
        in: query
        description: |
          Any positive integer value specifying a higher bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements above 5500:


          GET /posts?engagement_to=5500.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published before the given time.

          Example -- Omit posts with published before 2022:


          GET /posts?published_at_from=1641038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: published_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published after the given time.

          Example -- Omit posts with published after 2021:


          GET /posts?published_at_to=1641038399



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: language_code
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Language codes can be used to filter records of specified languages.
          This parameter uses URL encoded array syntax to allow any number of languages to be specified.

          Example -- Limit results to posts published in English or Spanish:


          GET /posts?language_code[]=EN&language_code[]=ES



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/language-code.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of categories to be excluded. Possible categories to be excluded are: [replies, ads, posts, retweets, quotes]


          Example -- The following request will omit ads from the results:


          GET /posts?exclude[]=ads



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/exclude.
      - name: channel
        in: query
        description: |
          The `channel` parameter filters posts based on properties of the channels (ie. accounts of organizations) that published them.
          This parameter uses URL encoded array syntax to allow any number of key-value pairs to be specified.


          Example -- Apply a filter to select posts from accounts belonging to organizations whose posts are blocked in Ukraine:


          GET /posts?channel[blocked_in_countries]=UA




          Example input:
          ```
          {
            "channel": {
              "blocked_in_countries": "USA"
            }
          }
          ```
          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/channel-properties.
        schema:
          type: object
      - name: lists
        in: query
        description: |
          The `lists` parameter filters posts that would be retrieved by one or more specified
          [monitoring lists](https://docs.junkipedia.org/reference-material/glossary#list).


          Example -- Apply a filter to select posts retrieved by monitoring lists with IDs 1911 and 4224:


          GET /posts?lists=1911,4224



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/lists.
        schema:
          type: string
      - name: page
        in: query
        description: |
          The `page` parameter selects a page of posts within a paginated series. It works in combination with the `per_page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      - name: per_page
        in: query
        description: |
          The `per_page` parameter determines the number of post per page within a paginated series. It works in combination with the `page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      - name: search_by
        in: query
        schema:
          type: string
          enum:
          - engagement
          - mentions
          - likes_count
          - views_count
          - comments_count
          - shares_count
        description: |
          ing containing the name of a number field whose sum will be aggregated and grouped by, possible values: [engagement, mentions, likes_count, views_count, comments_count, shares_count]
          `Default: engagement`
      - name: group_by
        in: query
        schema:
          type: string
          enum:
          - 1h
          - 4h
          - 12h
          - 1d
          - 1w
          - 1M
        description: |
          A string containing the time interval to group the sum of the field name in {search_by} parameter. Possible values: [1h, 4h, 12h, 1d, 1w, 1M], Default: 1d
          `Default: 1d`
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      params:
                        type: object
                      user:
                        "$ref": "#/components/schemas/user"
                      page:
                        type: integer
                      per_page:
                        type: integer
                      simple_query_string:
                        type: integer
                      simple_query_enabled:
                        type: boolean
                      breakdown_attribute_values:
                        type: array
                        items:
                          type: object
                      posts:
                        type: object
  "/api/v1/posts":
    get:
      summary: All Posts
      tags:
      - Posts
      security:
      - Bearer: []
      description: "Returns all posts from the monitoring system. \n\n Note: This
        endpoint is only able to return a maximum of 10k records"
      parameters:
      - name: keyword
        in: query
        description: |
          Use this parameter to specify search terms. Results will include posts containing the words specified.


          Example -- To search for "climate change", separate the words with either `+` or `%20`.
          Note that `%20` represents the hex code for a space character but that a literal space character is not allowed in a URL.
          The two query strings below have the same effect.


          GET /posts?keyword=climate+change

          GET /posts?keyword=climate%20change



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters.
        schema:
          type: string
      - name: post_uid
        in: query
        description: |+
          Use this parameter to search a post by uid, the results can be further narrowed down by using this filter with platform and published_at_from == "empty"


          Example

          GET /posts?post_uid=1889936742427357416

          GET /posts?post_uid=Xto2NV8dHvM



        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `keyword` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assignming this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /posts?keyword=climate+change+-hoax&simple_query=true
        schema:
          type: string
      - name: platform_names
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of strings with the names of platforms, possible values: ([])


          If this parameter is omitted, posts from all platforms will be included. If one or more platforms are given, only those specified will be included.


          Example -- To restrict the search only to YouTube and TikTok posts, insert these two platforms into the platform_names array using the following query string syntax:


          GET /posts?platform_names[]=YouTube&platform_names[]=TikTok



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: post_type
        in: query
        schema:
          type: string
          enum:
          - video
          - photo
          - link
          - status
        description: |
          An array of type names containing the following possible values: [video, photo, link, status]


          If this parameter is omitted, posts of all types will be included. If one or more types are given, only those specified will be included.


          Example -- To restrict the search only posts consisting of videos or photos, insert these two types into the post_type array using the following query string syntax:


          GET /posts?post_type[]=video&post_type[]=photo



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: is_short
        in: query
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
        description: |+
          An array of type names containing the following possible values: [true, false]
          Note: This parameter is only supported for youtube posts.


          This parameter filters videos based on their type i.e. short videos or normal videos.


          Example -- To restrict the search only videos consisting of short videos, set is_short parameter to true:


          GET /posts?is_short=true



      - name: in_reply_to_id
        in: query
        description: |+
          This parameter is used to filter posts that are replies to a specific post.


          Example -- To restrict the search only posts that are comments to a specific post, insert the ID of that post into the in_reply_to_id parameter using the following query string syntax:


          GET /posts?in_reply_to_id=123456789


        schema:
          type: integer
      - name: engagement_from
        in: query
        description: |
          Any positive integer value specifying a lower bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements below 100:


          GET /posts?engagement_from=100.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: engagement_to
        in: query
        description: |
          Any positive integer value specifying a higher bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements above 5500:


          GET /posts?engagement_to=5500.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published before the given time.

          Example -- Omit posts with published before 2022:


          GET /posts?published_at_from=1641038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: published_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published after the given time.

          Example -- Omit posts with published after 2021:


          GET /posts?published_at_to=1641038399



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts created after the given time.
          Note: This attribute is the date when the post was created in the junkipedia database.

          Example -- Omit posts which were created after 2024:


          GET /posts?created_at_from=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts created before the given time.
          Note: This attribute is the date when the post was created in the junkipedia database.

          Example -- Omit posts which were created before 2024:


          GET /posts?created_at_to=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: indexed_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches posts based on when they were indexed in Junkipedia.


          Example -- To search for posts indexed after 2025-01-01, use this parameter as following:


          GET /posts?indexed_at_from=1735708800



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: string
      - name: indexed_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches posts based on when they were indexed in Junkipedia.


          Example -- To search for posts indexed before 2025-01-01, use this parameter as following:


          GET /posts?indexed_at_to=1735708800



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: string
      - name: language_code
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Language codes can be used to filter records of specified languages.
          This parameter uses URL encoded array syntax to allow any number of languages to be specified.

          Example -- Limit results to posts published in English or Spanish:


          GET /posts?language_code[]=EN&language_code[]=ES



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/language-code.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of categories to be excluded. Possible categories to be excluded are: [replies, ads, posts, retweets, quotes]


          Example -- The following request will omit ads from the results:


          GET /posts?exclude[]=ads



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/exclude.
      - name: channel
        in: query
        description: |
          The `channel` parameter filters posts based on properties of the channels (ie. accounts of organizations) that published them.
          This parameter uses URL encoded array syntax to allow any number of key-value pairs to be specified.


          Example -- Apply a filter to select posts from accounts belonging to organizations whose posts are blocked in Ukraine:


          GET /posts?channel[blocked_in_countries]=UA




          Example input:
          ```
          {
            "channel": {
              "blocked_in_countries": "USA"
            }
          }
          ```
          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/channel-properties.
        schema:
          type: object
      - name: lists
        in: query
        description: |
          The `lists` parameter filters posts that would be retrieved by one or more specified
          [monitoring lists](https://docs.junkipedia.org/reference-material/glossary#list).


          Example -- Apply a filter to select posts retrieved by monitoring lists with IDs 1911 and 4224:


          GET /posts?lists=1911,4224



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/lists.
        schema:
          type: string
      - name: page
        in: query
        description: |
          The `page` parameter selects a page of posts within a paginated series. It works in combination with the `per_page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      - name: per_page
        in: query
        description: |
          The `per_page` parameter determines the number of post per page within a paginated series. It works in combination with the `page` parameter.
          See an example at https://docs.junkipedia.org/reference-material/api/query-string-parameters/pagination.
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Posts records
                    items:
                      "$ref": "#/components/schemas/post"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  meta:
                    type: object
                    properties:
                      total_posts:
                        type: integer
                      posts_count:
                        type: integer
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
  "/api/v1/posts/count":
    get:
      summary: Search count
      tags:
      - Posts
      security:
      - Bearer: []
      description: Returns total number of posts found by the parameters
      parameters:
      - name: keyword
        in: query
        description: |
          Use this parameter to specify search terms. Results will include posts containing the words specified.


          Example -- To search for "climate change", separate the words with either `+` or `%20`.
          Note that `%20` represents the hex code for a space character but that a literal space character is not allowed in a URL.
          The two query strings below have the same effect.


          GET /posts?keyword=climate+change

          GET /posts?keyword=climate%20change



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters.
        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `keyword` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assignming this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /posts?keyword=climate+change+-hoax&simple_query=true
        schema:
          type: string
      - name: platform_names
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of strings with the names of platforms, possible values: ([])


          If this parameter is omitted, posts from all platforms will be included. If one or more platforms are given, only those specified will be included.


          Example -- To restrict the search only to YouTube and TikTok posts, insert these two platforms into the platform_names array using the following query string syntax:


          GET /posts?platform_names[]=YouTube&platform_names[]=TikTok



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: post_type
        in: query
        schema:
          type: string
          enum:
          - video
          - photo
          - link
          - status
        description: |
          An array of type names containing the following possible values: [video, photo, link, status]


          If this parameter is omitted, posts of all types will be included. If one or more types are given, only those specified will be included.


          Example -- To restrict the search only posts consisting of videos or photos, insert these two types into the post_type array using the following query string syntax:


          GET /posts?post_type[]=video&post_type[]=photo



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: in_reply_to_id
        in: query
        description: |+
          This parameter is used to filter posts that are replies to a specific post.


          Example -- To restrict the search only posts that are comments to a specific post, insert the ID of that post into the in_reply_to_id parameter using the following query string syntax:


          GET /posts?in_reply_to_id=123456789


        schema:
          type: integer
      - name: is_short
        in: query
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
        description: |+
          An array of type names containing the following possible values: [true, false]
          Note: This parameter is only supported for youtube posts.


          This parameter filters videos based on their type i.e. short videos or normal videos.


          Example -- To restrict the search only videos consisting of short videos, set is_short parameter to true:


          GET /posts?is_short=true



      - name: engagement_from
        in: query
        description: |
          Any positive integer value specifying a lower bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements below 100:


          GET /posts?engagement_from=100.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: engagement_to
        in: query
        description: |
          Any positive integer value specifying a higher bound to the total engagements of posts. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit posts with reported engagements above 5500:


          GET /posts?engagement_to=5500.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published before the given time.

          Example -- Omit posts with published before 2022:


          GET /posts?published_at_from=1641038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: published_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts published after the given time.

          Example -- Omit posts with published after 2021:


          GET /posts?published_at_to=1641038399



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts created after the given time.
          Note: This attribute is the date when the post was created in the junkipedia database.

          Example -- Omit posts which were created after 2024:


          GET /posts?created_at_from=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude posts created before the given time.
          Note: This attribute is the date when the post was created in the junkipedia database.

          Example -- Omit posts which were created before 2024:


          GET /posts?created_at_to=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: indexed_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches posts based on when they were indexed in Junkipedia.


          Example -- To search for posts indexed after 2025-01-01, use this parameter as following:


          GET /posts?indexed_at_from=1735708800



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: string
      - name: indexed_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) that searches posts based on when they were indexed in Junkipedia.


          Example -- To search for posts indexed before 2025-01-01, use this parameter as following:


          GET /posts?indexed_at_to=1735708800



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: string
      - name: language_code
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Language codes can be used to filter records of specified languages.
          This parameter uses URL encoded array syntax to allow any number of languages to be specified.

          Example -- Limit results to posts published in English or Spanish:


          GET /posts?language_code[]=EN&language_code[]=ES



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/language-code.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of categories to be excluded. Possible categories to be excluded are: [replies, ads, posts, retweets, quotes]


          Example -- The following request will omit ads from the results:


          GET /posts?exclude[]=ads



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/exclude.
      - name: channel
        in: query
        description: |
          The `channel` parameter filters posts based on properties of the channels (ie. accounts of organizations) that published them.
          This parameter uses URL encoded array syntax to allow any number of key-value pairs to be specified.


          Example -- Apply a filter to select posts from accounts belonging to organizations whose posts are blocked in Ukraine:


          GET /posts?channel[blocked_in_countries]=UA




          Example input:
          ```
          {
            "channel": {
              "blocked_in_countries": "USA"
            }
          }
          ```
          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/channel-properties.
        schema:
          type: object
      - name: lists
        in: query
        description: |
          The `lists` parameter filters posts that would be retrieved by one or more specified
          [monitoring lists](https://docs.junkipedia.org/reference-material/glossary#list).


          Example -- Apply a filter to select posts retrieved by monitoring lists with IDs 1911 and 4224:


          GET /posts?lists=1911,4224



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/lists.
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
  "/api/v1/posts/{id}/comments":
    get:
      summary: Search post comments
      tags:
      - Posts
      security:
      - Bearer: []
      description: Returns all comments found for the post
      parameters:
      - name: id
        in: path
        description: ID of the post
        required: true
        schema:
          type: string
      - name: keyword
        in: query
        description: |
          Use this parameter to specify search terms. Results will include comments containing the words specified.


          Example -- To search for "climate change", separate the words with either `+` or `%20`.
          Note that `%20` represents the hex code for a space character but that a literal space character is not allowed in a URL.
          The two query strings below have the same effect.


          GET /api/v1/posts/{id}/comments?keyword=climate+change

          GET /api/v1/posts/{id}/comments?keyword=climate%20change



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters.
        schema:
          type: string
      - name: simple_query
        in: query
        description: |
          This parameter determines whether boolean search syntax is to be applied to the search text given by the `keyword` parameter. See the following links for full details and a summary of available boolean operations:

            • https://docs.junkipedia.org/reference-material/api/query-string-parameters/text-search-parameters

            • https://docs.junkipedia.org/reference-material/glossary?q=boolean


          To enable boolean search, specify `simple_query=true`. Omit the parameter entirely if boolean search is not desired. Assignming this parameter to any other value may have unexpected results.


          Example -- To omit results containing the term "hoax" while searching for "climate change", use a minus sign prefix as in the query string below.


          GET /api/v1/posts/{id}/comments?keyword=climate+change+-hoax&simple_query=true
        schema:
          type: string
      - name: platform_names
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of strings with the names of platforms, possible values: ([])


          If this parameter is omitted, comments from all platforms will be included. If one or more platforms are given, only those specified will be included.


          Example -- To restrict the search only to TikTok comments, insert this platform into the platform_names array using the following query string syntax:


          GET /api/v1/posts/{id}/comments?platform_names[]=TikTok



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: post_type
        in: query
        schema:
          type: string
          enum:
          - video
          - photo
          - link
          - status
        description: |
          An array of type names containing the following possible values: [video, photo, link, status]


          If this parameter is omitted, post_type is set to [comment]


          Usage:
          GET /api/v1/posts/{id}/comments?post_type[]=video&post_type[]=photo



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/post-type-and-platform.
      - name: engagement_from
        in: query
        description: |
          Any positive integer value specifying a lower bound to the total engagements of comments. Even though this is an integer value, it must end with a decimal and two zeros.


          Example -- Omit comments with reported engagements below 100:


          GET /api/v1/posts/{id}/comments?engagement_from=100.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: engagement_to
        in: query
        description: |
          Any positive integer value specifying a higher bound to the total engagements of comments. Even though this is an integer value, it must end with a decimal and two zeros.

          Example -- Omit comments with reported engagements above 5500:


          GET /api/v1/posts/{id}/comments?engagement_to=5500.00



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/engagement-filters.
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude comments published before the given time.

          Example -- Omit comments with published before 2022:


          GET /api/v1/posts/{id}/comments?published_at_from=1641038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: published_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude comments published after the given time.

          Example -- Omit comments with published after 2021:


          GET /api/v1/posts/{id}/comments?published_at_to=1641038399



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_from
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude comments created after the given time.
          Note: This attribute is the date when the comment was created in the junkipedia database.

          Example -- Omit comments which were created after 2024:


          GET /api/v1/posts/{id}/comments?created_at_from=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: created_at_to
        in: query
        description: |
          A Unix Epoch timestamp (or integer number of seconds since the beginning of 1970) used to exclude comments created before the given time.
          Note: This attribute is the date when the comment was created in the junkipedia database.

          Example -- Omit comments which were created before 2024:


          GET /api/v1/posts/{id}/comments?created_at_to=1704038400



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.
        schema:
          type: integer
      - name: language_code
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          Language codes can be used to filter records of specified languages.
          This parameter uses URL encoded array syntax to allow any number of languages to be specified.

          Example -- Limit results to comments published in English or Spanish:


          GET /api/v1/posts/{id}/comments?language_code[]=EN&language_code[]=ES



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/language-code.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: string
        description: |
          An array of categories to be excluded. Possible categories to be excluded are: [replies, ads, posts, retweets, quotes]


          Example -- The following request will omit ads from the results:


          GET /api/v1/posts/{id}/comments?exclude[]=ads



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/exclude.
      - name: channel
        in: query
        description: |
          The `channel` parameter filters comments based on properties of the channels (ie. accounts of organizations) that published them.
          This parameter uses URL encoded array syntax to allow any number of key-value pairs to be specified.


          Example -- Apply a filter to select comments from accounts belonging to organizations whose posts are blocked in Ukraine:


          GET /api/v1/posts/{id}/comments?channel[blocked_in_countries]=UA




          Example input:
          ```
          {
            "channel": {
              "blocked_in_countries": "USA"
            }
          }
          ```
          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/channel-properties.
        schema:
          type: object
      - name: lists
        in: query
        description: |
          The `lists` parameter filters comments that would be retrieved by one or more specified
          [monitoring lists](https://docs.junkipedia.org/reference-material/glossary#list).


          Example -- Apply a filter to select comments retrieved by monitoring lists with IDs 1911 and 4224:


          GET /api/v1/posts/{id}/comments?lists=1911,4224



          For more details, see https://docs.junkipedia.org/reference-material/api/query-string-parameters/lists.
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Posts records
                    items:
                      "$ref": "#/components/schemas/post"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  total:
                    type: integer
  "/api/v1/project_posts":
    get:
      summary: list project_posts
      tags:
      - Project Posts
      security:
      - Bearer: []
      description: Returns all project posts from the contrast agent system
      parameters:
      - name: term
        in: query
        description: A string with the text contained in posts
        schema:
          type: string
      - name: project_id
        in: query
        description: An integer with the id of a project
        schema:
          type: integer
      - name: labeler
        in: query
        description: An integer with the id of a labeler(user)
        schema:
          type: integer
      - name: type
        in: query
        schema:
          type: string
          enum:
          - Standard
          - ad
        description: 'A string with the type name, allowed values: [Standard, ad]'
      - name: relevant
        in: query
        schema:
          type: string
          enum:
          - 'NULL'
          - Relevant
          - Not
          - Relevant
        description: 'A string with the relevant attribute value, allowed values:
          [NULL, Relevant, Not Relevant]'
      - name: tags
        in: query
        description: A comma-separated list of tag names
        schema:
          type: string
      - name: platform_labels
        in: query
        description: A comma-separated list of platform label names
        schema:
          type: string
      - name: agents
        in: query
        description: A comma-separated list of agent ids
        schema:
          type: string
      - name: segments
        in: query
        description: A comma-separated list of segment ids
        schema:
          type: string
      - name: engagement_from
        in: query
        description: An integer value that is a lower bound to the total engagements
          of posts
        schema:
          type: string
      - name: engagement_to
        in: query
        description: An integer value that is an upper bound to the total engagements
          of posts
        schema:
          type: integer
      - name: published_at_from
        in: query
        description: A timestamp value after which all the posts were published
        schema:
          type: string
      - name: published_at_to
        in: query
        description: A timestamp value before which all the posts were published
        schema:
          type: integer
      - name: observed_at_from
        in: query
        description: A timestamp value before which all the posts were observed
        schema:
          type: integer
      - name: observed_at_to
        in: query
        description: A timestamp value before which all the posts were observed
        schema:
          type: integer
      - name: page
        in: query
        description: 'Page number, default: 1'
        schema:
          type: integer
      - name: per_page
        in: query
        description: 'Number of records to be returned per page, default: 12'
        schema:
          type: integer
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Issue records
                    items:
                      "$ref": "#/components/schemas/project_post"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/post"
                      - "$ref": "#/components/schemas/observation"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '422':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/project_posts/{id}":
    parameters:
    - name: id
      in: path
      description: The record ID of project post to be retrieved
      required: true
      schema:
        type: string
    get:
      summary: show project_post
      tags:
      - Project Posts
      security:
      - Bearer: []
      description: Returns a project post from the contrast agent system
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/project_post"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/post"
                      - "$ref": "#/components/schemas/observation"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
  "/api/v1/submissions/{tipline_identifier}":
    parameters:
    - name: tipline_identifier
      in: path
      description: The identifier for the tipline via which this submission is created;
        the tipline must belong to your organization
      required: true
      schema:
        type: string
    post:
      summary: create submission
      tags:
      - Submissions
      security:
      - Bearer: []
      description: Creates a submission using the data provided in the request body
      parameters:
      - name: include
        in: query
        description: 'A comma-separated list of relationship paths specifying which
          related resources (of the newly created Submission) to include in the response.
          Valid top level relationship paths are: issue, media_item, tipline.'
        schema:
          type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/submission"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/issue"
                      - "$ref": "#/components/schemas/media_item"
                      - "$ref": "#/components/schemas/tipline"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                attributes:
                  type: object
                  properties:
                    url:
                      type: string
                    attachment:
                      type: string
                    description:
                      type: string
                    location:
                      type: string
                    phone_number:
                      type: string
                    discovered_at:
                      type: string
            examples:
              request_example_1:
                summary: A request example
                value:
                  submission:
                    type: submission
                    attributes:
                      url: https://www.tiktok.com/@ferdinansyahh/video/7293354161431694598
                      attachment: ''
                      description: this is not what I expected
                      location: ''
                      email: user@example.com
                      phone_number: "+923349634311"
                      discovered_at: '2023-11-17T11:11:29.526Z'
  "/api/v1/submissions":
    get:
      summary: list submissions
      tags:
      - Submissions
      security:
      - Bearer: []
      parameters:
      - name: include
        in: query
        description: 'A comma-separated list of relationship paths specifying which
          related resources to include in the response. Valid top level relationship
          paths are: issue, media_item, tipline.'
        schema:
          type: string
      - name: page
        in: query
        description: Page number of the records
        schema:
          type: string
      description: Returns all submissions from the system that the user has access
        to
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Submission records
                    items:
                      "$ref": "#/components/schemas/submission"
                  included:
                    type: array
                    items:
                      anyOf:
                      - "$ref": "#/components/schemas/issue"
                      - "$ref": "#/components/schemas/media_item"
                      - "$ref": "#/components/schemas/tipline"
                  links:
                    "$ref": "#/components/schemas/pagination_links"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
  "/api/v1/submissions/{id}":
    parameters:
    - name: id
      in: path
      description: id
      required: true
      schema:
        type: string
    get:
      summary: show submission
      tags:
      - Submissions
      security:
      - Bearer: []
      description: Returns the submission from the system if the user has access to
        it
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/submission"
                  jsonapi:
                    "$ref": "#/components/schemas/json_api_version"
        '500':
          description: Invalid Request
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/errors_object"
components:
  securitySchemes:
    Bearer:
      description: API Token key necessary to use API calls
      type: http
      scheme: bearer
  schemas:
    observation:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            post_id:
              type: integer
            agent_id:
              type: integer
            project_post_id:
              type: integer
            tiktok_id:
              type: string
            observation_status:
              type: string
            is_ad:
              type: boolean
            data_captured_at:
              type: string
              nullable: true
            content_viewed_at:
              type: string
              nullable: true
            rewatched:
              type: boolean
              nullable: true
            observed_at:
              type: string
            counted_observation_duration:
              type: integer
              nullable: true
            crawling_metadata:
              type: object
              nullable: true
            rewatch_decision:
              type: boolean
              nullable: true
            screenshot_attached:
              type: boolean
            watch_data:
              type: object
              nullable: true
            is_live:
              type: boolean
            reported_observation_duration:
              type: integer
              nullable: true
            calculated_observation_duration:
              type: integer
              nullable: true
            raw_payload:
              type: object
        relationships:
          type: object
          properties:
            post:
              type: object
              properties:
                data:
                  type: object
            project_post:
              type: object
              properties:
                data:
                  type: object
    post:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            channel_id:
              type: integer
            post_uid:
              type: string
            url:
              type: string
            engagement_data:
              type: object
            engagement_fields:
              type: object
            published_at:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
            audio_text:
              type: string
            image_text:
              type: string
            complete_post_text:
              type: string
            thumbnail_url:
              type: string
            image_text_data:
              type: object
            post_data:
              type: object
            search_data_fields:
              type: object
            channel:
              "$ref": "#/components/schemas/channel"
    post_full:
      type: object
      properties:
        id:
          type: integer
        channel_id:
          type: integer
        ost_uid:
          type: string
        url:
          type: string
        engagement_data:
          type: object
        created_at:
          type: string
        updated_at:
          type: string
        published_at:
          type: string
        audio_text_data:
          type: object
        audio_text:
          type: string
        image_text_data:
          type: object
        image_text:
          type: string
        complete_post_text:
          type: string
        google_audio_text:
          type: string
        google_audio_text_data:
          type: object
        transcription_job_id:
          type: string
        language_code:
          type: string
        is_ad:
          type: boolean
        similar_id:
          type: integer
        video_length:
          type: integer
        total_content_removed_attempts:
          type: integer
        content_removed_at:
          type: string
        content_removed:
          type: boolean
        engagement_last_updated_at:
          type: string
        engagement_growth_velocity:
          type: integer
        engagement_growth_acceleration:
          type: integer
        data_migration_status:
          type: string
        has_parser_fields:
          type: boolean
        has_embed_media:
          type: boolean
        description:
          type: string
        repost_channel_data:
          type: object
        post_type:
          type: array
          items:
            type: string
        inner_link:
          type: object
        post_title:
          type: string
        media_data:
          type: object
        is_reply:
          type: boolean
        ad_fields:
          type: object
        likes_count:
          type: integer
        shares_count:
          type: integer
        comments_count:
          type: integer
        views_count:
          type: integer
        thumb_url:
          type: string
        media_url:
          type: string
        quoted_by:
          type: array
          items:
            type: integer
        shared_by:
          type: array
          items:
            type: integer
        replied_by:
          type: array
          items:
            type: integer
        quoted_id:
          type: integer
        shared_id:
          type: integer
        replied_id:
          type: integer
        whisper_transcription_text:
          type: string
        whisper_job_id:
          type: string
        image_ocr_job_id:
          type: string
        performance_scores:
          type: object
    project_post:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            project_id:
              type: integer
            post_id:
              type: integer
            notes:
              type: string
            relevant:
              type: boolean
            created_at:
              type: string
            updated_at:
              type: string
            tag_list:
              type: array
              items:
                type: integer
            platform_label_list:
              type: array
              items:
                type: integer
        relationships:
          type: object
          properties:
            post:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                    id:
                      type: string
            observations:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      id:
                        type: string
    channel:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            platform_id:
              type: integer
              description: Id of platform record
            channel_name:
              type: string
              description: Display name of the channel
            channel_uid:
              type: string
              description: Unique id of the channel on the actual platform
            channel_type:
              type: string
              nullable: true
              description: Type of the channel depending on platform type e.g. Group,
                User, Page etc.
            engagement_data:
              type: object
              description: All engagement statistics of the channel
            content_removed:
              type: boolean
              description: Flag indicating if the channel was removed from the platform
            follower_count:
              type: integer
              description: Number of accounts the channel follows on the platform
            following_count:
              type: integer
              description: Number of accounts followed by the channel on the platform
            like_count:
              type: integer
              description: Total number of likes recieved on all posts by the channel
            post_count:
              type: integer
              description: Total number of posts created by the channel on the platform
            views_count:
              type: integer
              nullable: true
              description: Total number of views recieved on all posts by the channel
            comment_count:
              type: integer
              nullable: true
              description: Total number of comments recieved on all posts by the channel
            share_count:
              type: integer
              nullable: true
              description: Total number of shares recieved on all posts by the channel
            bio:
              type: string
              nullable: true
              description: Channel description on the platform
            date_added_to_list:
              type: string
              nullable: true
              description: DateTime value of when channel was first added to a list
            channel_data:
              type: object
              description: Raw JSON data returned by the platform API
        relationships:
          type: object
          properties:
            platform:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
    channel_full:
      type: object
      nullable: true
      properties:
        id:
          type: integer
        platform_id:
          type: integer
        channel_name:
          type: string
        channel_uid:
          type: string
        channel_type:
          type: string
          nullable: true
        engagement_data:
          type: object
        created_at:
          type: string
        updated_at:
          type: string
        channel_data:
          type: object
          nullable: true
        latest_post_date:
          type: string
          nullable: true
        posts_count:
          type: integer
        collect_historical:
          type: boolean
          nullable: true
        follower_count_old:
          type: integer
          nullable: true
        following_count_old:
          type: integer
          nullable: true
        like_count_old:
          type: integer
          nullable: true
        post_count_old:
          type: integer
          nullable: true
        is_tracked:
          type: boolean
        total_content_removed_attempts:
          type: integer
        content_removed_at:
          type: string
          nullable: true
        content_removed:
          type: boolean
        engagement_last_updated_at:
          type: string
          nullable: true
        engagement_growth_velocity:
          type: integer
          nullable: true
        engagement_growth_acceleration:
          type: integer
          nullable: true
        entity_types:
          type: array
          items:
            type: string
        affiliations:
          type: array
          items:
            type: string
        languages:
          type: array
          items:
            type: string
        blocked_in:
          type: array
          items:
            type: string
        locations:
          type: array
          items:
            type: string
        labels:
          type: array
          items:
            type: string
        monitized:
          type: boolean
          nullable: true
        removed:
          type: boolean
          nullable: true
        last_available_at:
          type: string
          nullable: true
        views_count_old:
          type: integer
          nullable: true
        bio:
          type: string
          nullable: true
        location:
          type: string
          nullable: true
        collected_at:
          type: string
          nullable: true
        collection_frequency:
          type: integer
          nullable: true
        collect_after:
          type: string
          nullable: true
        username_history:
          type: array
          items:
            type: string
        comment_count_old:
          type: integer
          nullable: true
        follower_count:
          type: integer
          nullable: true
        following_count:
          type: integer
          nullable: true
        like_count:
          type: integer
          nullable: true
        post_count:
          type: integer
          nullable: true
        views_count:
          type: integer
          nullable: true
        comment_count:
          type: integer
          nullable: true
        share_count:
          type: integer
          nullable: true
        channel_attributes:
          type: object
          nullable: true
        collect_ads:
          type: boolean
          nullable: true
        latest_ad_date:
          type: string
          nullable: true
        facebook_advertiser_id:
          type: integer
          nullable: true
        all_time_popular_terms:
          type: array
          items:
            type: string
          nullable: true
        popular_terms_last30:
          type: array
          items:
            type: string
          nullable: true
        popular_terms_last7:
          type: array
          items:
            type: string
          nullable: true
        engagements_per_post_all_time:
          type: integer
          nullable: true
        engagements_per_post_last30:
          type: integer
          nullable: true
        engagements_per_post_last7:
          type: integer
          nullable: true
        posts_per_day_last30:
          type: integer
          nullable: true
        posts_per_day_last90:
          type: integer
          nullable: true
        follower_by_following_ratio:
          type: number
          nullable: true
        engagements_per_post_by_follower_ratio:
          type: integer
          nullable: true
        collect_post_engagement_steps:
          type: boolean
          nullable: true
        handle:
          type: string
          nullable: true
        channel_url:
          type: string
          nullable: true
        is_verified:
          type: boolean
          nullable: true
        is_public:
          type: boolean
          nullable: true
        published_at:
          type: string
          nullable: true
        unique_name:
          type: string
          nullable: true
        signature:
          type: string
          nullable: true
        link:
          type: string
          nullable: true
        data_migration_status:
          type: string
          nullable: true
        has_information_fields:
          type: boolean
          nullable: true
        big_like_count:
          type: integer
          nullable: true
        big_post_count:
          type: integer
          nullable: true
        big_follower_count:
          type: integer
          nullable: true
        big_following_count:
          type: integer
          nullable: true
        big_views_count:
          type: integer
          nullable: true
        engagement_benchmarks:
          type: object
          nullable: true
        sort_by_options:
          type: string
          nullable: true
    task:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            agent_id:
              type: integer
            status:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
            initiated_at:
              type: string
            completed_at:
              type: string
            recurring:
              type: boolean
            repeat_after:
              type: integer
            task_type:
              type: string
            task_data:
              type: object
            processing_details:
              type: object
            rewatch_text_fields:
              type: array
              items:
                type: string
        relationships:
          type: object
          properties:
            agent:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
    issue:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            junkipedia_link:
              type: string
            title:
              type: string
            advisory:
              type: string
            platforms:
              type: array
              items:
                type: string
            languages:
              type: array
              items:
                type: string
            media_types:
              type: array
              items:
                type: string
            threat_level:
              type: integer
            last_edited_at:
              type: string
            engagement_total:
              type: integer
              nullable: true
            problems:
              type: array
              items:
                type: string
            is_public:
              type: boolean
            is_reviewed:
              type: boolean
            is_fact_checked:
              type: boolean
            visible_to_others:
              type: boolean
            created_at:
              type: string
            updated_at:
              type: string
            description:
              type: string
            fact_checks:
              type: string
              nullable: true
            states:
              type: string
              nullable: true
            tags:
              type: array
              items:
                type: string
        relationships:
          type: object
          properties:
            connected_issues:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      id:
                        type: integer
            comments:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      id:
                        type: integer
            submissions:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      id:
                        type: integer
            media_items:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                      id:
                        type: integer
    submission:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            url:
              type: string
              nullable: true
            description:
              type: string
              nullable: true
            location:
              type: string
              nullable: true
            longitude:
              type: integer
              nullable: true
            latitude:
              type: integer
              nullable: true
            review_priority:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
            attachment_url:
              type: string
              nullable: true
            tipline_type:
              type: string
        relationships:
          type: object
          properties:
            issue:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
            media_item:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
            tipline:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
    media_item:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            media_type:
              type: string
              nullable: true
            page_title:
              type: string
              nullable: true
            language_code:
              type: string
              nullable: true
            platform:
              type: string
              nullable: true
            engagement_total:
              type: integer
            author:
              type: array
              items:
                type: string
            published_at:
              type: string
              nullable: true
            tags:
              type: array
              items:
                type: string
            source_url:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
            screen_shot_url:
              type: string
              nullable: true
            primary_image_url:
              type: string
              nullable: true
            media_file_url:
              type: string
              nullable: true
        relationships:
          type: object
          properties:
            agent:
              type: object
              properties:
                meta:
                  type: object
                  properties:
                    included:
                      type: boolean
    comment:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
        attributes:
          type: object
          properties:
            body:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
        relationships:
          type: object
          properties:
            comments:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      type:
                        type: string
    tipline:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
        attributes:
          type: object
          properties:
            identifier:
              type: string
            platform:
              type: string
            name:
              type: string
            tipline_type:
              type: string
            created_at:
              type: string
            updated_at:
              type: string
    list:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            last_scanned_at:
              type: string
              nullable: true
            platform_id:
              type: integer
            enabled:
              type: boolean
            list_type:
              type: string
            channels_count:
              type: integer
            posts_count:
              type: integer
            public:
              type: boolean
            description:
              type: string
              nullable: true
            shared_with_my_organization:
              type: boolean
            update_frequency:
              type: integer
    engagement_step:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            id:
              type: integer
            engageable_type:
              type: string
            engageable_id:
              type: integer
            at:
              type: string
            values:
              type: object
              nullable: true
            failed:
              type: boolean
            created_at:
              type: string
            updated_at:
              type: string
            total:
              type: integer
    user:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        approved:
          type: boolean
        organization_id:
          type: integer
        first_name:
          type: string
        last_name:
          type: string
        phone_number:
          type: string
        role:
          type: string
        anonymous:
          type: boolean
        second_factor_attempts_count:
          type: integer
        encrypted_otp_secret_key:
          type: string
        encrypted_otp_secret_key_iv:
          type: string
        encrypted_otp_secret_key_salt:
          type: string
        direct_otp:
          type: string
        direct_otp_sent_at:
          type: string
        totp_timestamp:
          type: string
        otp_required_for_login:
          type: boolean
        otp_preference:
          type: string
        monitoring_enabled:
          type: boolean
        jira_account_id:
          type: integer
        cookie_consent:
          type: boolean
        contrast_agent:
          type: boolean
        current_project_id:
          type: integer
        syllabus_id:
          type: integer
        default_post_search_id:
          type: integer
        default_issue_search_id:
          type: integer
        default_channel_search_id:
          type: integer
        default_narrative_search_id:
          type: integer
        deactivated:
          type: boolean
        channel_attribute_set_id:
          type: boolean
        user_attributes:
          type: object
        attribute_group_id:
          type: integer
        intro_status:
          type: string
        landing_page:
          type: string
        show_welcome_message:
          type: boolean
        accept_sms:
          type: boolean
    pagination_links:
      type: object
      description: Pagination links
      properties:
        prev:
          type: string
          nullable: true
        next:
          type: string
          nullable: true
    json_api_version:
      type: object
      properties:
        version:
          type: string
    errors_object:
      type: object
      properties:
        code:
          type: string
        status:
          type: string
        title:
          type: string
        detail:
          type: string
        meta:
          type: object
servers:
- url: "{protocol}://{defaultHost}"
  variables:
    protocol:
      default: http
    defaultHost:
      default: localhost
