Skip to content
Navigation

List campaigns

GET
https://whyviral.ai/api/v1/campaigns

A project’s campaigns, newest first, with their totals. Free.

Authorization

  • bearer
    optional
    HTTP Bearer

    Authorization: Bearer <token>

  • apiKeyHeader
    optional
    API key in header

    x-api-key: <token>

Query parameters

  • project
    optional
    string

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

Returns

200

The campaigns.

JSON
  • object
    string
    required
  • project
    object
    required
    • id
      string
      required

      The project’s id.

    • name
      string
      required

      Its name.

  • data
    array of
    object
    required
    • id
      string
      required

      The campaign’s id.

    • object
      string
      required

      "campaign".

    • name
      string
      required

      Its name.

    • status
      active
      or
      ended
      required

      active or ended.

    • required_terms
      array of
      string
      required

      The tags and handles a campaign post must carry.

    • flag_undisclosed
      boolean
      required

      Whether a campaign post without an ad disclosure raises an alert.

    • flag_competitors
      boolean
      required

      Whether a post that names a competitor does.

    • start_at
      required

      The instant the campaign starts: midnight of start_day in its owner’s timezone. Posts since then are read.

      Any of the following:

      • string
      • null
    • start_day
      string
      required

      The start as the calendar day its owner picked, YYYY-MM-DD. Show this one: the UTC date of start_at can be the day before.

      format: date
    • ended_at
      required

      When it was ended, else null.

      Any of the following:

      • string
      • null
    • end_day
      required

      Its last day, YYYY-MM-DD in its owner’s timezone; it ends by itself after a last read. Null without one.

      Any of the following:

      • string
      • null
    • expected_posts
      required

      Campaign posts each creator owes; null when none are expected.

      Any of the following:

      • integer
      • null
    • creators_done
      required

      Creators with that many campaign posts; null when none are expected.

      Any of the following:

      • integer
      • null
    • created_at
      required

      When it was made.

      Any of the following:

      • string
      • null
    • creators
      integer
      required

      Creators in the campaign.

      minimum: 0
    • creators_posted
      integer
      required

      How many of them have a campaign post.

      minimum: 0
    • posts
      integer
      required

      Campaign posts found.

      minimum: 0
    • views
      integer
      required

      Their views at the last read.

      minimum: 0
    • all_posts
      integer
      required

      Every post the creators published since the start.

      minimum: 0
    • alerts
      integer
      required

      Posts that raised an alert.

      minimum: 0
    • last_read_at
      required

      When the creators’ posts were last read.

      Any of the following:

      • string
      • null
    • next_read_at
      required

      When they are read next; null once it ended.

      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. AMBIGUOUS_PROJECT: Several of your projects share the name you sent; pass the project’s id.
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