NAV
shell php

Introduction

Welcome to the FunnelKit Automations REST API! Our API's enable organizations of all sizes to create powerful, flexible integrations effortlessly. Use these endpoints to access and manage your FunnelKit Automations data.

To help you get started quickly, we've included code samples in the bottom-right section of this page. You can switch between different programming languages using the tabs in the top-right corner.

Authentication

Example of how to use api key with endpoint:

Get All Tags
GET http://example.com/wp-json/funnelkit-automations/tags

    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/tags?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "page": 1
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/tags';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

Make sure to replace your_api_key with your API key.

The FunnelKit Automations REST API uses API keys to authenticate requests. You can generate a new API key through the admin app in Settings > REST API.

FunnelKit Automations REST API expects the API key to be included in all API requests to the server in a query string that looks like the following:

Parameter Type Description Mandatory
api_key String your_api_key YES

JSON response example:

{
  "code": "success",
  "data": {
    "tags": [
      {
        "ID": 1,
        "name": "Tag 1"
      },
      {
        "ID": 2,
        "name": "Tag 2"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Tags

The Tags API lets you create, view, update and delete individual or batches of tags with ease.

Parameter Type Description Mandatory
api_key string your_api_key YES

Get All Tags

Returns the list of all the tags.

Get All Tags
GET http://example.com/wp-json/funnelkit-automations/tags

    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/tags?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "page": 1
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/tags';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "page": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

GET http://example.com/wp-json/funnelkit-automations/tags?api_key={api-key}

Parameter Type Description Mandatory
page integer Current page of the collection NO

JSON response example:

{
  "code": "success",
  "data": {
    "tags": [
      {
        "ID": 1,
        "name": "Tag 1"
      },
      {
        "ID": 2,
        "name": "Tag 2"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Add Tags

Adds a specific tag.

Add Tags
POST http://example.com/wp-json/funnelkit-automations/tag/add
    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/tag/add?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '
    { "tags": ["Tag 1","Tag 2"]
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/tag/add';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "tags": ["Tag 1","Tag 2"]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/tag/add?api_key={api-key}

Parameter Type Description Mandatory
tags array an array of JSON objects, respectively, that includes the tag name - {"tags": ["tag","tag2", ...]} YES

JSON response example:

{
  "code": "success",
  "data": {
    "tags": [
      {
        "ID": 1,
        "name": "Tag 1",
        "type": "1",
        "created_at": "2022-08-10 11:15:23",
        "updated_at": null,
        "data": null
      },
      {
        "ID": 2,
        "name": "Tag 2",
        "type": "1",
        "created_at": "2022-08-10 11:15:23",
        "updated_at": null,
        "data": null
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Update A Tag

Updates a particular tag.

Update A Tag
POST http://example.com/wp-json/funnelkit-automations/tag/update/{tag_id}

    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/tag/update/{tag_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "tag": "Tag_name"
    }'

<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/tag/update/{tag_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "tag": "Tag_name"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/tag/update/{tag_id}?api_key={api-key}

Parameter Type Description Mandatory
tag string a JSON object, respectively, that includes the tag name - {"tag": "tag_name"} YES

JSON response example:

{
  "code": "success",
  "data": {
    "tags": {
      "ID": "1",
      "name": "Tag_name"
    },
    "limit": 0,
    "offset": 0
  }
}

Delete A Tag

Deletes a tag permanently.

Delete A Tag
DELETE http://example.com/wp-json/funnelkit-automations/tag/{tag_id}

    curl --location --request DELETE 'http://example.com/wp-json/funnelkit-automations/tag/{tag_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/tag/{tag_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP Request

DELETE http://example.com/wp-json/funnelkit-automations/tag/{tag_id}?api_key={api-key}

JSON response example:

{
  "code": "success",
  "data": {
    "tags": {
      "ID": "1",
      "name": "Tag_name"
    },
    "limit": 0,
    "offset": 0
  }
}

Lists

The Lists API lets you create, view, update and delete individual lists or batches of lists.

Parameter Type Description MANDATORY
api_key string your_api_key YES

Get All Lists

Returns all the lists.

Get All Lists
GET http://example.com/wp-json/funnelkit-automations/lists
    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/lists?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '
    {
        "page": 1
    }'

<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/lists';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "page": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

GET http://example.com/wp-json/funnelkit-automations/lists?api_key={api-key}

Parameter Type Description MANDATORY
page integer Current page of the collection NO

JSON response example:

{
  "code": "success",
  "data": {
    "lists": [
      {
        "ID": 1,
        "name": "List 1"
      },
      {
        "ID": 2,
        "name": "List 2"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Add Lists

Adds a specific list.

Add Lists
POST http://example.com/wp-json/funnelkit-automations/list/add

    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/list/add?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '
    {
    "lists": ["List 1", "List 2"]
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/list/add';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "lists": ["List 1","List 2"]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/list/add?api_key={api-key}

Parameter Type Description MANDATORY
lists array an array of JSON objects, respectively, that includes the list name - {"lists": ["list","lists2", ...]} YES

JSON response example:

{
  "code": "success",
  "data": {
    "lists": [
      {
        "ID": 1,
        "name": "List 1",
        "type": "2",
        "created_at": "2022-08-10 11:22:00",
        "updated_at": null,
        "data": null
      },
      {
        "ID": 2,
        "name": "List 2",
        "type": "2",
        "created_at": "2022-08-11 11:22:00",
        "updated_at": null,
        "data": null
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Update A List

Updates a particular list.

Update A List
POST http://example.com/wp-json/funnelkit-automations/list/update/{list_id}

    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/list/update/{list_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/list/update/{list_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "list": "List_name"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/list/update/{list_id}?api_key={api-key}

Parameter Type Description MANDATORY
list string a JSON object, respectively, that includes the list name - {"list": "list_name"} YES

JSON response example:

{
  "code": "success",
  "data": {
    "lists": {
      "ID": "1",
      "name": "List_name"
    },
    "limit": 0,
    "offset": 0
  }
}

Delete A List

Deletes a list permanently.

Delete A List
DELETE http://example.com/wp-json/funnelkit-automations/list/{list_id}
    curl --location --request DELETE 'http://example.com/wp-json/funnelkit-automations/list/{list_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/list/{list_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP Request

DELETE http://example.com/wp-json/funnelkit-automations/list/{list_id}?api_key={api-key}

JSON response example:

{
  "code": "success",
  "data": {
    "lists": {
      "ID": "1",
      "name": "List_name"
    },
    "limit": 0,
    "offset": 0
  }
}

Fields

The Fields API lets you create, retrieve, update and delete individual custom fields or batches of custom fields.

Parameter Type Description Mandatory
api_key string your_api_key YES

Get All Fields

Returns the list of all the fields.

Get All Fields
GET http://example.com/wp-json/funnelkit-automations/fields

    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/fields?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "page": 1
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/fields';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "page": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

GET http://example.com/wp-json/funnelkit-automations/fields?api_key={api-key}

Parameter Type Description Mandatory
page integer Current page of the collection NO

JSON response example:

{
  "code": "success",
  "data": {
    "fields": {
      "1": {
        "group_id": "0",
        "ID": "1",
        "name": "Custom Field 1",
        "type": "1",
        "meta": [],
        "created_at": "2022-04-06 11:39:17",
        "slug": "Custom Field 1"
      },
      "2": {
        "group_id": "0",
        "ID": "2",
        "name": "Custom Field 2",
        "type": "4",
        "meta": {
          "options": [
            "Male",
            "Female",
            "Other"
          ]
        },
        "created_at": "2022-04-06 11:39:17",
        "slug": "Custom Field 2"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Add Field

Adds a specific field.

Add Field
POST http://example.com/wp-json/funnelkit-automations/field/add

    curl --location --request POST 'wp-json/funnelkit-automations/field/add?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "field_name": "custom_field",
        "type": 7,
        "placeholder": "Custom Field",
        "mode": 1,
        "search": 1
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/field/add';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "field_name": "custom_field",
    "type": 7,
    "placeholder": "Custom Field",
    "mode": 1,
    "search": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/field/add?api_key={api-key}

Parameter Type Description Mandatory
field_name string Name of the field YES
group_id integer Field group id. Default is 0 NO
type integer Input type.
1 - text,
2 - number,
3 - textarea,
4 - select,
5 - radio,
6 - checkbox,
7 - date
YES
placeholder string Placeholder for the field NO
mode integer Field is editable or not.
Default is 1
1 - editable,
2 - non-editable
NO
search integer Field is searchable or not.
Default is 1
1 - searchable,
2 - non-searchable
NO
options array an array of JSON objects
['key1'=>'option1',...]
NO

JSON response example:

{
  "code": "success",
  "data": {
    "fields": {
      "ID": "1",
      "name": "custom_field",
      "slug": "custom_field",
      "type": "7",
      "gid": "0",
      "meta": {
        "placeholder": "Custom Field"
      },
      "mode": "1",
      "search": "1",
      "view": "1",
      "created_at": "2022-08-10 11:50:25"
    },
    "limit": 0,
    "offset": 0
  }
}

Update A Field

Updates a particular field.

Update A Field
POST http://example.com/wp-json/funnelkit-automations/field/update/{field_id}

    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/field/update/{field_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "slug":"custom_field",
    "field_name": "custom_field2",
        "type": 7,
        "placeholder": "Custom Field 2",
        "mode": 1,
        "search": 1
    }'
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/field/update/{field_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "slug":"custom_field",
   "field_name": "custom_field2",
    "type": 7,
    "placeholder": "Custom Field 2",
    "mode": 1,
    "search": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP Request

POST http://example.com/wp-json/funnelkit-automations/field/update/{field_id}?api_key={api-key}

Parameter Type Description Mandatory
slug string Slug of the updating field YES
field_name string Name of the field YES
group_id integer Field group id. Default is 0 NO
type integer Input type.
1 - text,
2 - number,
3 - textarea,
4 - select,
5 - radio,
6 - checkbox,
7 - date
NO
placeholder string Placeholder for the field NO
mode integer Field is editable or not.
Default is 1
1 - editable,
2 - non-editable
NO
search integer Field is searchable or not.
Default is 1
1 - searchable,
2 - non-searchable
NO
options array an array of JSON objects
['key1'=>'option1',...]
NO

JSON response example:

{
  "code": "success",
  "data": {
    "fields": {
      "ID": "1",
      "name": "custom_field2"
    },
    "limit": 0,
    "offset": 0
  }
}

Delete A Field

Deletes a field permanently.

Delete A Field
DELETE http://example.com/wp-json/funnelkit-automations/field/{field_id}

    curl --location --request DELETE 'http://example.com/wp-json/funnelkit-automations/field/{field_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/field/{field_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

DELETE http://example.com/wp-json/funnelkit-automations/field/{field_id}?api_key={api-key}

JSON response example:

{
  "code": "success",
  "data": {
    "fields": {
      "ID": "1",
      "name": "custom_field"
    },
    "limit": 0,
    "offset": 0
  }
}

Contacts

The Contacts API lets you create, view, update and delete individual contacts or batches of contacts.

Parameter Type Description Mandatory
api_key string your_api_key YES

Get All Contacts

Returns the list of all the contacts.

Get All Contacts
GET http://example.com/wp-json/funnelkit-automations/contacts

    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/contacts?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contacts';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>

HTTP Request

GET http://example.com/wp-json/funnelkit-automations/contacts?api_key={api-key}

Parameter Type Description Mandatory
page integer Current page of the collection NO
email string Email of the user to get details of NO
sort_order string Order of contacts.
Default is DESC
ASC, DESC
NO
sort_field string Field to sort by.
Default is creation_date
f_name, l_name,
email, creation_date,
last_modified
NO
status string Contact status.
unverified, subscribed,
bounced, unsubscribed
NO
from date Filter subscribers added on or
after this date (format yyyy-mm-dd).
NO
to date Filter subscribers added on or
before this date (format yyyy-mm-dd).
NO
updated_from date Filter subscribers who have been
updated after this date (format yyyy-mm-dd).
NO
updated_to date Filter subscribers who have been
updated before this date (format yyyy-mm-dd).
NO
tag array array of tag ids [id1,id2,...] NO
list array array of list id [id1,id2,...] NO

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contacts": [
        {
          "id": "1",
          "wpid": "0",
          "uid": "8264f563ca27ab672b9665a8da42a500",
          "email": "gary@gmail.com",
          "f_name": "Gary",
          "l_name": "Watson",
          "contact_no": "1234567890",
          "country": "AU",
          "state": "Sydney",
          "timezone": "",
          "type": "lead",
          "source": "public_api",
          "points": "0",
          "tags": "[]",
          "lists": "[]",
          "last_modified": "2022-08-09 16:23:20",
          "creation_date": "2022-08-09 16:23:20",
          "status": "0"
        },
        {
          "id": "2",
          "wpid": "12",
          "uid": "d7b6762adbcf73f382b12a37b3cdf5e9",
          "email": "rosy@gmail.com",
          "f_name": "Rosy",
          "l_name": "Maria",
          "contact_no": "+1234567890",
          "country": "USA",
          "state": "New York",
          "timezone": "America/New York",
          "type": "customer",
          "source": "wc_order",
          "points": "0",
          "tags": "[1,2,3]",
          "lists": "[]",
          "last_modified": "2022-08-01 17:33:48",
          "creation_date": "2022-07-13 11:23:16",
          "status": "1"
        }
      ],
      "total": ""
    },
    "limit": 0,
    "offset": 0
  }
}

Get Contact by ID or Email

Retrieves the details of a contact based on the provided ID or email address.

Get Contact by ID or Email
GET http://example.com/wp-json/funnelkit-automations/contact

    curl --location --request GET 'http://example.com/wp-json/funnelkit-automations/contact?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --header 'id: 1' \
    --header 'email: gary@gmail.com' \
    --data-raw ''
<?php
$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact';
$params = [
    'api_key' => 'your_api_key',
    'id'      => 1,
    'email'   => 'gary@gmail.com'
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP Request

GET http://example.com/wp-json/funnelkit-automations/contact?api_key={api-key}

Parameter Type Description Mandatory
id integer Id of the contact NO
email string Email of the contact NO

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contact": {
        "id": "1",
        "uid": null,
        "email": "gary@gmail.com",
        "wp_id": "3",
        "meta": {},
        "children": {},
        "db_contact": {
          "id": "1",
          "wpid": "0",
          "uid": "8264f563ca27ab672b9665a8da42a500",
          "email": "gary@gmail.com",
          "f_name": "Gary",
          "l_name": "Watson",
          "contact_no": "1234567890",
          "country": "AU",
          "state": "Sydney",
          "timezone": "",
          "type": "lead",
          "source": "public_api",
          "points": "0",
          "tags": "[]",
          "lists": "[]",
          "last_modified": "2022-08-09 16:23:20",
          "creation_date": "2022-08-09 16:23:20",
          "status": "0"
        },

        "blank_values_update": false,
        "is_subscribed": false
      },
      "customer": null,
      "fields": {
        "1": "New York",
        "2": "America",
        "3": "USA",
        "4": "abc",
        "5": "Male"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Add Contact

Adds a specific contact.

Add Contact
POST http://example.com/wp-json/funnelkit-automations/contact/add
    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/contact/add?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email":"tyson@gmail.com",
        "f_name": "Tyson",
        "l_name": "Andrew",
        "contact_no": "1234567890",
        "country": "AU",
        "state": "Melbourne",
        "status": "subscribed",
        "tags": [1,2],
        "lists": [1,2],
        "fields": {
            "40":"20-11-1993",
            "6": "Male"
        }
    }' 
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/add';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
        "email":"tyson@gmail.com",
        "f_name": "Tyson",
        "l_name": "Andrew",
        "contact_no": "1234567890",
        "country": "AU",
        "state": "Melbourne",
        "status": "subscribed",
        "tags": [1,2],
        "lists": [1,2],
        "fields": {
            "1":"20-11-1993",
            "2": "Male"
        }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/add?api_key={api-key}

Parameter Type Description Mandatory
email string Email for the contact YES
f_name string First name for the contact NO
l_name string Last name for the contact NO
contact_no string Phone number for the contact NO
status string Status for the contact
Default is unverified
unverified, subscribed,
bounced, unsubscribed
NO
country string First two letters of the country.
Example : India - IN
NO
state string State living in NO
tags array array of tag ids
[id1,id2,..]
NO
lists array array of list ids
[id1,id2,..]
NO
fields object a JSON object, respectively,
that includes key and value
{'field_id : field value',...}
NO
source string Contact is getting created from.
Default is public_api
NO

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contact": {
        "id": 1,
        "uid": "f1b1bbeb5258c9ec4896c025118b23da",
        "email": "tyson@gmail.com",
        "wp_id": 0,
        "meta": {},
        "children": {},
        "db_contact": null,
        "blank_values_update": false,
        "is_subscribed": false,
        "f_name": "Tyson",
        "l_name": "Andrew",
        "state": "Melbourne",
        "country": "AU",
        "contact_no": "1234567890",
        "status": 0,
        "source": "public_api",
        "type": "lead"
      },
      "customer": null,
      "fields": {
        "1":"20-11-1993",
        "2": "Male"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Update a Contact

Updates a particular contact.

Update a Contact
POST http://example.com/wp-json/funnelkit-automations/contact/update/{contact_id}
    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/contact/update/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email":"gary@gmail.com",
        "f_name": "Gary",
        "l_name": "Watson",
        "contact_no": "1234567890",
        "country": "Au",
        "state": "Sydney",
        "status": "unsubscribed",
        "fields": {
            "6": "Male"
        }
    }'
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/update/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
        "email":"gary@gmail.com",
        "f_name": "Gary",
        "l_name": "Watson",
        "contact_no": "1234567890",
        "country": "Au",
        "state": "Sydney",
        "status": "unsubscribed",
        "fields": {
            "5": "Male"
        }
    }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/update/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
email string Email for the contact NO
f_name string First name for the contact NO
l_name string Last name for the contact NO
contact_no string Phone number for the contact NO
status string Status for the contact
Default is subscribed
verified, subscribed,
bounced, unsubscribed
NO
country string First two letters of the country.
Example : India - IN
NO
state string State living in NO
tags array array of tag ids
[id1,id2,..]
NO
lists array array of list ids
[id1,id2,..]
NO
fields object a JSON object, respectively,
that includes key and value
{'field_id : field value',...}
NO
source string Contact is getting created from.
Default is public_api
NO

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contact": {
        "id": "1",
        "uid": null,
        "email": "gary@gmail.com",
        "wp_id": "3",
        "meta": {},
        "children": {},
        "db_contact": {
          "id": "1",
          "wpid": "3",
          "uid": "9f20c97f3dcba190c31c7f811f11c730",
          "email": "gary@gmail.com",
          "f_name": "Gary",
          "l_name": "Watson",
          "contact_no": "1234567890",
          "country": "AU",
          "state": "Sydney",
          "timezone": "Australia/Sydney",
          "type": "customer",
          "source": "wc_order",
          "points": "0",
          "tags": "[1,2,3]",
          "lists": "[]",
          "last_modified": "2022-08-10 14:00:03",
          "creation_date": "2022-04-21 12:08:22",
          "status": "1"
        },
        "blank_values_update": false,
        "is_subscribed": false
      },
      "customer": null,
      "fields": {
        "1": "Sydney",
        "2": "Australia",
        "3": "2009",
        "4": "abc",
        "5": "Male"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Update Email

Updates the email address of a specific contact.

Update Email
POST http://example.com/wp-json/funnelkit-automations/contact/update-email/{contact_id}
    curl --location --request POST 'POST http://example.com/wp-json/funnelkit-automations/contact/update-email/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email": "gary.w@gmail.com"
    }'
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/update-email/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "email": "gary.w@gmail.com"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/update-email/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
email string Email for the contact YES

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contact": {
        "id": "1",
        "uid": null,
        "email": "gary.w@gmail.com",
        "wp_id": "3",
        "meta": {},
        "children": {},
        "db_contact": {
          "id": "9",
          "wpid": "3",
          "uid": "9f20c97f3dcba190c31c7f811f11c730",
          "email": "gary.w@gmail.com",
          "f_name": "Gary",
          "l_name": "Watson",
          "contact_no": "1234567890",
          "country": "AU",
          "state": "Sydney",
          "timezone": "America/Sydney",
          "type": "customer",
          "source": "wc_order",
          "points": "0",
          "tags": "[1,2,3]",
          "lists": "[]",
          "last_modified": "2022-08-10 17:46:30",
          "creation_date": "2022-04-21 12:08:22",
          "status": "1"
        },
        "blank_values_update": false,
        "is_subscribed": false
      },
      "customer": null,
      "fields": {
        "1": "Sydney",
        "2": "Australia",
        "3": "2009",
        "4": "abc",
        "5": "Male"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Change Status

Updates status of the contact

Change Status
POST http://example.com/wp-json/funnelkit-automations/contact/change-status/{contact_id}
    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/contact/change-status/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "status":"subscribed"
    }'

<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/change-status/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "status":"subscribed"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/change-status/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
status string Status for the contact
verified, subscribed, bounced,
unsubscribed
YES

JSON response example:

{
  "code": "success",
  "data": {
    "contact": {
      "contact": {
        "id": "1",
        "uid": null,
        "email": "gary.w@gmail.com",
        "wp_id": "3",
        "meta": {},
        "children": {},
        "db_contact": {
          "id": "1",
          "wpid": "3",
          "uid": "9f20c97f3dcba190c31c7f811f11c730",
          "email": "gary.w@gmail.com",
          "f_name": "Gary",
          "l_name": "Watson",
          "contact_no": "1234567890",
          "country": "AU",
          "state": "Sydney",
          "timezone": "Australia/Sydney",
          "type": "customer",
          "source": "wc_order",
          "points": "0",
          "tags": "[1,2,3]",
          "lists": "[]",
          "last_modified": "2022-08-10 17:46:30",
          "creation_date": "2022-04-21 12:08:22",
          "status": "1"
        },
        "blank_values_update": false,
        "is_subscribed": false
      },
      "customer": null,
      "fields": {
        "1": "Sydney",
        "2": "Australia",
        "3": "2009",
        "4": "abc",
        "5": "Male"
      }
    },
    "limit": 0,
    "offset": 0
  }
}

Assign Tags

Assign tags to the contact.

Assign Tags
POST http://example.com/wp-json/funnelkit-automations/contact/tag-assign/{contact_id}
    curl --location -g --request POST 'http://example.com/wp-json/funnelkit-automations/contact/tag-assign/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "tags":[1,2]
    }'
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/tag-assign/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "tags":[1,2]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/tag-assign/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
tags array array of tag ids [id1,id2,...] YES

JSON response example:

{
  "code": "success",
  "data": {
    "tags": [
      {
        "id": "1",
        "value": "Tag 1"
      },
      {
        "id": "2",
        "value": "Tag 2"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Unassign Tags

Unassign tags from the contact.

Unassign Tags
POST http://example.com/wp-json/funnelkit-automations/contact/tag-unassign/{contact_id}
    curl --location -g --request POST 'http://example.com/wp-json/funnelkit-automations/contact/tag-unassign/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "tagId": [1]
    }' 
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/tag-unassign/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "tagId": [1]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/tag-unassign/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
tagId array array of tag ids [id1,id2,...] YES

JSON response example:

{
  "code": "success",
  "data": {
    "tags": [
      {
        "id": "1",
        "value": "Tag 1"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Assign Lists

Assign lists to the contact.

Assign Lists
POST http://example.com/wp-json/funnelkit-automations/contact/list-assign/{contact_id}
    curl --location -g --request POST 'http://example.com/wp-json/funnelkit-automations/contact/list-assign/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "lists": [1]
    }'
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/list-assign/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "lists": [1]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/list-assign/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
lists array array of list ids [id1,id2,...] YES

JSON response example:

{
  "code": "success",
  "data": {
    "lists": [
      {
        "id": "1",
        "value": "List 1"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Unassign Lists

Unassign lists from the contact.

Unassign Lists
POST http://example.com/wp-json/funnelkit-automations/contact/list-unassign/{contact_id}
    curl --location --request POST 'http://example.com/wp-json/funnelkit-automations/contact/list-unassign/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "listId": [1]
    }'
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/list-unassign/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "listId": [1]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

POST http://example.com/wp-json/funnelkit-automations/contact/list-unassign/{contact_id}?api_key={api-key}

Parameter Type Description Mandatory
listId array array of list ids [id1,id2,...] YES

JSON response example:

{
  "code": "success",
  "data": {
    "lists": [
      {
        "id": "1",
        "value": "List 1"
      }
    ],
    "limit": 0,
    "offset": 0
  }
}

Delete a contact

Deletes a contact permanently.

Delete a contact
DELETE http://example.com/wp-json/funnelkit-automations/contact/{contact_id}
    curl --location -g --request DELETE 'http://example.com/wp-json/funnelkit-automations/contact/{contact_id}?api_key={api-key}' \
    --header 'Content-Type: application/json' \
    --data-raw ''  
<?php

$site_url = 'http://example.com';
$endpoint = '/wp-json/funnelkit-automations/contact/{contact_id}';
$params = [
    'api_key' => 'your_api_key',
];

$query_string = http_build_query( $params );
$endpoint = $site_url . $endpoint . '?' . $query_string;

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $endpoint,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

HTTP REQUEST

DELETE http://example.com/wp-json/funnelkit-automations/contact/{contact_id}?api_key={api-key}

JSON response example:

{
  "code": "success",
  "data": {
    "limit": 0,
    "offset": 0
  }
}

Errors

There are 7 types of errors in FunnelKit Automations REST API:

Error Code Error Type Description
400 Bad Request Your request is invalid
401 Unauthorized Your API key is wrong
403 Forbidden Request rejected by the server
404 Not Found Data not found
405 Method Not Allowed You tried to access the data with an invalid method
406 Wrong Format You requested a format that isn't json
422 Unprocessable Entity The request failed the validation
500 Internal Server Error Encountered a problem on server. Please try again later.

JSON error response example:

{
  "code": "api_key_missing",
  "message": "API key is missing."
}
{
  "code": "api_key_invalid",
  "message": "API key is not valid."
}
{
  "code": "permission_denied",
  "message": "API key does not have this permission."
}
{
  "code": "api_key_inactive",
  "message": "API key is not active."
}
{
  "code": "data_not_found",
  "message": "Data not found."
}
{
  "code": "required_fields_missing",
  "message": "Some required arguments are missing"
}
{
  "code": "email_invalid",
  "message": "Contact Email Address is not valid."
}
{
  "code": "already_exists",
  "message": "Already exists in the system."
}
{
  "code": "contact_not_exists",
  "message": "Contact not exists."
}
{
  "code": "unprocessable_entity",
  "message": "The request failed validation or was not allowed."
}
{
  "code": "unknown_error",
  "message": "Some error occurred."
}
{
  "code": "method_not_allowed",
  "message": "Method not allowed."
}