ViralKit Contests API Documentation

Introduction

Welcome to the ViralKit contests API! You can view code examples in the area to the right, and you can switch the programming language of the examples with the tabs in the top right. You can also switch the API endpoint you're viewing using the tabs in the top left. Note: The API is available on the Ultimate Plan.

Fetch all contests

Fetch a list of all contests. No parameters are required for this endpoint. Just include your API key.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-all-contests
Method: GET
No parameters required

Fetch contest info

Fetch info about a specific contest.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-contest
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Create new contest

Create a new contest.
Endpoint: https://api.viralkit.com/api_endpoint/create-contest
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
titlePlain textTitle of the contestYes
start_dateYYYY-MM-DD HH:MM:SSStart date and time of the contest (default value is today at midnight)Optional
end_dateYYYY-MM-DD HH:MM:SSEnd date and time of the contest (default value is 30 days from not at 23:59:00)Optional
descriptionhtmlDescription of the contest (use HTML tags)Optional
if_terms_and_conditionstrue or falseFlag for terms and conditions (default value is false)Optional

Update existing contest

Update an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/update-contest
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes
titlePlain textTitle of the contestYes
start_dateYYYY-MM-DD HH:MM:SSStart date and time of the contest (default value is today at midnight)Optional
end_dateYYYY-MM-DD HH:MM:SSEnd date and time of the contest (default value is 30 days from not at 23:59:00)Optional
descriptionhtmlDescription of the contest (use HTML tags)Optional

Delete existing contest

Delete an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/delete-contest
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Fetch all contest users

Fetch all users in an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-all-contest-users
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Fetch all contest entries

Fetch all entries in an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-all-contest-entries
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Fetch all entries for a user

Fetch all entries for a user in an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-user-entries
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes
user_emailPlain textEmail of the userYes

Add new user

Add a new user to an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/add-user
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes
user_namePlain textFull name of the userYes
user_emailPlain textEmail address of the userYes
entry_amountNumberNumber of entries for this userYes
photo_urlPlain textURL to the photo of the userOptional
birthday_dayDDBirth day of user in 2 number formatOptional
birthday_monthMMBirth day of user in 2 number formatOptional
birthday_yearYYYYBirth day of user in 4 number formatOptional
country_code2 letter country codeCountry code of the userOptional
regionPlain textRegion of the userOptional
referred_byPlain textEmail address of the participant who referred this user (you must have a Refer A Friend entry method on this contest for this to work)Optional

Delete user

Delete all entries for an existing user in an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/delete-user
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes
user_emailPlain textEmail address of the userYes

Delete single entry

Delete a single entry for an existing user from an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/delete-single-entry
Method: POST
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Fetch all contest winners

Fetch all winners for an existing contest.
Endpoint: https://api.viralkit.com/api_endpoint/fetch-all-winners
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes

Add new entry method

Add new entry method to an existing contest
Endpoint: https://api.viralkit.com/api_endpoint/add-new-entry-method
Method: GET
Parameters
NameAccepted ValuesDescriptionRequired
contests_idPlain textID of your contestYes
field_namePlain textThe name of the field, e.g., 'Instagram Follow Profile'. Here is a list of all the field namesYes
field_headerPlain textThe header of the field, displayed to usersYes
questionBooleanIndicates if the field is a questionNo
instructionsPlain textInstructions for the field, if anyNo
optionsJSON/ArrayAdditional options for the fieldNo
required_valuePlain textThe required answer if validation is neededNo
entry_urlURLURL for the entry methodNo
entry_amountNumberThe amount of entries this method will generateNo
button_textPlain textText on the submission buttonNo
if_dailyBooleanDetermines if the entry method can be performed dailyNo
dailyNumberNumber of daily entries allowedNo
requiredBooleanIndicates if the field is requiredNo
require_validationBooleanIndicates if the field requires validationNo
validation_questionPlain textQuestion prompted for validationNo
form_fieldBooleanIndicates if this is a form fieldNo
api_verificationBooleanDetermines if API verification is neededNo
iconCSS classFontAwesome CSS class for the icon e.g. 'fa-instagram'Yes
icon_colorColor (hex)Hex color code for the iconYes
icon_background_colorColor (hex)Hex background color code for the iconYes
Fetch All Contests API Request
curl -X GET https://api.viralkit.com/api_endpoint/fetch-all-contests
-H 'Authorization: Bearer YOUR_API_KEY'
Expected JSON Output
{
  "success": true,
  "response": [
    {
      "contests_id": "a1h27f89",
      "title": "$100 Amazon Gift Card Giveaway",
      "More fields..."
    }
  ]
}