The Campaign Refinery Developer Hub

Welcome to the Campaign Refinery developer hub. You'll find comprehensive guides and documentation to help you start working with Campaign Refinery as quickly as possible, as well as support if you get stuck.

 
Suggest Edits

API Summary

 
 

We have loaded all API commands into a Postman collection to help you with integrating Campaign Refinery into your applications.

Download the complete collection here:

Run in Postman

Tip

We use {{url}} and {{key}} as environmental variables in all examples. You will want to configure them accordingly.

Key
Value

url

app.campaignrefinery.com

key

Your API key

 

You will need an API key to access the Campaign Refinery API. Login to your account to generate an API key.

Multiple API Keys

You can generate multiple API keys.

Suggest Edits

Get Contacts

 
gethttps://app.campaignrefinery.com/rest/contacts/get-contacts
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/get-contacts?key=$key&q=$q&offset=$offset&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "page": 0,
    "per_page": 10,
    "page_count": 2,
    "total_count": 2
  },
  "contacts": [
    {
      "contact_uuid": "",
      "contact_first_name": "",
      "contact_last_name": "",
      "contact_email": "",
      "contact_add_dts": "",
      "contact_updated_dts": "",
      "contact_optout": "",
      "contact_optout_dts": ""
    },
    {...}
  ]
}    
    

Query Params

key
string
required

Your API key (required)

q
string

Query (optional)

offset
int32

Offset (optional)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Get Contact by ID

 
gethttps://app.campaignrefinery.com/rest/contacts/get-contact
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/get-contact?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "contact_uuid": "",
  "contact_first_name": "",
  "contact_last_name": "",
  "contact_email": "",
  "contact_add_dts": "",
  "contact_updated_dts": "",
  "contact_optout": "",
  "contact_optout_dts": ""
}

Query Params

key
string
required

Your API key (required)

id
string
required

The contact id (required if not using email)

 
Suggest Edits

Get Contact by Email

 
gethttps://app.campaignrefinery.com/rest/contacts/get-contact
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/get-contact?key=$key&email=$email",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "contact_uuid": "",
  "contact_first_name": "",
  "contact_last_name": "",
  "contact_email": "",
  "contact_add_dts": "",
  "contact_updated_dts": "",
  "contact_optout": "",
  "contact_optout_dts": ""
}

Query Params

key
string
required

Your API key (required)

email
string
required

The contact id (required if not using email)

 
Suggest Edits

Create Contact

 
posthttps://app.campaignrefinery.com/rest/contacts/create-contact
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/create-contact",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&email=$email&name=$name&first_name=$first_name&last_name=$last_name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new contact"
}

Query Params

key
string
required

Your API key (required)

email
string
required

The contact's email (required)

first_name
string

The contact's first name (optional)

last_name
string

The contact's last name (optional)

 

This endpoint only creates a contact record. To subscribe a contact and apply tags, forms and goals, use the Subscribe Contact endpoint

Suggest Edits

Update Contact

 
posthttps://app.campaignrefinery.com/rest/contacts/update-contact
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/update-contact",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&name=$name&first_name=$first_name&last_name=$last_name&email=$email",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated contact"
}

Query Params

key
string
required

Your API key (required)

id
string
required

The contact's id (required)

first_name
string

The contact's first name (optional)

last_name
string

The contact's last name (optional)

email
string

The contact's email address (optional)

 

Update a contact data by id.

 
posthttps://app.campaignrefinery.com/rest/contacts/add-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/add-tag",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&tag_id=$tag_id",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new tag"
}

Form Data

key
string
required

Your API key (required)

id
string
required

The contact's id (required)

tag_id
string
required

The tag UUID (required)

 

Add a tag to a contact.

 
posthttps://app.campaignrefinery.com/rest/contacts/add-goal
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/add-goal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&goal_id=$goal_id",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new goal"
}

Query Params

key
string
required

Your API key (required)

id
string
required

The contact's id (required)

goal_id
string
required

The goal UUID (required)

 

Add a goal to a contact.

 
posthttps://app.campaignrefinery.com/rest/contacts/add-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/add-form",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&form_id=$form_id",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new form"
}

Query Params

key
string
required

Your API key (required)

id
string
required

The contact's id (required)

form_id
string
required

The form UUID (required)

 

Add a form to a contact.

Suggest Edits

Subscribe Contact

 
posthttps://app.campaignrefinery.com/rest/contacts/subscribe
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/subscribe",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&email=$email&first_name=$first_name&last_name=$last_name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Subscribed contact"
}

Query Params

key
string
required

Your API key (required)

email
string
required

The contact's email address (required)

first_name
string

The contact's first name

last_name
string

The contact's last name

tags
string

One or more tag UUIDs separated by comma to add to the contact

form_id
string

The form UUID to associate with the contact (if required)

goal_id
string

The goal UUID to mark as complete (if applicable)

allow_duplicates
int32

If supplied, will always create a new contact even if one already exists with the same email address

<field_key>
string

Send through one or more field keys (such as 27__website) to set custom attributes

 

Subscribe a new contact.

Suggest Edits

Delete Tag

 
posthttps://app.campaignrefinery.com/rest/contacts/delete-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/delete-tag",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&tag_id=$tag_id",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Removed tag"
}

Form Data

key
string
required

Your API key (required)

id
string
required

The contact's id (required)

tag_id
string
required

The tag UUID (required)

 

Remove a tag from a contact.

Suggest Edits

Get Contact Tags

 
gethttps://app.campaignrefinery.com/rest/contacts/get-contact-tags
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/contacts/get-contact-tags?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "tags": [
    {
      "tag_uuid": "7ff815c9-6cfc-496b-ae6b-b18697a72455",
      "parent_tag_id": "1068",
      "tag_name": "1-5 clients",
      "parent_tag_uuid": "13475f68-a754-4b16-af4f-879005170cce",
      "parent_tag_name": "cd agencies",
      "tag_added_dts": "2018-10-10 10:14:16"
    },
    {
      "tag_uuid": "d8de373c-d7f8-405f-b7a6-7c8b6a574ac9",
      "parent_tag_id": "1068",
      "tag_name": "11-20 clients",
      "parent_tag_uuid": "13475f68-a754-4b16-af4f-879005170cce",
      "parent_tag_name": "cd agencies",
      "tag_added_dts": "2018-10-10 10:14:16"
     }  
  ]
}

Query Params

key
string
required

Your API key (required)

id
string

The contact UUID (required if not using email)

email
string

The email address (required if not using the contact UUID)

 
Suggest Edits

Get Goal by ID

 
gethttps://app.campaignrefinery.com/rest/goals/get-goal
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/goals/get-goal?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "goal_uuid": "",
  "campaign_id": "",
  "goal_name": "",
  "goal_created_dts"
}

Query Params

key
string

Your API key (required)

id
string

The goal id

 
Suggest Edits

Get Goal by Name

 
gethttps://app.campaignrefinery.com/rest/goals/get-goal
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/goals/get-goal?key=$key&name=$name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "goal_uuid": "",
  "campaign_id": "",
  "goal_name": "",
  "goal_created_dts"
}

Query Params

key
string

Your API key (required)

name
string

The goal's name

 
Suggest Edits

Get Goals

 
gethttps://app.campaignrefinery.com/rest/goals/get-goals
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/goals/get-goals?key=$key&q=$q&offset=$offset&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "page": 0,
    "per_page": 10,
    "page_count": 2,
    "total_count": 2
  },
  "goals": [
    {
      "goal_uuid": "",
      "campaign_id": "",
      "goal_name": "",
      "goal_created_dts"
    },
    {...}
  ]
}    
    

Query Params

key
string

Your API key (required)

q
string

Query (optional)

offset
int32

Offset (optional)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Create Goal

 
posthttps://app.campaignrefinery.com/rest/goals/create-goal
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/goals/create-goal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new goal"
}

Query Params

key
string

Your API key (required)

name
string

The goal's name (optional)

 
Suggest Edits

Update Goal

 
posthttps://app.campaignrefinery.com/rest/goals/update-goal
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/goals/update-goal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated goal"
}

Query Params

key
string

Your API key (required)

id
string

The goal UUID (required)

name
string

The goal's name

 
Suggest Edits

Get Form by ID

 
gethttps://app.campaignrefinery.com/rest/forms/get-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/get-form?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "form_uuid": "",
  "campaign_id": "",
  "form_name": "",
  "form_code_allow_duplicates": "",
  "form_code_success_url": "",
  "form_code_error_url": "",
  "form_code_include_first_last_name": "",
  "form_code_include_full_name": "",
  "form_code_name_required": "",
  "form_code_include_all_enabled": "",
  "form_code_include_all_validation": "",
  "form_code_pass_uuid_on_success": "",
  "form_code_include_invisible_recaptcha": "",
  "form_code_include_invisible_recaptcha_site_key": "",
  "form_created_dts"
}

Query Params

key
string

Your API key (required)

id
string

The form id

 
Suggest Edits

Get Form by Name

 
gethttps://app.campaignrefinery.com/rest/forms/get-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/get-form?key=$key&name=$name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "form_uuid": "",
  "campaign_id": "",
  "form_name": "",
  "form_code_allow_duplicates": "",
  "form_code_success_url": "",
  "form_code_error_url": "",
  "form_code_include_first_last_name": "",
  "form_code_include_full_name": "",
  "form_code_name_required": "",
  "form_code_include_all_enabled": "",
  "form_code_include_all_validation": "",
  "form_code_pass_uuid_on_success": "",
  "form_code_include_invisible_recaptcha": "",
  "form_code_include_invisible_recaptcha_site_key": "",
  "form_created_dts"
}

Query Params

key
string

Your API key (required)

name
string

The form's name

 
Suggest Edits

Get Forms

 
gethttps://app.campaignrefinery.com/rest/forms/get-forms
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/get-forms?key=$key&q=$q&offset=$offset&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "page": 0,
    "per_page": 10,
    "page_count": 2,
    "total_count": 2
  },
  "forms": [
    {
      "form_uuid": "",
      "campaign_id": "",
      "form_name": "",
      "form_code_allow_duplicates": "",
      "form_code_success_url": "",
      "form_code_error_url": "",
      "form_code_include_first_last_name": "",
      "form_code_include_full_name": "",
      "form_code_name_required": "",
      "form_code_include_all_enabled": "",
      "form_code_include_all_validation": "",
      "form_code_pass_uuid_on_success": "",
      "form_code_include_invisible_recaptcha": "",
      "form_code_include_invisible_recaptcha_site_key": "",
      "form_created_dts"
    },
    {...}
  ]
}    
    

Query Params

key
string

Your API key (required)

q
string

Query (optional)

offset
int32

Offset (optional)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Create Form

 
posthttps://app.campaignrefinery.com/rest/forms/create-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/create-form",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new form"
}

Query Params

key
string

Your API key (required)

name
string

The form's name (optional)

 
Suggest Edits

Update Form

 
posthttps://app.campaignrefinery.com/rest/forms/update-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/update-form",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated form"
}

Query Params

key
string

Your API key (required)

id
string

The form UUID (required)

name
string

The form's name

 
Suggest Edits

Delete Form

 
posthttps://app.campaignrefinery.com/rest/forms/delete-form
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/forms/delete-form",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Deleted form"
}

Form Data

key
string
required

Your API key (required)

id
string
required

The form's id (required)

 

Delete a form

Suggest Edits

Get Attribute by ID

 
gethttps://app.campaignrefinery.com/rest/attributes/get-attribute
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/get-attribute?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "custom_attr_uuid": "",
  "custom_attr_display_order": "",
  "custom_attr_name": "",
  "custom_attr_key": "",
  "custom_attr_type": "",
  "custom_attr_created_dts": ""
}

Query Params

key
string
required

Your API key (required)

id
string
required

The attribute id

 
Suggest Edits

Get Attribute by Name

 
gethttps://app.campaignrefinery.com/rest/attributes/get-attribute
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/get-attribute?key=$key&key_name=$name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "custom_attr_uuid": "",
  "custom_attr_display_order": "",
  "custom_attr_name": "",
  "custom_attr_key": "",
  "custom_attr_type": "",
  "custom_attr_created_dts": ""
}

Query Params

key
string
required

Your API key (required)

key_name
string
required

The attribute name

 
Suggest Edits

Get Attributes

 
gethttps://app.campaignrefinery.com/rest/attributes/get-attributes
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/get-attributes?key=$key&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "total_count": 2
  },
  "attributes": [
    {
       "custom_attr_uuid": "",
       "custom_attr_display_order": "",
       "custom_attr_name": "",
       "custom_attr_key": "",
       "custom_attr_type": "",
       "custom_attr_created_dts": ""
    },
    {...}
  ]
}    
    

Query Params

key
string
required

Your API key (required)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Get Attribute Groups

 
gethttps://app.campaignrefinery.com/rest/attributes/get-attribute-groups
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/get-attribute-groups?key=$key&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "total_count": 2
  },
  "attribute_groups": [
    {
       "custom_attr_group_uuid": "",
       "custom_attr_group_name": "",
       "custom_attr_group_created_dts": ""
    },
    {...}
  ]
}    
    

Query Params

key
string
required

Your API key (required)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Create Attribute

 
posthttps://app.campaignrefinery.com/rest/attributes/create-attribute
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/create-attribute",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&name=$name&group=$group&type=$type",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated custom attribute"
}

Query Params

key
string
required

Your API key (required)

name
string
required

The attribute's name

group
string
required

The UUID of the group to add the attribute to

type
string
required

One of ['int', 'decimal', 'varchar', 'datetime', 'mediumtext']

 
Suggest Edits

Update Attribute

 
posthttps://app.campaignrefinery.com/rest/attributes/update-attribute
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/attributes/update-attribute",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&name=$name&group=$group&type=$type",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated custom attribute"
}

Query Params

key
string
required

Your API key (required)

id
string
required

The attribute UUID (required)

name
string

The attribute's name

group
string

The UUID of the group to add the attribute to

type
string

One of ['int', 'decimal', 'varchar', 'datetime', 'mediumtext']

 
Suggest Edits

Get Tag by ID

 
gethttps://app.campaignrefinery.com/rest/tags/get-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/tags/get-tag?key=$key&id=$id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "tag_uuid": "",
  "parent_tag_id": "",
  "tag_name": "",
  "tag_created_dts"
}

Query Params

key
string

Your API key (required)

id
string

The tag id

 
Suggest Edits

Get Tag by Name

 
gethttps://app.campaignrefinery.com/rest/tags/get-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/tags/get-tag?key=$key&name=$name",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "tag_uuid": "",
  "parent_tag_id": "",
  "tag_name": "",
  "tag_created_dts"
}

Query Params

key
string

Your API key (required)

name
string

The tag name

 
 
gethttps://app.campaignrefinery.com/rest/tags/get-tags
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/tags/get-tags?key=$key&q=$q&offset=$offset&order_by=$order_by&sort=$sort",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "_metadata": {
    "page": 0,
    "per_page": 10,
    "page_count": 2,
    "total_count": 2
  },
  "tags": [
    {
      "tag_uuid": "",
      "parent_tag_id": "",
      "tag_name": "",
      "tag_created_dts"
    },
    {...}
  ]
}    
    

Query Params

key
string

Your API key (required)

q
string

Query (optional)

offset
int32

Offset (optional)

order_by
string

Column to order results by (optional)

sort
string

Sort direction (asc or desc) (optional)

 
Suggest Edits

Create Tag

 
posthttps://app.campaignrefinery.com/rest/tags/create-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/tags/create-tag",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Added new tag"
}

Query Params

key
string

Your API key (required)

name
string

The tag's name (optional)

 
Suggest Edits

Update Tag

 
posthttps://app.campaignrefinery.com/rest/tags/update-tag
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.campaignrefinery.com/rest/tags/update-tag",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "key=$key&id=$id&name=$name",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
A binary file was returned

You couldn't be authenticated

{
  "id": "",
  "message": "Updated tag"
}

Query Params

key
string

Your API key (required)

id
string

The tag UUID (required)

name
string

The tag's name