Skip to content
Navigation

Create a report

POST
https://whyviral.ai/api/v1/reports

Freezes a report of a project as it stands now and answers it with its link, url. Anyone who has the link can open the page with no account. Free; an account can create 100 a day, whichever of its keys asks.

Authorization

  • bearer
    optional
    HTTP Bearer

    Authorization: Bearer <token>

  • apiKeyHeader
    optional
    API key in header

    x-api-key: <token>

Request body JSON required

  • kind
    mentions
    or
    creators
    or
    campaign
    required

    mentions: the brand’s mentions and ranking. creators: saved creators side by side. campaign: one campaign’s results.

  • project
    optional
    string

    A project’s id or exact name; case is ignored. Leave it out for the project active in the app.

  • days
    optional
    7
    or
    30

    A mentions report’s period.

    default: 7
  • creator_check
    optional
    string

    A mentions report can add one saved creator’s check: the creator’s id.

  • creators
    optional
    array of
    string

    A creators report’s saved creators, by id, in the order to show them.

  • campaign
    optional
    string

    A campaign report’s campaign id.

  • title
    optional
    string

    The page’s title; one is made when you leave it out.

    maxLength: 80
  • prepared_by
    optional
    string

    The name the page shows as “Prepared by”.

    maxLength: 60

Returns

201

The report, with its link.

JSON
  • id
    string
    required

    The report’s id.

  • object
    string
    required

    "report".

  • kind
    mentions
    or
    creators
    or
    campaign
    required

    mentions, creators or campaign.

  • title
    string
    required

    The page’s title.

  • prepared_by
    string
    required

    The name the page shows as “Prepared by”; empty for none.

  • url
    required

    The page’s link. Anyone who has it can open it with no account; null once revoked or expired.

    Any of the following:

    • string
    • null
  • period_from
    required

    The start of what the report covers.

    Any of the following:

    • string
    • null
  • period_to
    required

    The end of what it covers.

    Any of the following:

    • string
    • null
  • hidden
    array of
    string
    required

    Sections its owner hid on the page.

  • created_at
    required

    When it was made.

    Any of the following:

    • string
    • null
  • revoked_at
    required

    When its link was revoked, else null.

    Any of the following:

    • string
    • null
  • expires_at
    required

    When its link stops opening; null while it has no end.

    Any of the following:

    • string
    • null

400

INVALID_REQUEST: The body isn’t JSON, its url is missing or too long, or a parameter has a value it doesn’t take. INVALID_PERIOD: days isn’t a period this endpoint takes; days in the answer lists the ones it does. AMBIGUOUS_PROJECT: Several of your projects share the name you sent; pass the project’s id. INVALID_REPORT: The report can’t be made as asked, for example with no creator or too many. CREATOR_NOT_SAVED: A creator you named isn’t among the project’s saved creators. TOO_MANY_REPORTS: The project holds as many reports as it can; delete one in the app.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

401

INVALID_API_KEY: The key is missing, mistyped or revoked.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

403

ACCOUNT_DISABLED: The key’s account is disabled.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

404

NOT_FOUND: No read, project, creator, campaign or report like this on your account.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

429

RATE_LIMITED: Too many new reads, data requests, searches or report links; wait the Retry-After header’s seconds.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

500

INTERNAL: Something broke on our side; try again.
JSON
  • error
    object
    required

    Some codes add details, such as cap, required or balance.

    • code
      string
      ·
      one of 16 values
      required
      Allowed values: INVALID_REQUEST, UNSUPPORTED_LINK, INVALID_PERIOD, AMBIGUOUS_PROJECT, INVALID_REPORT, CREATOR_NOT_SAVED, TOO_MANY_REPORTS, INVALID_API_KEY, INSUFFICIENT_CREDITS, ACCOUNT_DISABLED, NOT_FOUND, TRACKER_NOT_FOUND, MONTHLY_LIMIT, RATE_LIMITED, INTERNAL, SEARCH_UNAVAILABLE
    • message
      string
      required

      What went wrong, in words.

Type to search…

↑↓ navigate↵ selectEsc close