openapi: 3.0.0
servers:
  - url: http://api.statsocial.com/api
info:
  description: "API Reference: <br><br> The StatSocial API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application (remember that you should never expose your secret API key in any public website's client-side code). JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object).<br><br>Contact help@statsocial.com to obtain a test API key"
  title: StatSocial Platform API
  version: 1.0.0
  x-apisguru-categories:
    - social
    - marketing
  x-logo:
    url: http://www.statsocial.com/wp-content/uploads/2016/01/statsocial-logo.svg
  x-origin:
    - format: openapi
      url: https://docs.statsocial.com/wp-content/themes/twentyfifteen/json/swagger.json
      version: "3.0"
  x-providerName: statsocial.com
externalDocs:
  url: http://docs.statsocial.com/home/
security:
  - api_key: []
paths:
  /applications/status/:
    get:
      description: |
        Remaining window and remaining count details, also returns reports that have been generated by this account.
      parameters:
        - description: User application key
          in: query
          name: key
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Application_Status"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: you are going too fast}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Used to understand API usage
      tags:
        - Application
  /reports/:
    get:
      description: Output is ordered by Demographic and followed by Affinity information. For each data point the following metrics are provided value, count, mean, percentile, multiplicity and average. For Geographic, and Demographic data points an additional statistical_info metric will be present with information regarding statistical relevance.
      parameters:
        - description: Unique report hash
          in: query
          name: report_hash
          required: true
          schema:
            type: string
        - description: Default value will be 'world'
          in: query
          name: baseline
          required: false
          schema:
            type: integer
        - description: report_date represents a Unix timestamp of when the report was generated. Default value will be the latest report generated. You can request the /report/dates/ endpoint in order to obtain available timestamps. Date must be in the future.
          in: query
          name: report_date
          required: false
          schema:
            type: integer
        - description: Sample report indicator
          in: query
          name: sample
          required: true
          schema:
            default: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Success"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: Invalid or non-existent baseline supplied, error_code_msg: INVALID_BASELINE}<br>{success: 0, msg: Invalid report_date parameter value. Must be an integer, error_code_msg: INVALID_REPORT_DATE}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: You are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: Report does not currently exist, error_code_msg: API_ERROR_RETRIEVING_REPORT}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}"
      summary: Obtain report output
      tags:
        - Reports
    post:
      description: |
        Output is ordered by Demographic and followed by Affinity information. For each data point the following metrics are provided value, count, mean, percentile, multiplicity and average. For Geographic, and Demographic data points an additional statistical_info metric will be present with information regarding statistical relevance.
      parameters:
        - description: Unique report hash
          in: query
          name: report_hash
          required: true
          schema:
            type: string
        - description: Default value will be 'world'
          in: query
          name: baseline
          required: false
          schema:
            type: integer
        - description: report_date represents a Unix timestamp of when the report was generated. Default value will be the latest report generated. You can request the /report/dates/ endpoint in order to obtain available timestamps. Date must be in the future.
          in: query
          name: report_date
          required: false
          schema:
            type: integer
        - description: Sample report indicator
          in: query
          name: sample
          required: true
          schema:
            default: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Success"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: Invalid or non-existent baseline supplied, error_code_msg: INVALID_BASELINE}<br>{success: 0, msg: Invalid report_date parameter value. Must be an integer, error_code_msg: INVALID_REPORT_DATE}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: You are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: Report does not currently exist, error_code_msg: API_ERROR_RETRIEVING_REPORT}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}"
      summary: Obtain report output
      tags:
        - Reports
  /reports/custom/create/:
    get:
      description: |
        Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
      parameters:
        - description: Upload hash to be used for inserting handles
          in: query
          name: upload_hash
          required: true
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Create"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: you are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: The upload hash provided does not exist, error_code_msg: UPLOAD_HASH_DOES_NOT_EXIST}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}"
      summary: Step 3 of executing custom report
      tags:
        - Custom Reports
    post:
      description: |
        Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
      parameters:
        - description: Upload hash to be used for inserting handles
          in: query
          name: upload_hash
          required: true
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Create"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: you are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: The upload hash provided does not exist, error_code_msg: UPLOAD_HASH_DOES_NOT_EXIST}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}"
      summary: Step 3 of executing custom report
      tags:
        - Custom Reports
  /reports/custom/generate/:
    get:
      description: |
        Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
      parameters:
        - description: Name of the report
          in: query
          name: report_name
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Generate"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Step 1 of executing custom report
      tags:
        - Custom Reports
    post:
      description: |
        Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
      parameters:
        - description: Name of the report
          in: query
          name: report_name
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Generate"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Step 1 of executing custom report
      tags:
        - Custom Reports
  /reports/custom/insert/:
    get:
      description: |
        Inserting twitter ids or handles into a custom report. This is used for custom reports only
      parameters:
        - description: Upload hash to be used for inserting handles
          in: query
          name: upload_hash
          required: true
          schema:
            type: string
        - description: List of twitter ids, separated by commas, to be inserted into report. Ids must be enclosed with brackets ie. [177490485] or [177490485,23423434]
          explode: false
          in: query
          name: ids
          required: true
          schema:
            items: {}
            type: array
          style: form
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Insert"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: IDS array is too long or in an incorrect format, error_code_msg: API_INVALID_IDS}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: The upload hash provided does not exist, error_code_msg: UPLOAD_HASH_DOES_NOT_EXIST}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error trying to insert relations to custom, error_code_msg: API_ERROR_INSERTING_TO_CUSTOM}"
      summary: Step 2 of executing custom report
      tags:
        - Custom Reports
    post:
      description: |
        Inserting twitter ids or handles into a custom report. This is used for custom reports only
      parameters:
        - description: Upload hash to be used for inserting handles
          in: query
          name: upload_hash
          required: true
          schema:
            type: string
        - description: List of twitter ids, separated by commas, to be inserted into report. Ids must be enclosed with brackets ie. [177490485] or [177490485,23423434]
          explode: false
          in: query
          name: ids
          required: true
          schema:
            items: {}
            type: array
          style: form
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Custom_Insert"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: IDS array is too long or in an incorrect format, error_code_msg: API_INVALID_IDS}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: The upload hash provided does not exist, error_code_msg: UPLOAD_HASH_DOES_NOT_EXIST}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error trying to insert relations to custom, error_code_msg: API_ERROR_INSERTING_TO_CUSTOM}"
      summary: Step 2 of executing custom report
      tags:
        - Custom Reports
  /reports/dates/:
    get:
      description: |
        Get report dates available for a specific report.
      parameters:
        - description: Unique report hash
          in: query
          name: report_hash
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Dates"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: You are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: Report does not currently exist, error_code_msg: API_ERROR_RETRIEVING_REPORT}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}"
      summary: Get report dates available for a specific report
      tags:
        - Reports
    post:
      description: |
        Get report dates available for a specific report.
      parameters:
        - description: Unique report hash
          in: query
          name: report_hash
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Dates"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: You are going too fast}"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/404_Error"
          description: "{success: 0, msg: Report does not currently exist, error_code_msg: API_ERROR_RETRIEVING_REPORT}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}"
      summary: Get report dates available for a specific report
      tags:
        - Reports
  /reports/status/:
    get:
      description: |
        Returns a list of custom reports generated by user (report name to upload hash etc).
      parameters:
        - description: Unique hash belonging to report
          in: query
          name: report_hash
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Status"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: you are going too fast}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}"
      summary: Get list of generated reports
      tags:
        - Reports
    post:
      description: |
        Returns a list of custom reports generated by user (report name to upload hash etc).
      parameters:
        - description: Unique hash belonging to report
          in: query
          name: report_hash
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Report_Status"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "{success: 0, msg: you are going too fast}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}<br>{success: 0, msg: Report has no data, error_code_msg: API_ERROR_EMPTY_REPORT}"
      summary: Get list of generated reports
      tags:
        - Reports
  /reports/tweet/create/:
    get:
      description: |
        This report details the audience of the users who have tweeted content that matches what was provided in the keywords. To create custom or twitter reports other methods must be used.
      parameters:
        - description: Name of report
          in: query
          name: report_name
          required: true
          schema:
            type: string
        - description: A unix timestamp. start_date will be set to the previous midnight.
          in: query
          name: start_date
          required: true
          schema:
            type: integer
        - description: A unix timestamp. end_date will be set to the next midnight.
          in: query
          name: end_date
          required: true
          schema:
            type: integer
        - description: If you are tracking a single term, then the keyword itself is suffice otherwise, tracking multiple terms must be in JSON form, example '[{"operator":"","word":"http://google.com"},{"operator":"or","word":"#test"},{"operator":"and","word":"test2"}]' Which results in filtering tweets containing 'http://google.com' OR '#test' AND 'test2'. (NOTE) Make sure to URL encode the terms value for multiple terms.
          in: query
          name: terms
          required: true
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Create_Tweet"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Used to create tweet reports
      tags:
        - Tweet Reports
    post:
      description: |
        This report details the audience of the users who have tweeted content that matches what was provided in the keywords. To create custom or twitter reports other methods must be used.
      parameters:
        - description: Name of report
          in: query
          name: report_name
          required: true
          schema:
            type: string
        - description: A unix timestamp. start_date will be set to the previous midnight.
          in: query
          name: start_date
          required: true
          schema:
            type: integer
        - description: A unix timestamp. end_date will be set to the next midnight.
          in: query
          name: end_date
          required: true
          schema:
            type: integer
        - description: If you are tracking a single term, then the keyword itself is suffice otherwise, tracking multiple terms must be in JSON form, example '[{"operator":"","word":"http://google.com"},{"operator":"or","word":"#test"},{"operator":"and","word":"test2"}]' Which results in filtering tweets containing 'http://google.com' OR '#test' AND 'test2'. (NOTE) Make sure to URL encode the terms value for multiple terms.
          in: query
          name: terms
          required: true
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Create_Tweet"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Used to create tweet reports
      tags:
        - Tweet Reports
  /reports/twitter/create/:
    get:
      description: |
        This report uses the twitter followers as the audience. To create custom or tweet reports other methods must be used. Any report older than two days will be automatically regenerated upon create.
      parameters:
        - description: (required if twitter_handle is not supplied) twitter_id must be sent with all client requests. Multiple handles are separated by commas.
          in: query
          name: twitter_id
          required: false
          schema:
            type: integer
        - description: (required if twitter_id is not supplied) twitter_handle must be sent with all client requests. Multiple ids are separated by commas.
          in: query
          name: twitter_handle
          required: false
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Create_Twitter"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: The twitter account provided has no audience, error_code_msg: API_TWITTER_ERROR_INSUFFICIENT_COUNT}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}<br>{success: 0, msg: The twitter account provided is private, error_code_msg: API_TWITTER_ERROR_PRIVATE}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error requesting twitter info, error_code_msg: API_TWITTER_ERROR}<br>{success: 0, msg: Error inserting new twitter report, error_code_msg: API_ERROR_CREATING_TWITTER_ACCOUNT}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Used to create twitter follower report
      tags:
        - Follower Reports
    post:
      description: |
        This report uses the twitter followers as the audience. To create custom or tweet reports other methods must be used. Any report older than two days will be automatically regenerated upon create.
      parameters:
        - description: (required if twitter_handle is not supplied) twitter_id must be sent with all client requests. Multiple handles are separated by commas.
          in: query
          name: twitter_id
          required: false
          schema:
            type: integer
        - description: (required if twitter_id is not supplied) twitter_handle must be sent with all client requests. Multiple ids are separated by commas.
          in: query
          name: twitter_handle
          required: false
          schema:
            type: string
        - description: "Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}"
          in: query
          name: filter
          required: false
          schema:
            type: string
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Create_Twitter"
          description: Success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/400_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API parameters, error_code_msg: API_INVALID_PARAMS}<br>{success: 0, msg: Error please include the 'action' parameter, error_code_msg: API_MISSING_ACTION_PARAMETER}<br>{success: 0, msg: The twitter account provided has no audience, error_code_msg: API_TWITTER_ERROR_INSUFFICIENT_COUNT}"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/401_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Invalid API key, error_code_msg: API_INVALID_KEY}<br>{success: 0, msg: The twitter account provided is private, error_code_msg: API_TWITTER_ERROR_PRIVATE}"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/403_Error"
          description: "Possible reasons include:<br>{success: 0, msg: you are going too fast}<br>{success: 0, msg: Not enough tokens remaining under your application, error_code_msg: API_INSUFFICIENT_TOKENS_REMAINING}"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/500_Error"
          description: "Possible reasons include:<br>{success: 0, msg: Error requesting twitter info, error_code_msg: API_TWITTER_ERROR}<br>{success: 0, msg: Error inserting new twitter report, error_code_msg: API_ERROR_CREATING_TWITTER_ACCOUNT}<br>{success: 0, msg: Error getting application's credentials, error_code_msg: API_ERROR_GETTING_APPLICATION_INFO}}<br>{success: 0, msg: Internal database error, error_code_msg: API_ERROR_DATABASE_INITIATION_ERROR}"
      summary: Used to create twitter follower report
      tags:
        - Follower Reports
components:
  schemas:
    18_24:
      properties:
        average:
          type: integer
        multiplicity:
          type: integer
        percentile:
          type: integer
        statistical_info:
          $ref: "#/components/schemas/statistical_info_18"
        stdev:
          type: integer
        value:
          type: integer
      type: object
    25_34:
      properties:
        average:
          type: integer
        multiplicity:
          type: integer
        percentile:
          type: integer
        statistical_info:
          $ref: "#/components/schemas/statistical_info_25"
        stdev:
          type: integer
        value:
          type: integer
      type: object
    35_44:
      properties:
        average:
          type: integer
        multiplicity:
          type: integer
        percentile:
          type: integer
        statistical_info:
          $ref: "#/components/schemas/statistical_info_35"
        stdev:
          type: integer
        value:
          type: integer
      type: object
    400_Error:
      properties:
        error_code_msg:
          type: string
        msg:
          type: string
        success:
          default: "false"
          type: string
    401_Error:
      properties:
        error_code_msg:
          type: string
        msg:
          type: string
        success:
          default: "false"
          type: string
    403_Error:
      properties:
        error_code_msg:
          type: string
        msg:
          type: string
        success:
          default: "false"
          type: string
    404_Error:
      properties:
        error_code_msg:
          type: string
        msg:
          type: string
        success:
          default: "false"
          type: string
    500_Error:
      properties:
        error_code_msg:
          type: string
        msg:
          type: string
        success:
          default: "false"
          type: string
    Application_Status:
      properties:
        data:
          $ref: "#/components/schemas/application_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Combined_Age:
      properties:
        18 - 24:
          $ref: "#/components/schemas/18_24"
        25 - 34:
          $ref: "#/components/schemas/25_34"
        35 - 44:
          $ref: "#/components/schemas/35_44"
      type: object
    Create_Tweet:
      properties:
        data:
          $ref: "#/components/schemas/create_tweet_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Create_Twitter:
      properties:
        data:
          $ref: "#/components/schemas/follower_create_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Custom_Create:
      properties:
        data:
          $ref: "#/components/schemas/custom_create_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Custom_Generate:
      properties:
        data:
          $ref: "#/components/schemas/custom_generate_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Custom_Insert:
      properties:
        data:
          $ref: "#/components/schemas/custom_insert_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Female:
      properties:
        average:
          type: integer
        multiplicity:
          type: integer
        percentile:
          type: integer
        statistical_info:
          $ref: "#/components/schemas/statistical_info_f"
        stdev:
          type: integer
        value:
          type: integer
      type: object
    Male:
      properties:
        average:
          type: integer
        multiplicity:
          type: integer
        percentile:
          type: integer
        statistical_info:
          $ref: "#/components/schemas/statistical_info_m"
        stdev:
          type: integer
        value:
          type: integer
      type: object
    Report_Dates:
      properties:
        data:
          items:
            type: integer
          type: array
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
    Report_Status:
      properties:
        msg:
          type: string
        success:
          default: "true"
          type: string
    Report_Success:
      properties:
        data:
          $ref: "#/components/schemas/report_response"
        msg:
          default: success
          type: string
        success:
          default: "true"
          type: string
      type: object
    Sex:
      properties:
        Female:
          $ref: "#/components/schemas/Female"
        Male:
          $ref: "#/components/schemas/Male"
      type: object
    application_response:
      properties:
        remaining_count:
          type: integer
        reports:
          $ref: "#/components/schemas/report_info"
        total_reports_count:
          type: integer
        total_reports_done:
          type: integer
      type: object
    create_tweet_response:
      properties:
        aggregate_report_hash:
          type: string
        daily_report_hash:
          type: string
        monthly_report_hash:
          type: string
        weekly_report_hash:
          type: string
      type: object
    custom_create_response:
      properties:
        report_hash:
          type: string
      type: object
    custom_generate_response:
      properties:
        upload_hash:
          type: string
      type: object
    custom_insert_response:
      properties:
        distinct_relations:
          type: integer
        total_relations:
          type: integer
      type: object
    follower_create_response:
      properties:
        report_hash:
          type: string
      type: object
    report_info:
      properties:
        created:
          type: string
        name:
          type: string
        report_type:
          type: string
        status:
          type: string
      type: object
    report_response:
      properties:
        Combined Age:
          $ref: "#/components/schemas/Combined_Age"
        Sex:
          $ref: "#/components/schemas/Sex"
      type: object
    statistical_info_18:
      properties:
        error_range:
          type: integer
        lower_bound:
          type: integer
        upper_bound:
          type: integer
      type: object
    statistical_info_25:
      properties:
        error_range:
          type: integer
        lower_bound:
          type: integer
        upper_bound:
          type: integer
      type: object
    statistical_info_35:
      properties:
        error_range:
          type: integer
        lower_bound:
          type: integer
        upper_bound:
          type: integer
      type: object
    statistical_info_f:
      properties:
        error_range:
          type: integer
        lower_bound:
          type: integer
        upper_bound:
          type: integer
      type: object
    statistical_info_m:
      properties:
        error_range:
          type: integer
        lower_bound:
          type: integer
        upper_bound:
          type: integer
      type: object
  securitySchemes:
    api_key:
      in: header
      name: api_key
      type: apiKey
