NAV Navbar
cURL PHP
  • Introduction
  • Getting Started
  • Accessible Objects
  • Field Types
  • Objects
  • Calendar Events - COMING SOON!
  • Calendar Event Guests - COMING SOON!
  • Calendar Potential Guests - COMING SOON!
  • Calendar Templates - COMING SOON!
  • Calendar Event Types - COMING SOON!
  • Campaign Builder Items
  • Contacts
  • Credit Cards
  • Forms
  • Groups
  • Landing Pages
  • Messages
  • Offers
  • Open Orders
  • Orders
  • Products
  • Purchase History Logs
  • Purchases
  • Rules
  • Transactions
  • Tags
  • Tasks
  • Webhooks
  • Webhook Events
  • Use Cases
  • API Change Log
  • Introduction

    The base URL for all of the requests detailed in this documentation is:

    https://api.ontraport.com/1/
    

    All requests must be made over HTTPS. Any insecure requests are redirected to the HTTPS equivalent URL. The /1/ prefix in the URL is the version number. When substantial changes to the API are released, this number will change.

    Welcome to the new documentation for the Ontraport API! If you are looking for the old documentation, you can find it here.

    Our API offers a simple, RESTful interface with JSON-formatted responses. With it, you can manage contacts, process transactions, add and remove tags and sequences, and much more.

    This documentation contains detailed information about our most widely used API endpoints and general information about best practices.

    We currently offer an official PHP client library for our API to simplify building your integration. Code examples using this library and cURL are offered on the right side of the page. You can toggle between languages using the tabs at the top.

    Getting Started

    Obtain an API Key

    In order to get started making requests on our API, you must obtain a unique API key and App ID. These credentials can be requested in your Administration settings. Your API key provides access to powerful functionality and should not be shared with anyone.

    Once you have an API key, you can also try out some requests on your account using our live documentation. These requests will be performed on your actual data, so use caution in deciding which requests to make.

    Obtain a sandbox

    Any requests made using your API key will be performed using real data in your Ontraport account. You can email support@ontraport.com with any questions you may have.

    To obtain a sandbox account, submit an application here.

    Authentication

    # Using curl, you can just pass the correct header with each request
    curl -X "API endpoint here" \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    // Authentication occurs when the API Key and App ID are sent as request headers
    // These headers are set when you create a new instance of the Ontraport client
    $client = new Ontraport("2_AppID_12345678","Key5678");
    

    Example values are used for API key and App ID, your unique credentials must be used in your request.

    To interact with our API, authentication credentials must be sent with each HTTP request as headers. These credentials include a unique API key and App ID. Any requests sent without valid credentials in the headers will fail.

    Header Value
    Api-Key Set to your unique API key. This must be used in conjunction with your unique site ID or your request will not authenticate. Required.
    Api-Appid Set to your unique site ID. Required.

    Rate limiting

    Each Ontraport account is allowed up to 180 requests per minute. This is a rolling limit that resets each minute.

    If you find that your application needs more than the allotted number of calls, you may wish to check that you are utilizing our pagination tools and/or consider implementing cache functionality.

    Our support staff will consider reasonable requests to increase rate limits on a per-account basis.

    You can track your rate limit status via response headers:

    Header Description
    X-Rate-Limit-Limit The upper limit of API requests allowed per minute.
    X-Rate-Limit-Remaining The number of requests remaining in this one-minute period.
    X-Rate-Limit-Reset The number of seconds until the rolling limit resets.

    Object identifiers

    Each Ontraport object has both an object type ID and an object ID. In this documentation, object type ID refers to the identifier that differentiates one object type from another. All objects of the same type have the same object type ID.

    ID refers to the identifier for that specific object. For example, a contact will always have an object type ID of 0, but each contact will also have a unique ID by which it can be accessed. All objects of the same type will have a different ID.

    Plural and singular endpoints

    Example retrieving a contact with the unique ID of 15:

    curl -X GET 'https://api.ontraport.com/1/Contact?id=15' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $queryParams = array(
        "id" => 15
    );
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->contact()->retrieveSingle($queryParams);
    

    Example retrieving first name, last name and email for contacts with the last name "Smith":

    curl -X GET 'https://api.ontraport.com/1/Contacts?condition=%5B%7B%20%22field%22%3A%7B%22field%22%3A%22lastname%22%7D%2C%20%22op%22%3A%22%3D%22%2C%20%22value%22%3A%7B%22value%22%3A%22Smith%22%7D%20%7D%5D&listFields=firstname%2Clastname%2Cemail' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $queryParams = array(
        "condition"     => "[{
                               \"field\":{\"field\":\"lastname\"},
                               \"op\":\"=\",
                               \"value\":{\"value\":\"Smith\"}
                           }]",
        "listFields" => "firstname,lastname,email"
    );
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->contact()->retrieveMultiple($queryParams);
    

    Many of our objects have plural and singular endpoints. Through utilizing plural endpoints with pagination and criteria, you can minimize the number of API calls needed for your integration. Singular endpoints should be used only in the case that you want to retrieve or delete a specific object by its ID. If you wish to perform operations on a collection of objects, the plural endpoints should be used.

    Retrieving an object using its singular endpoint will bring back all the data for that object, whereas using plural endpoints allows you to specify exactly which fields you would like to retrieve.

    Pagination

    Example retrieving the count for a contacts collection:

    # The response data contains a "count" field which holds the object count
    curl -X GET 'https://api.ontraport.com/1/Contacts/getInfo' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->contact()->retrieveCollectionInfo(array());
    $response = json_decode($response, true);
    $count = $response["data"]["count"];
    

    Example retrieving a collection of contacts:

    curl -X GET 'https://api.ontraport.com/1/Contacts?start=0' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    curl -X GET 'https://api.ontraport.com/1/Contacts?start=50' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    curl -X GET 'https://api.ontraport.com/1/Contacts?start=100' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    curl -X GET 'https://api.ontraport.com/1/Contacts?start=150' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    $start = 0;
    $range = 50;
    
    $requestParams = array(
        "start" => $start,
        "range" => $range
    );
    $contacts = $client->contact()->retrieveMultiplePaginated();
    

    When making requests on collections of objects, the number of results returned defaults to the maximum, which is 50. This means that without using pagination to iterate through your collections, you will only ever access the first 50 objects. The start and range parameters allow you to navigate through larger data sets.

    To determine the count of objects in your collection, you can make a call to getInfo for your desired resource and retrieve the count.

    Parameter Type Description
    start integer The offset from which your requested data should begin.
    range integer The number of records returned per request.

    Criteria

    Example: "email = test@test.com"

    [{
        "field":{"field":"email"},
        "op":"=",
        "value":{"value":"test@test.com"}
    }]
    

    Example: "id IN (1, 2)"

    [{
        "field":{"field":"id"},
        "op":"IN",
        "value":{"list":[{"value":1},{"value":2}]}
    }]
    

    Example: "email IS NULL OR email = ''"

    [{
      "field":{"field":"email"},
      "op":"=",
      "value":{"value":""}
    },
    "OR",
    {
      "field":{"field":"email"},
      "op":"IS",
      "value":"NULL"
    }]
    

    We offer additional parameters to ensure that you are retrieving only those objects you specifically want. For example, if you would like to perform an action on contacts with the last name "Smith", it is better to target those records in your query as opposed to retrieving all your contacts and then filtering the results.

    Parameter Type Description
    search string The string to search your object collection for.
    searchNotes boolean Indicates whether or not notes should be searched for the search string. This parameter can't be used independently of the search parameter.
    condition string This JSON-encoded field allows you to very specifically evaluate objects for a condition. You can check whether or not fields in your object meet a particular condition. field is where you designate what field you want to check for a condition. op indicates the comparison operator you would like to use. value is where you can set a value or list of values to compare field to. Possible operators include:
    > : Greater than
    < : Less than
    >= : Greater than or equal to
    <= : Less than or equal to
    = : Equal to
    IN : Field is one of a list of values
    You can also string conditions together with AND, to check that both conditions are true, or OR, to check that at least one of the conditions is true. Examples can be seen to the right.


    Sometimes you may just be interested in a few object fields and not the entire object. If you have a relationship between two objects, you may wish to gather information from the related object as well. In these cases, you can describe a list of the fields you would like returned.

    Parameter Type Description
    listFields string An array as a comma-delimited list of object fields to retrieve.
    externs string An array as a comma-delimited list of related external fields to retrieve.


    Instead of retrieving objects by specific IDs, you can also perform actions on a collection of objects by group ID. Group ID should be accompanied by the performAll parameter. However, if you set performAll = 1, remember that a value of 0 for group_id effectively selects all objects in a collection.

    Parameter Type Description
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group.

    Standard requests

    Unique URLs

    Each resource in our API is identified by a unique URL. For example, contacts can be created, retrieved, updated and deleted at:

    https://api.ontraport.com/1/Contacts

    HTTP Methods

    When making an HTTP request, you must specify the method to be used. Our API accepts GET, PUT, POST and DELETE methods. Each of these methods corresponds to a persistent storage CRUD operation:

    Method Operation Usage
    POST Create Adds new data to your database.
    GET Retrieve Brings back data from your database.
    PUT Update Replaces old data with new.
    DELETE Delete Permanently removes data from your database.

    Request Headers

    API requests must be accompanied by headers to specify what data formats will be sent and received. All responses will be JSON-encoded regardless of request method. The following is a list of all the headers you may be expected to send with your requests.

    Header Description
    Api-Key Set to your unique API key. This must be used in conjunction with your unique site ID or your request will not authenticate. Required.
    Api-Appid Set to your unique site ID. Required.
    Content-Type Specifies the format of data being sent with your request. Set to application/x-www-form-urlencoded or application/json. Required for POST and PUT requests. See the documentation for specific endpoints in these cases.

    Request Parameters

    Parameters for GET and DELETE requests should be encoded to a query string and appended to the URL:

    https://api.ontraport.com/1/Object?param1=value1&param2=value2&param3=value3

    Parameters for PUT and POST requests are sent in the request body. The data type expected in the request body is indicated in the Content-Type header.

    When JSON is expected, parameters should be JSON-encoded:

    {"param1":"value1","param2":"value2","param3":"value3"}

    When form data is expected, parameters should be URL-encoded:

    param1=value1&param2=value2&param3=value3

    Extended Functionality

    Simple object endpoints typically handle basic CRUD functionality for that object. For many objects, we have extended endpoints to allow for additional functionality. For example, you can obtain detailed information about the contact object by appending "getMeta" to the URL:

    https://api.ontraport.com/1/Contacts/getMeta

    Requests must be made over HTTPS. Any insecure requests are redirected to the HTTPS equivalent URL.

    Standard responses

    Example response:

    {
      "code": 0,
      "data": {
        "id": "1",
        "owner": "1",
        "firstname": "Frodo",
        "lastname": "Baggins",
        "email": "fb@gmail.com",
        "address": null,
        "city": null,
        "state": null,
        "zip": null,
        "birthday": null,
        "date": "1487705750",
        "notes": null,
        "status": null,
        "category": null,
        "lead_source": null,
        "cell_phone": null,
        "home_phone": null,
        "sms_number": null,
        "dla": "1487705750",
        "contact_cat": "",
        "bulk_mail": "1",
        "bulk_sms": "0",
        "lastvisit": null,
        "referer": "0",
        "lastaction": null,
        "office_phone": null,
        "fax": null,
        "dlm": "1487705765",
        "company": null,
        "address2": null,
        "title": null,
        "website": null,
        "country": null,
        "system_source": "0",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "visits": "0",
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_birthday": "0",
        "fb_gender": null,
        "fb_likes": null,
        "fb_groups": null,
        "fb_website": null,
        "fb_hometown": null,
        "fb_location": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "bindex": "0",
        "last_inbound_sms": null,
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "grade": "0.00"
      },
      "account_id": "12345"
    }
    

    Every successful API call returns a JSON-formatted response containing:

    Element Type Description
    code integer Indicates the success or failure of the call. If code is 0, this indicates an HTTP 200 successful call.
    data object Contains object-specific attributes and data
    account_id integer ID of the account making the API call

    Error and response codes

    Both successful and unsuccessful calls will return HTTP response codes. The most common codes you will encounter using our API are as follows:

    Code Description
    200 OK - Your request was completed successfully.
    400 Bad Request - Your request data is not properly formed.
    401 Unauthorized - You are not authenticated.
    403 Forbidden - You do not have permissions to access this resource.
    404 Not Found - You are requesting a resource that does not exist.
    422 Unprocessable Entity - One or more of the fields you included were not able to be processed. Currently used for invalid email addresses.
    429 Too Many Requests - You have exceeded your maximum rate limit of 180 requests per minute.
    500 Internal Server Error - Something has gone wrong on the website's server.

    Click here to see a full listing of possible codes.

    Accessible Objects

    The following is a list of objects exposed by the API, along with their object type ID and corresponding permissions.

    TRY IT OUT LIVE

    Object Object Type ID GET PUT POST DELETE
    Automation Log Item 100 x
    Blast 13 x x x
    Calendar 175 x
    Calendar Event 160 x x x x
    Calendar Event Guest 161 x
    Calendar Event Type 177 x x x
    Calendar Potential Guest 174 x
    Calendar Template 164 x x x x
    Campaign 75 x
    Campaign Builder 140 x
    Commission 38 x
    Contact 0 x x x x
    Content 78 x x x
    Coupon 123 x x x x
    Coupon Code 124 x
    Coupon Product 125 x
    Credit Card 45 x x
    Custom Domain 58 x
    Custom Object 99 x
    Custom Object Relationship 102 x
    Customer Value 96 x
    Deleted Open Order 146 x
    Facebook App 53 x
    Form 22 x
    Form (ONTRAForms) 122 x
    Fulfillment List 19 x x x x
    Gateway 70 x
    Group 3 x x
    IMAP Setting 101 x
    Landing Page 20 x x x x
    Lead Router 69 x x x x
    Lead Source 76 x x x
    Log Item 4 x
    Medium 77 x x x
    Message 7 x x x x
    Message Template 68 x
    Note 12 x x x x
    Offer 65 x x x
    Open Order 44 x
    Order 52 x x
    Partner 36 x
    Partner Product 87 x
    Partner Program 35 x x x x
    Partner Promotional Item 40 x x x x
    Postcard Order 27 x
    Product 16 x x x x
    Product Sales Log 95 x
    Purchase 17 x
    Purchase History Log 30 x
    Referral 37 x
    Role 61 x
    Rule 6 x x x x
    Sales Report 94 x
    Scheduled Broadcast 23 x
    Sequence 5 x x x x
    Sequence Subscriber 8 x
    Shipped Package 47 x
    Shipping Collected 97 x
    Shipping Fulfillment Run 49 x
    Shipping Method 64 x x x x
    Subscriber Retention 92 x
    Subscription Sale 93 x
    Tag 14 x x x x
    Tag Subscriber 138 x
    Task 1 x x
    Task History 90 x
    Task Note 89 x x
    Task Outcome 66 x
    Tax 63 x x x x
    Taxes Collected 98 x
    Term 79 x x x
    Tracked Link 80 x x x x
    Transaction 46 x
    Upsell Form 42 x
    URL History 88 x
    User 2 x x
    Webhook 145 x x x x
    Wordpress Membership 43 x x x x
    Wordpress Site 67 x

    Field Types

    check

    Check represents a boolean checkbox.

    Valid values

    0, 1

    country

    Represents a selectable country.

    Valid values

    Real countries
    • "US"=>"United States"
    • "CA"=>"Canada"
    • "GB"=>"United Kingdom"
    • "AF"=>"Afghanistan"
    • "AX"=>"Ã…land"
    • "AL"=>"Albania"
    • "DZ"=>"Algeria"
    • "AS"=>"American Samoa"
    • "AD"=>"Andorra"
    • "AO"=>"Angola"
    • "AI"=>"Anguilla"
    • "AQ"=>"Antarctica"
    • "AG"=>"Antigua and Barbuda"
    • "AR"=>"Argentina"
    • "AM"=>"Armenia"
    • "AW"=>"Aruba"
    • "AU"=>"Australia"
    • "AT"=>"Austria"
    • "AZ"=>"Azerbaijan"
    • "BS"=>"Bahamas"
    • "BH"=>"Bahrain"
    • "BD"=>"Bangladesh"
    • "BB"=>"Barbados"
    • "BY"=>"Belarus"
    • "BE"=>"Belgium"
    • "BZ"=>"Belize"
    • "BJ"=>"Benin"
    • "BM"=>"Bermuda"
    • "BT"=>"Bhutan"
    • "BO"=>"Bolivia"
    • "BQ"=>"Bonaire"
    • "BA"=>"Bosnia and Herzegovina"
    • "BW"=>"Botswana"
    • "BV"=>"Bouvet Island"
    • "BR"=>"Brazil"
    • "IO"=>"British Indian Ocean Territory"
    • "VG"=>"British Virgin Islands"
    • "BN"=>"Brunei"
    • "BG"=>"Bulgaria"
    • "BF"=>"Burkina Faso"
    • "BI"=>"Burundi"
    • "KH"=>"Cambodia"
    • "CM"=>"Cameroon"
    • "CA"=>"Canada"
    • "CV"=>"Cape Verde"
    • "KY"=>"Cayman Islands"
    • "CF"=>"Central African Republic"
    • "TD"=>"Chad"
    • "CL"=>"Chile"
    • "CN"=>"China"
    • "CX"=>"Christmas Island"
    • "CC"=>"Cocos (Keeling) Islands"
    • "CO"=>"Colombia"
    • "KM"=>"Comoros"
    • "CK"=>"Cook Islands"
    • "CR"=>"Costa Rica"
    • "HR"=>"Croatia (Local Name: Hrvatska)"
    • "CU"=>"Cuba"
    • "CW"=>"Curacao"
    • "CY"=>"Cyprus"
    • "CZ"=>"Czech Republic"
    • "CD"=>"Democratic Republic of the Congo"
    • "DK"=>"Denmark"
    • "DJ"=>"Djibouti"
    • "DM"=>"Dominica"
    • "DO"=>"Dominican Republic"
    • "TL"=>"East Timor"
    • "EC"=>"Ecuador"
    • "EG"=>"Egypt"
    • "SV"=>"El Salvador"
    • "GQ"=>"Equatorial Guinea"
    • "ER"=>"Eritrea"
    • "EE"=>"Estonia"
    • "ET"=>"Ethiopia"
    • "FK"=>"Falkland Islands (Malvinas)"
    • "FO"=>"Faroe Islands"
    • "FJ"=>"Fiji"
    • "FI"=>"Finland"
    • "FR"=>"France"
    • "GF"=>"French Guiana"
    • "PF"=>"French Polynesia"
    • "TF"=>"French Southern Territories"
    • "GA"=>"Gabon"
    • "GM"=>"Gambia"
    • "GE"=>"Georgia"
    • "DE"=>"Germany"
    • "GH"=>"Ghana"
    • "GI"=>"Gibraltar"
    • "GR"=>"Greece"
    • "GL"=>"Greenland"
    • "GD"=>"Grenada"
    • "GP"=>"Guadeloupe"
    • "GU"=>"Guam"
    • "GT"=>"Guatemala"
    • "GG"=>"Guernsey"
    • "GN"=>"Guinea"
    • "GW"=>"Guinea-Bissau"
    • "GY"=>"Guyana"
    • "HT"=>"Haiti"
    • "HM"=>"Heard Island and McDonald Islands"
    • "HN"=>"Honduras"
    • "HK"=>"Hong Kong"
    • "HU"=>"Hungary"
    • "IS"=>"Iceland"
    • "IN"=>"India"
    • "ID"=>"Indonesia"
    • "IR"=>"Iran"
    • "IQ"=>"Iraq"
    • "IE"=>"Ireland"
    • "IM"=>"Isle of Man"
    • "IL"=>"Israel"
    • "IT"=>"Italy"
    • "CI"=>"Ivory Coast"
    • "JM"=>"Jamaica"
    • "JP"=>"Japan"
    • "JE"=>"Jersey"
    • "JO"=>"Jordan"
    • "KZ"=>"Kazakhstan"
    • "KE"=>"Kenya"
    • "KI"=>"Kiribati"
    • "XK"=>"Kosovo"
    • "KW"=>"Kuwait"
    • "KG"=>"Kyrgyzstan"
    • "LA"=>"Laos"
    • "LV"=>"Latvia"
    • "LB"=>"Lebanon"
    • "LS"=>"Lesotho"
    • "LR"=>"Liberia"
    • "LY"=>"Libya"
    • "LI"=>"Liechtenstein"
    • "LT"=>"Lithuania"
    • "LU"=>"Luxembourg"
    • "MO"=>"Macao"
    • "MG"=>"Madagascar"
    • "MW"=>"Malawi"
    • "MY"=>"Malaysia"
    • "MV"=>"Maldives"
    • "ML"=>"Mali"
    • "MT"=>"Malta"
    • "MH"=>"Marshall Islands"
    • "MQ"=>"Martinique"
    • "MR"=>"Mauritania"
    • "MU"=>"Mauritius"
    • "YT"=>"Mayotte"
    • "MX"=>"Mexico"
    • "FM"=>"Micronesia"
    • "MD"=>"Moldova"
    • "MC"=>"Monaco"
    • "MN"=>"Mongolia"
    • "ME"=>"Montenegro"
    • "MS"=>"Montserrat"
    • "MA"=>"Morocco"
    • "MZ"=>"Mozambique"
    • "MM"=>"Myanmar (Burma)"
    • "NA"=>"Namibia"
    • "NR"=>"Nauru"
    • "NP"=>"Nepal"
    • "NL"=>"Netherlands"
    • "NC"=>"New Caledonia"
    • "NZ"=>"New Zealand"
    • "NI"=>"Nicaragua"
    • "NE"=>"Niger"
    • "NG"=>"Nigeria"
    • "NU"=>"Niue"
    • "NF"=>"Norfolk Island"
    • "KP"=>"North Korea"
    • "MK"=>"North Macedonia"
    • "MP"=>"Northern Mariana Islands"
    • "NO"=>"Norway"
    • "OM"=>"Oman"
    • "PK"=>"Pakistan"
    • "PW"=>"Palau"
    • "PS"=>"Palestine"
    • "PA"=>"Panama"
    • "PG"=>"Papua New Guinea"
    • "PY"=>"Paraguay"
    • "PE"=>"Peru"
    • "PH"=>"Philippines"
    • "PN"=>"Pitcairn Islands"
    • "PL"=>"Poland"
    • "PT"=>"Portugal"
    • "PR"=>"Puerto Rico"
    • "QA"=>"Qatar"
    • "CG"=>"Republic of the Congo"
    • "RE"=>"Réunion"
    • "RO"=>"Romania"
    • "RU"=>"Russia"
    • "RW"=>"Rwanda"
    • "BL"=>"Saint Barthélemy"
    • "SH"=>"Saint Helena"
    • "KN"=>"Saint Kitts and Nevis"
    • "LC"=>"Saint Lucia"
    • "MF"=>"Saint Martin"
    • "PM"=>"Saint Pierre and Miquelon"
    • "VC"=>"Saint Vincent and the Grenadines"
    • "WS"=>"Samoa"
    • "SM"=>"San Marino"
    • "SA"=>"Saudi Arabia"
    • "SN"=>"Senegal"
    • "RS"=>"Serbia"
    • "SC"=>"Seychelles"
    • "SL"=>"Sierra Leone"
    • "SG"=>"Singapore"
    • "SX"=>"Sint Maarten"
    • "SK"=>"Slovakia (Slovak Republic)"
    • "SI"=>"Slovenia"
    • "SB"=>"Solomon Islands"
    • "SO"=>"Somalia"
    • "ZA"=>"South Africa"
    • "GS"=>"South Georgia and the South Sandwich Islands"
    • "KR"=>"South Korea"
    • "SS"=>"South Sudan"
    • "ES"=>"Spain"
    • "LK"=>"Sri Lanka"
    • "SD"=>"Sudan"
    • "SR"=>"Suriname"
    • "SJ"=>"Svalbard and Jan Mayen"
    • "SZ"=>"Swaziland"
    • "SE"=>"Sweden"
    • "CH"=>"Switzerland"
    • "SY"=>"Syria"
    • "ST"=>"São Tomé and Príncipe"
    • "TW"=>"Taiwan"
    • "TJ"=>"Tajikistan"
    • "TZ"=>"Tanzania"
    • "TH"=>"Thailand"
    • "TG"=>"Togo"
    • "TK"=>"Tokelau"
    • "TO"=>"Tonga"
    • "TT"=>"Trinidad and Tobago"
    • "TN"=>"Tunisia"
    • "TR"=>"Turkey"
    • "TM"=>"Turkmenistan"
    • "TC"=>"Turks and Caicos Islands"
    • "TV"=>"Tuvalu"
    • "UM"=>"U.S. Minor Outlying Islands"
    • "VI"=>"U.S. Virgin Islands"
    • "UG"=>"Uganda"
    • "UA"=>"Ukraine"
    • "AE"=>"United Arab Emirates"
    • "GB"=>"United Kingdom"
    • "US"=>"United States"
    • "UY"=>"Uruguay"
    • "UZ"=>"Uzbekistan"
    • "VU"=>"Vanuatu"
    • "VA"=>"Vatican City"
    • "VE"=>"Venezuela"
    • "VN"=>"Vietnam"
    • "WF"=>"Wallis and Futuna"
    • "EH"=>"Western Sahara"
    • "YE"=>"Yemen"
    • "ZM"=>"Zambia"
    • "ZW"=>"Zimbabwe"

    fulldate

    (may be listed as 'date' in older accounts)

    A fulldate type represents a date. The info for time is stored, but not typically displayed. (use a 'Date & Time' field if you want to display a date AND time)

    Valid values

    A unix timestamp

    Example: 1580854597 (which is 02/04/2020)

    funnel

    Deprecated and no longer used.

    longtext

    A long section of text, usually multiple lines.

    Valid values

    Any string.

    numeric

    A number

    Valid values

    A number.

    price

    A value representing a currency amount.

    Valid values

    Some integer or decimal number with 2 decimal spaces. A dollar sign at the front is allowed, but not necessary.

    Valid examples: 3, $7, or $2.10

    Invalid examples: 1.54356 or 12.01$

    phone

    A phone number.

    Valid values

    Something in the form of +X XXX-XXX-XXXX

    state

    A state within a country. Available countries are US, AU, ZA, and IN.

    Valid values

    Available states
    • "AL"=>"Alabama"
    • "AK"=>"Alaska"
    • "AZ"=>"Arizona"
    • "AR"=>"Arkansas"
    • "CA"=>"California"
    • "CO"=>"Colorado"
    • "CT"=>"Connecticut"
    • "DE"=>"Delaware"
    • "DC"=>"D.C."
    • "FL"=>"Florida"
    • "GA"=>"Georgia"
    • "HI"=>"Hawaii"
    • "ID"=>"Idaho"
    • "IL"=>"Illinois"
    • "IN"=>"Indiana"
    • "IA"=>"Iowa"
    • "KS"=>"Kansas"
    • "KY"=>"Kentucky"
    • "LA"=>"Louisiana"
    • "ME"=>"Maine"
    • "MD"=>"Maryland"
    • "MA"=>"Massachusetts"
    • "MI"=>"Michigan"
    • "MN"=>"Minnesota"
    • "MS"=>"Mississippi"
    • "MO"=>"Missouri"
    • "MT"=>"Montana"
    • "NE"=>"Nebraska"
    • "NV"=>"Nevada"
    • "NH"=>"New Hampshire"
    • "NM"=>"New Mexico"
    • "NJ"=>"New Jersey"
    • "NY"=>"New York"
    • "NC"=>"North Carolina"
    • "ND"=>"North Dakota"
    • "OH"=>"Ohio"
    • "OK"=>"Oklahoma"
    • "OR"=>"Oregon"
    • "PA"=>"Pennsylvania"
    • "PR"=>"Puerto Rico"
    • "RI"=>"Rhode Island"
    • "SC"=>"South Carolina"
    • "SD"=>"South Dakota"
    • "TN"=>"Tennessee"
    • "TX"=>"Texas"
    • "UT"=>"Utah"
    • "VT"=>"Vermont"
    • "VA"=>"Virginia"
    • "WA"=>"Washington"
    • "WV"=>"West Virginia"
    • "WI"=>"Wisconsin"
    • "WY"=>"Wyoming"
    • "AB"=>"Alberta"
    • "BC"=>"British Columbia"
    • "MB"=>"Manitoba"
    • "NB"=>"New Brunswick"
    • "NL"=>"Newfoundland and Labrador"
    • "NS"=>"Nova Scotia"
    • "NT"=>"Northwest Territories"
    • "NU"=>"Nunavut"
    • "ON"=>"Ontario"
    • "PE"=>"Prince Edward Island"
    • "QC"=>"Quebec"
    • "SK"=>"Saskatchewan"
    • "YT"=>"Yukon"
    • "ACT"=>"(AU) Australian Capital Territory"
    • "NSW"=>"(AU) New South Wales"
    • "VIC"=>"(AU) Victoria"
    • "QLD"=>"(AU) Queensland"
    • "AU_NT"=>"(AU) Northern Territory"
    • "AU_WA"=>"(AU) Western Australia"
    • "SA"=>"(AU) South Australia"
    • "TAS"=>"(AU) Tasmania"
    • "GP"=>"(ZA) Gauteng"
    • "WP"=>"(ZA) Western Cape"
    • "EC"=>"(ZA) Eastern Cape"
    • "KZN"=>"(ZA) Kwa-Zulu Natal"
    • "NW"=>"(ZA) North West"
    • "AF_NC"=>"(ZA) Northern Cape"
    • "MP"=>"(ZA) Mpumalanga"
    • "FS"=>"(ZA) Free State"
    • "INASM" => "(IN) Assam"
    • "INANP" => "(IN) Andaman and Nicobar Islands"
    • "INARP" => "(IN) Andhra Pradesh"
    • "INAUP" => "(IN) Arunachal Pradesh"
    • "INBIH" => "(IN) Bihar"
    • "INCHA" => "(IN) Chandigarh"
    • "INCHH" => "(IN) Chhattisgarh"
    • "INDEL" => "(IN) Delhi"
    • "INDAM" => "(IN) Daman and Diu"
    • "INDAD" => "(IN) Dadra and Nagar Haveli"
    • "INGOA" => "(IN) Goa"
    • "INGUJ" => "(IN) Gujarat"
    • "INHAR" => "(IN) Haryana"
    • "INHIM" => "(IN) Himachal Pradesh"
    • "INJAM" => "(IN) Jammu and Kashmir"
    • "INJHA" => "(IN) Jharkhand"
    • "INKAR" => "(IN) Karnataka"
    • "INKER" => "(IN) Kerala"
    • "INLAK" => "(IN) Lakshadweep"
    • "INMIZ" => "(IN) Mizoram"
    • "INMAD" => "(IN) Madhya Pradesh"
    • "INMEG" => "(IN) Meghalaya"
    • "INMAN" => "(IN) Manipur"
    • "INMAH" => "(IN) Maharashtra"
    • "INNAG" => "(IN) Nagaland"
    • "INODI" => "(IN) Odisha"
    • "INPUD" => "(IN) Puducherry"
    • "INPUN" => "(IN) Punjab"
    • "INRAJ" => "(IN) Rajasthan"
    • "INSIK" => "(IN) Sikkim"
    • "INTRI" => "(IN) Tripura"
    • "INTAM" => "(IN) Tamil Nadu"
    • "INUTK" => "(IN) Uttarakhand"
    • "INUTP" => "(IN) Uttar Pradesh"
    • "INWBG" => "(IN) West Bengal"
    • "_NOTLISTED_" => "My State is not listed"

    drop

    A dropdown field.

    Valid values

    For a dropdown field, you must provide options for users to select.

    Example of a 'type' field:

    "type": {
      "alias": "Sales Stage",
      "type": "drop",
      "options": {
        "1": "Closed - Lost",
        "2": "Closed - Won",
        "3": "Committed",
        "4": "Consideration",
        "5": "Demo Scheduled",
        "6": "Qualified Lead",
        "7": "New Prospect"
      }
    }
    

    list

    A list selection field.

    Valid values

    For a list selection field, you must provide options for users to select. When updating a list type field, the option ID values must be separated by this delimiter: */*. For example, */*55*/*97*/*.

    Example of a 'list' field:

    "f1792": {
        "alias": "Example List",
        "type": "list",
        "required": 0,
        "unique": 0,
        "editable": 1,
        "deletable": 1,
        "options": {
            "123": "One",
            "124": "Two",
            "125": "Three"
        }
    }
    

    text

    A text field.

    Valid values

    Any string.

    timestamp

    A unix timestamp that is treated as a time and date adjusted to timezone.

    Valid values

    Any unix timestamp.

    Example: 1580854597 (which is 02/04/2020 @ 10:16pm (UTC))

    parent

    Related to a parent or child object.

    Valid values

    The value will just be an id referring to the specific 'parent' object.

    The parent's object type will be specified as 'parent_object' in the meta call.

    Example of /meta call below:

    "f1723": {
        "alias": "Offspring(Parent)",
        "type": "parent",
        "required": 0,
        "unique": 0,
        "editable": 1,
        "deletable": 0,
        "parent_object": "10002"
    }
    

    Example below of /fieldeditor call:

    {
        "id": 1723,
        "alias": "Offspring(Parent)",
        "field": "f1723",
        "type": "parent",
        "required": 0,
        "unique": 0,
        "editable": 1,
        "deletable": 0,
        "options": "{\"model\":\"10002\"}"
    }
    

    mergefield

    A combination of other fields' values. These fields cannot be created or directly modified.

    Valid values

    Example of a full name (combining first name and last name): <op:merge field='firstname'>X</op:merge> <op:merge field='lastname'>X</op:merge>

    The field overall shows up in field editor like: { "id": 198, "alias": "Name", "field": "fn", "type": "mergefield", "required": 0, "unique": 0, "editable": 0, "deletable": 0, "options": "<op:merge field='firstname'>X</op:merge> <op:merge field='lastname'>X</op:merge>" },

    image

    A unique image name referring to an image hosted by Ontraport. The API accepts image field updates via image URLs. API requests containing Ontraport image fields (except profile_image field) are rehosted to Ontraport which generates a new image URL for the same image.

    Note: As the image URL changes in the response, do not rely on utilizing the same image URL you sent in your request.

    Example request:

    A request to POST /objects: { "objectID" : 0, "firstname" : "Bob", "yourimagefield" : "https://yourserver.jpeg" }

    A plausible response for this is: { "objectID" : 0, "firstname" : "Bob", "yourimagefield" : "https://i.ontraport.com/200030.a02f959a506cbae565c7e.JPEG" }

    Valid values

    Image URLs starting with i.ontraport.com/youraccountID. are valid values

    Example profile_image field:

    {
        "id": 1679,
        "alias": "Profile Image",
        "field": "profile_image",
        "type": "image",
        "required": 0,
        "unique": 0,
        "editable": 1,
        "deletable": 1,
        "options": "https://i.ontraport.com/"
    }
    

    subscription

    Refers to some type of subscription value (tags, campaigns, or sequences).

    Valid values

    If you want to update these values, refer to /objects/subscribe (for campaigns and sequences) and /objects/tag (for tags)

    Refer to Tag Subscribers or Sequence Subscribers objects for more details.

    percentage

    A numeric value representing a percentage. Also displays the count of the numerator to the left of the percentage.

    Valid values

    No value directly stored. 'mergefield' is the numerator field.

    The 'extra_data' field will carry some more info, such as the denominator field and precision.

    Example: {"ref_field":"mcsent","precision":2,"link_sprintf":{"url":"/#!/%s/listAll&bmasks=[[\"%i\",\"11\",true,\"AND\"]]", "fields":["url","id"]}}

    raw_percentage

    Same as percent, just displayed as only as the percentage.

    Related data is a way to grab the field info of some related data object.

    Valid values

    The value will directly store and update to match the targeted data.

    The way this is handled is through 'options', visible in the /fieldeditor call. It will be a chain of fields separated by '//'. This chain shows the path of relations, going to the final object and then its field. (Currently, the user interface only supports going through two relations, although further chaining is supported by our backend.)

    Example of a simple relation (Child->Parent->Name):

    {
        "id": 1738,
        "alias": "ParentName",
        "field": "f1738",
        "type": "related_data",
        "required": 0,
        "unique": 0,
        "editable": 0,
        "deletable": 1,
        "options": "f1736//f1708"
    }
    

    Example of a three-layered relation (Child->Parent->Grandparent->Name):

    {
        "id": 1738,
        "alias": "GrandData",
        "field": "f1738",
        "type": "related_data",
        "required": 0,
        "unique": 0,
        "editable": 0,
        "deletable": 1,
        "options": "f1736//f1722//f1709"
    }
    

    email

    A string that represents an email address.

    Valid values

    Strings will be checked to be of the format X@Y.Z

    sms

    A string value representing a SMS number

    Valid values

    Integers will be validated as long as they are numeric and less than 16 characters. The backend will reformat them as well as it can.

    address

    A string representing an address.

    Valid values

    Any string will be considered valid.

    JSONtext

    Text meant to be interpreted as JSON.

    Valid values

    Any string is valid input, but may not be valid JSON.

    timezone

    A timezone, represented as a string and interpreted where necessary.

    Valid values

    Examples: * America/Los_Angeles * Europe/London * Australia/Sydney * Asia/Tokyo * Asia/Kolkata

    url

    A string representing a URL.

    Valid values

    Input type is string, but validated to be a proper URL.

    unique

    A unique ID.

    Valid values

    A system-generated string that doesn't match any other unique ID of any object across the account.

    Objects

    The objects API provides powerful and versatile functionality for a wide variety of our objects. Although we provide many endpoints for specific object types, using generic object endpoints with an object type ID provides an interface for most objects.

    You can create new objects, get or delete single objects or collections of objects, and update object data. You can also retrieve meta for all objects or a single object to obtain more detailed information about object attributes, and retrieve information about a collection of objects.

    This API also contains functionality allowing you to tag and untag, add and remove objects from sequences, and pause and unpause rules and sequences.

    To perform a request on any object endpoint, you must provide a valid object type ID. All other parameters are specific to the object you are accessing.

    The generic object

    Attributes

    Generic object endpoints are unique because of their flexibility. Functions can be performed on any object using these endpoints given that a valid object type ID and correctly structured data is provided. However, if the data for your API request is not supplied as expected for that object type, your request will fail.

    If you are not sure what the correct parameters are to send with your request, you can use the objects/meta endpoint to retrieve information about object fields before proceeding.

    Custom Objects

    Custom objects created in Ontraport accounts will automatically have accessible endpoints for GET, PUT, POST, and DELETE requests. Fields in custom objects can be modified through the /fieldeditor endpoint. However, all custom objects are created with the following default fields that cannot be deleted or edited.

    Attributes Type Description
    id integer The custom object's ID.
    unique_id integer System field. Can't be updated through the API. Identifies an object in the database. Not case-sensitive.
    owner integer The ID of the user who controls the custom object. This field must contain a value for a custom object to be saved properly.
    date timestamp The date the custom object was added, measured in seconds from the Unix Epoch.
    dla integer Date of the custom object's last activity. In this documentation, activity means that the custom object interacted with a form, website, or email link.
    dlm timestamp The date the custom object was last modified, measured in seconds from the Unix Epoch.
    system_source integer System field. Can't be updated through the API. Identifies the source from which the custom object was added to the database.
    source_location string System field. Can't be updated through the API. Identifies the specific location from which the custom object was added to the database.
    import_id integer System field. Can't be updated through the API. The ID of the import batch the custom object was imported with, if any.
    ip_addy string Deprecated. The custom object's IP address. This is an old version of ip_addy_display and is not used anymore.
    ip_addy_display string The custom object's IP address.
    contact_cat string Deprecated. The tags a custom object is subscribed to. Each tag has an ID, and in this field the tags are appended together with the delimiter */*. A contact_cat entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Tags are now related to custom objects in a separate tag subscriber object.
    bulk_mail integer A flag that indicates a custom object's bulk email status. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    You can only set the value to 0 through the API. You cannot manually opt-in a custom object who has opted to receive only transactional mail.
    bulk_sms integer A flag that indicates whether or not a custom object is opted in to receive bulk texts. Values are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    You can only set the value to 0 through the API. You cannot manually opt-in a custom object who has opted out.

    bindex updateSequence | string | Deprecated. The sequences a custom object is subscribed to. Each sequence has an ID, and in this field the sequences are appended together with the delimiter */*. An updateSequence entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Sequences are now related to custom objects in a separate sequence subscribers object. If you want to subscribe a custom object to a sequence please see the /objects/subscribe endpoint. updateCampaign | string | Deprecated. The campaigns a custom object is subscribed to. Each campaign has an ID, and in this field the campaigns are appended together with the delimiter */*. This field will appear in responses, but should not be updated. If you want to subscribe a custom object to a campaign please see the /objects/subscribe endpoint. Note : "campaign" throughout this doc is called "automation" throughout the Ontraport app.

    Create an object

    curl -X POST -d '{
      "objectID": 0,
      "firstname": "Mary",
      "lastname": "Smith",
      "email": "msmith@ontraport.com"
    }' 'https://api.ontraport.com/1/objects' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "firstname" => "Mary",
        "lastname"  => "Smith",
        "email"     => "msmith@ontraport.com"
    );
    $response = $client->object()->create($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "firstname": "Mary",
        "lastname": "Smith",
        "email": "msmith@ontraport.com",
        "id": "7",
        "owner": "1",
        "address": null,
        "city": null,
        "state": null,
        "zip": null,
        "birthday": null,
        "date": "1492557339",
        "cell_phone": null,
        "home_phone": null,
        "sms_number": null,
        "dla": "1492557339",
        "contact_cat": "",
        "bulk_mail": "1",
        "bulk_sms": "0",
        "office_phone": null,
        "fax": null,
        "dlm": "1492557339",
        "company": null,
        "address2": null,
        "title": null,
        "website": null,
        "country": null,
        "system_source": "3",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "ip_addy_display": null,
        "visits": "0",
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_birthday": "0",
        "fb_gender": null,
        "fb_likes": null,
        "fb_groups": null,
        "fb_website": null,
        "fb_hometown": null,
        "fb_location": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "last_inbound_sms": null,
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "updateCampaign": "",
        "grade": "0.00"
      },
      "account_id": "12345"
    }
    

    This endpoint will add a new object to your database. It can be used for any object type as long as the correct parameters are supplied. This endpoint allows duplication; if you want to avoid duplicates you should merge instead.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/objects

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a JSON-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.

    *All other parameters depend upon the object.

    Note when using custom fields of the list selection type as a parameter, it must have the option's id wrapped with the delimiter */*. If a list selection field has "field" => "f1500" with options mapped as follows: "1" => "one", "2" => "two". An entry containing multiple options looks like this: "f1500": "*/*1*/*2*/*". You can obtain information regarding your custom fields with the GET /objects/meta endpoint.

    Create or merge an object

    curl -X POST -d 'objectID=0&firstname=Marie&email=msmith@ontraport.com' 'https://api.ontraport.com/1/objects/saveorupdate' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "firstname" => "Marie",
        "email"     => "msmith@ontraport.com" // The unique field for the contact object
    );
    $response = $client->object()->saveOrUpdate($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "attrs": {
          "firstname": "Marie",
          "dlm": "1500506335",
          "id": "7"
        }
      },
      "account_id": "12345"
    }
    

    Looks for an existing object with a matching unique field and merges supplied data with existing data. If no unique field is supplied or if no existing object has a matching unique field, a new object will be created. While merging on the unique_id field is supported for ORM objects, merging on the id field is not, and may cause unintended consequences. If you would like to update an object based on its ID, you should use the update endpoint.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/objects/saveorupdate

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    ignore_blanks boolean Whether or not blank strings should be ignored upon update. Defaults to false: blank strings passed to this endpoint will overwrite existing value. This option will not ignore 0's or boolean false.
    unique_id string A unique identifier for the object (only ORM objects have a unique_id field). This field is system generated and can't be updated. If a unique_id is sent that matches an object in the account, that object's data will be updated. This field will take precedence over other unique fields.

    *All other parameters depend upon the object.

    Create fields and sections in an object record

    curl -X POST -d '{
    "objectID": 0,
    "name": "Contact Information",
    "fields": [
      [
        {
          "alias": "My New Field",
          "type": "text",
          "required": 0,
          "unique": 0
        }
      ],
      [],
      [
        {
          "alias": "My New Dropdown",
          "type": "drop",
          "options": {
            "add": [
              "first", "second", "third"
            ]
          }
        }
      ]
    ]
    }' 'https://api.ontraport.com/1/objects/fieldeditor' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    use OntraportAPI\Models\FieldEditor\ObjectField;
    use OntraportAPI\Models\FieldEditor\ObjectSection;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    $myField = new ObjectField("My New Field", ObjectField::TYPE_TEXT);
    $myDropDown = new ObjectField("My New Dropdown", ObjectField::TYPE_DROP);
    $myDropDown->addDropOptions(array("first", "second", "third"));
    
    $mySection = new ObjectSection("Contact Information", array($myField, $myDropDown));
    
    $requestParams = $mySection->toRequestParams();
    $requestParams["objectID"] = ObjectType::CONTACT;
    $response = $client->object()->createFields($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "success": [
          {
            "f1558": "My New Field"
          },
          {
            "f1559": "My New Dropdown"
          }
        ],
        "error": []
      },
      "account_id": "12345"
    }
    

    Create new fields and sections in an object record. If the section name doesn't exist, a new one will be created with that name.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/objects/fieldeditor

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    name string The name of the Section. Required.
    fields array An array of columns containing fields containing arrays of field objects. Required.
    Example of how these are nested: [[{field1}],[{field2}],[{field3}]]

    Field

    This field object

    Parameter Type Description
    alias string The name of the field. Required.
    type string The field type. Required. Can be one of the following:
    check
    country
    fulldate
    list
    longtext
    numeric
    price
    phone
    state
    drop
    text
    email
    sms
    address
    required integer If this field should be required. Default 0.
    unique integer If this field should be unique. Default 0.
    options object Extra options for certain field types.
    If the field is a drop or list type, specify if you want to add the values and provide an array of names:
    "add":["first", "second", "third"]

    Retrieve a single object

    curl -X GET 'https://api.ontraport.com/1/object?objectID=14&id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID" => ObjectType::TAG, // Object type ID: 14
        "id"       => 1
    );
    $response = $client->object()->retrieveSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "tag_id": "1",
        "tag_name": "Contact Tags",
        "group_id": "0",
        "object_type_id": "0"
      },
      "account_id": "12345"
    }
    

    Retrieves all the information for an existing object of the specified object type.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/object

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    id integer The ID of the specific object. Required.

    Retrieve multiple objects

    curl -X GET 'https://api.ontraport.com/1/objects?objectID=0&sort=lastname&sortDir=desc' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"   => ObjectType::CONTACT, // Object type ID: 0
        "sort"       => "lastname",
        "sortDir"    => "desc",
        "listFields" => "id,firstname,lastname,email"
    );
    $response = $client->object()->retrieveMultiple($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": [
        {
          "id": "1",
          "firstname": "Mary",
          "lastname": "Smith",
          "email": "msmith@ontraport.com",
          "owner": "1"
        },
        {
          "id": "2",
          "firstname": "Fred",
          "lastname": "Brown",
          "email": "fbrown@ontraport.com",
          "owner": "1"
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a collection of objects based on a set of parameters.

    You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/objects

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    ids string An integer array as a comma-delimited list of the IDs of the objects to retrieve. Entering a value of 0 will result in all objects of specified type being selected.
    start integer The offset to start your search from.
    range integer The number of objects you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which objects to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to other object fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve objects having a tag

    curl -X GET 'https://api.ontraport.com/1/objects/tag?objectID=0&tag_id=1&listFields=id%2Cowner%2Cfirstname%2Clastname%2Cemail' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "objectID"     => ObjectType::CONTACT, // Object type ID: 0
        "tag_id"       => 2,
        "listFields" => "id,firstname,lastname,email"
    );
    $response = $client->object()->retrieveAllWithTag($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": [
        {
          "id": "3",
          "owner": "1",
          "firstname": "John",
          "lastname": "Doe",
          "email": "john@ontraport.com"
        },
        {
          "id": "4",
          "owner": "1",
          "firstname": "Jane",
          "lastname": "Doe",
          "email": "jane@ontraport.com"
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a collection of objects having a specified tag.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/objects/tag

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    tag_id integer The ID of the tag you would like to filter your objects by. Either tag_id or tag_name is required. If both are provided, tag_id will be prioritized.
    tag_name string The name of the tag you would like to filter your objects by. Either tag_id or tag_name is required. If both are provided, tag_name will be ignored.
    count boolean Indicates whether to retrieve a count of the collection instead of the collection itself.
    start integer The offset to start your search from.
    range integer The number of objects you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which objects to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to other object fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve an object ID by email

    curl -X GET 'https://api.ontraport.com/1/object/getByEmail?objectID=0&email=tester%40ontraport.com&all=0' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID" => ObjectType::CONTACT, // Object type ID: 0
        "email"    => "tester@ontraport.com",
        "all"      => 0
    );
    $response = $client->object()->retrieveIdByEmail($requestParams);
    

    Example Response: (retrieving single ID)

    {
      "code": 0,
      "data": {
        "id": "6"
      },
      "account_id": "12345"
    }
    

    Example Response: (retrieving array of IDs)

    {
      "code": 0,
      "data": {
        "ids": [
          "6",
          "12"
        ]
      },
      "account_id": "12345"
    }
    

    Retrieves the IDs of contact objects or custom objects by their email fields. You can retrieve an array of all the IDs of objects with matching emails, or you can retrieve the first matching ID.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/object/getByEmail

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    email string The email of the object you would like to retrieve. Required.
    all integer A binary integer flag indicating whether you would like to retrieve an array of all IDs for objects with a matching email. The default value of 0 indicates that you just want the first matching ID. A value of 1 indicates that you would like an array of all matching IDs.

    Retrieve object meta

    curl -X GET 'https://api.ontraport.com/1/objects/meta?format=byId&objectID=7' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID" => ObjectType::MESSAGE, // Object type ID: 7
        "format"   => "byId"
    );
    $response = $client->object()->retrieveMeta($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "7": {
          "name": "Message",
          "fields": {
            "alias": {
              "alias": "Name",
              "type": "text",
              "required": "0",
              "unique": "0",
              "editable": "1",
              "deletable": "0"
            },
            "name": {
              "alias": "Name",
              "type": "mergefield",
              "required": "0",
              "unique": "0",
              "editable": 0,
              "deletable": "1"
            },
            "subject": {
              "alias": "Subject",
              "type": "text",
              "required": "0",
              "unique": "0",
              "editable": 1,
              "deletable": "1"
            },
            "spam_score": {
              "alias": "Spam Score",
              "type": "",
              "required": "0",
              "unique": "0",
              "editable": null,
              "deletable": "1"
            },
            "type": {
              "alias": "Type",
              "type": "drop",
              "required": "0",
              "unique": "0",
              "editable": 1,
              "deletable": "1",
              "options": {
                "e-mail": "Email",
                "e-mail transactional": "Email (Transactional)",
                "Task": "Task",
                "sms": "SMS",
                "Postcard": "Postcard",
                "[\"e-mail\",\"Template\"]": "Email/ONTRAmail",
                "Template": "ONTRAmail",
                "template transactional": "ONTRAmail (Transactional)"
              }
            },
            "mcsent": {
              "alias": "Sent",
              "type": "numeric",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcopened": {
              "alias": "Opened",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcclicked": {
              "alias": "Clicked",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcabuse": {
              "alias": "Complaints",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcunsub": {
              "alias": "Opt Outs",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "date": {
              "alias": "Date Created",
              "type": "timestamp",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcnotopened": {
              "alias": "Not Opened",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "mcnotclicked": {
              "alias": "Not Clicked",
              "type": "percentage",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "1"
            },
            "dlm": {
              "alias": "Date Modified",
              "type": "timestamp",
              "required": "0",
              "unique": "0",
              "editable": "0",
              "deletable": "0"
            }
          }
        }
      },
      "account_id": "12345"
    }
    

    Retrieves the field meta data for the specified object.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/objects/meta

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. If none is supplied, meta for all objects will be retrieved.
    format string Indicates whether the list should be indexed by object name or object type ID. Possible values are byId and byName (default).

    Retrieve object collection info

    curl -X GET 'https://api.ontraport.com/1/objects/getInfo?objectID=0&search=Mary' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "search"    => "Mary"
    );
    $response = $client->object()->retrieveCollectionInfo($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "listFields": [
          "fn",
          "email",
          "office_phone",
          "date",
          "grade",
          "dla",
          "contact_id"
        ],
        "listFieldSettings": [],
        "count": "2"
      },
      "account_id": "12345"
    }
    

    Retrieves information about a collection of objects, such as the number of objects that match the given criteria.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/objects/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    condition string A JSON encoded string to more specifically set criteria for which objects you wish to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not notes should be searched for the specified string in addition to other object fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Retrieve fields and sections in an object record

    curl -X GET \
        'https://api.ontraport.com/1/objects/fieldeditor?objectID=0&section=Contact%20Information' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    // Get all sections and fields
    $response = $client->object()->retrieveFields(array(
        "objectID" => 0
    ));
    // Get the fields in a particular section
    $response = $client->object()->retrieveFields(array(
        "objectID" => 0,
        "section" => "Contact Information"
    ));
    // Get information for a single field
    $response = $client->object()->retrieveFields(array(
        "objectID" => 0,
        "field" => "firstname"
    ));
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": 1,
        "name": "Contact Information",
        "description": "",
        "fields": [
          [
            {},
            {
              "id": 1,
              "alias": "First Name",
              "field": "firstname",
              "type": "text",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "options": null
            },
            {
              "id": 2,
              "alias": "Last Name",
              "field": "lastname",
              "type": "text",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "options": null
            },
            {
              "id": 3,
              "alias": "Email",
              "field": "email",
              "type": "email",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "options": null
            },
            {},{}
          ],
          [{},{}],
          [{},{}]
        ]
      },
      "account_id": "12345"
    }
    

    Retrieve information about the fields and sections an object has. If a section name is passed, only the fields in that section will be returned. If a field name is passed, only that field information will be returned. By default, this endpoint returns all sections and fields for a specified object.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/objects/fieldeditor

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    section string The name of the Section.
    field array The name of the field e.g. f1234

    Update an object's data

    curl -X PUT -d '{
       "objectID": 0,
       "id": 7,
       "lastname": "Smyth"
     }' 'https://api.ontraport.com/1/objects' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "id"        => 7,
        "lastname"  => "Smyth"
    );
    $response = $client->object()->update($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "attrs": {
          "lastname": "Smyth",
          "dlm": "1500506494",
          "id": "7"
        }
      },
      "account_id": "12345"
    }
    

    Updates an existing object with given data. The object type ID and ID of the object to update are required. The other fields should only be used if you want to change the existing value.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/objects

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a JSON-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    id integer The ID of the object. For ORM objects, either id or unique_id is required. For non-ORM objects, id is required.
    unique_id string In ORM objects only. A unique identifier for the object. This field is system generated and can't be updated. If the unique_id sent matches an object in the account, that object's data will be updated. Either id or unique_id are required. If both are sent, unique_id will be ignored.

    *All other parameters depend upon the object.

    Update fields and sections in an object record

    curl -X PUT -d '{
    "objectID": 0,
    "name": "Contact Information",
    "description": "Fields for contacts",
    "fields": [
      [
        {
          "field": "f1558",
          "alias": "Changed New Field",
          "type": "longtext"
        }
      ]
    ]
    }' 'https://api.ontraport.com/1/objects/fieldeditor' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    use OntraportAPI\Models\FieldEditor\ObjectField;
    use OntraportAPI\Models\FieldEditor\ObjectSection;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    $myField = new ObjectField("Changed New Field", ObjectField::TYPE_LONGTEXT);
    $mySection = new ObjectSection("Contact Information", array($myField));
    
    $requestParams = $mySection->toRequestParams();
    $requestParams["objectID"] = ObjectType::CONTACT;
    $response = $client->object()->updateFields($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "success": [
          {
            "f1558": "Changed New Field"
          }
        ]
      },
      "account_id": "12345"
    }
    

    Update fields and sections in an object record. The section MUST exist in order to update it. Any fields that do not already exist will be created. Fields can be matched either by their alias (displayed name), or by the actual name of the field e.g. f1234

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/objects/fieldeditor

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    name string The name of the Section.
    description string A description for the new Section.
    fields array An array of columns containing fields containing arrays of field objects. Required.
    Example of how these are nested: [[{field1}],[{field2}],[{field3}]]

    Field

    This field object

    Parameter Type Description
    field string The name of the field. Required unless alias is sent.
    alias string The display name of the field.
    If sent along with field, the alias will be renamed to what is provided.
    type string The field type. This is only used for converting text to longtext.
    options object Extra options for certain for certain field types.
    If the field is a drop or list type, specify if you want to remove or replace the values and providing an array of names:
    "remove":["first", "second", "third"]

    Delete a single object

    curl -X DELETE 'https://api.ontraport.com/1/object?objectID=0&id=4' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "id"        => 4
    );
    $response = $client->object()->deleteSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "account_id": "12345"
    }
    

    Deletes an existing object of the specified object type.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/object

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID to delete. Required.
    id integer The ID of the specific object to delete. Required.

    Delete multiple objects

    curl -X DELETE 'https://api.ontraport.com/1/objects?objectID=14&ids=1%2C2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::TAG, // Object type ID: 14
        "ids"       => "1,2"
    );
    $response = $client->object()->deleteMultiple($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "Deleted",
      "account_id": "12345"
    }
    

    This endpoint deletes a collection of objects. Use caution with this endpoint.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    ids string An integer array as a comma-delimited list of the IDs of objects to delete. Entering a value of 0 will result in all objects of specified type being selected.
    start integer The offset to start your search from.
    range integer The number of objects you want to delete. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to other object fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Delete fields and sections in an object

    curl -X DELETE -d 'objectID=0&field=f1234'\
        'https://api.ontraport.com/1/objects/fieldeditor' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678' \
        --header 'Content-Type: application/x-www-form-urlencoded'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    $response = $client->object()->deleteFields(array(
        "objectID" => 0,
        "field" => "f1234"
    ));
    

    Example Response:

    {
      "code": 0,
      "data": "Deleted",
      "account_id": "50"
    }
    

    Deletes a field, or section in an object record. If attempting to delete a section, the section MUST be empty.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects/fieldeditor

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    section string The name of the Section.
    field array The name of the field e.g f1234

    Add an object to a sequence

    curl -X PUT -d 'objectID=0&add_list=1&ids=6' 'https://api.ontraport.com/1/objects/sequence' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "ids"       => 6,
        "add_list"  => 1
    );
    $response = $client->object()->addToSequence($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The subscription is now being processed.",
      "account_id": "12345"
    }
    

    Adds one or more objects to one or more sequences.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/objects/sequence

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    add_list string An array as a comma-delimited list of the IDs of the sequence(s) to which objects should be added. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to be added to sequences. Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Tag an object

    curl -X PUT -d 'objectID=0&add_list=2&ids=6' 'https://api.ontraport.com/1/objects/tag' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID" => ObjectType::CONTACT, // Object type ID: 0
        "ids"      => 6,
        "add_list" => 2
    );
    $response = $client->object()->addTag($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The tag is now being processed.",
      "account_id": "12345"
    }
    

    Adds one or more tags to one or more objects.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/objects/tag

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    add_list string An array as a comma-delimited list of the IDs of the tag(s) which should be added to objects. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to be tagged. Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Tag an object by name

    curl -X PUT -d '{
      "objectID": 0,
      "ids": [
        2
      ],
      "add_names": [
        "Blue","Yellow"
      ]
    }' 'https://api.ontraport.com/1/objects/tagByName' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"  => ObjectType::CONTACT, // Object type ID: 0
        "ids"       => array(7),
        "add_names" => array(
            "Blue",
            "Yellow"
        )
    );
    $response = $client->object()->addTagByName($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The tag is now being processed.",
      "account_id": "12345"
    }
    

    Adds one or more tags to one or more objects by the tag name. This endpoint will create the tag if it doesn't exist.

    Request Endpoint

    PUT https://api.ontraport.com/1/objects/tagByName

    Required Headers

    Api-Key: {api_key} Api-Appid: {app_id} Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a JSON-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    add_names string An array of the names of the tag(s) which should be added to objects. Required.
    ids string An array of the IDs of the objects to be tagged. Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Subscribe an object to a campaign or sequence

    Note:

    "campaign" throughout this doc is called "automation" throughout the Ontraport app.

    curl -X PUT -d 'objectID=0&add_list=3&ids=2&sub_type=Campaign' 'https://api.ontraport.com/1/objects/subscribe' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID" => ObjectType::CONTACT, // Object type ID: 0
        "ids"      => 2,
        "add_list" => 3,
        "sub_type" => "Campaign"
    );
    $response = $client->object()->subscribe($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The subscription is now being processed.",
      "account_id": "12345"
    }
    

    Subscribes one or more objects to one or more campaigns or sequences.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/objects/subscribe

    Required Headers

    Api-Key: {api_key} Api-Appid: {app_id} Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    add_list string An array as a comma-delimited list of the IDs of the campaign(s) or sequence(s) the objects should be subscribed to. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to be subscribed. Required.
    sub_type string Either Campaign or Sequence. If no value is supplied, Campaign will be used.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Remove an object from a sequence

    curl -X DELETE -d 'objectID=0&remove_list=1&ids=6' 'https://api.ontraport.com/1/objects/sequence' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"     => ObjectType::CONTACT, // Object type ID: 0
        "ids"          => 6,
        "remove_list"  => 1
    );
    $response = $client->object()->removeFromSequence($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The subscription is now being processed.",
      "account_id": "12345"
    }
    

    This endpoint removes one or more objects from one or more sequences.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects/sequence

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    remove_list string An array as a comma-delimited list of the IDs of the sequences(s) from which to remove objects. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to be removed from sequence(s). Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Remove a tag from an object

    curl -X DELETE -d 'objectID=0&remove_list=2&ids=6' 'https://api.ontraport.com/1/objects/tag' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"     => ObjectType::CONTACT, // Object type ID: 0
        "ids"          => 6,
        "remove_list"  => 2
    );
    $response = $client->object()->removeTag($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The tag is now being processed.",
      "account_id": "12345"
    }
    

    This endpoint removes one or more tags from one or more objects.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects/tag

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    remove_list string An array as a comma-delimited list of the IDs of the tag(s) to be removed from objects. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to remove from tag(s). Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Remove a tag from an object by name

    curl -X DELETE -d '{
      "objectID": 0,
      "ids": [
        2
      ],
      "remove_names": [
        "Blue","Yellow"
      ]
    }' 'https://api.ontraport.com/1/objects/tagByName' \
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"      => ObjectType::CONTACT, // Object type ID: 0
        "ids"           => array(7),
        "remove_names"  => array(
            "Blue",
            "Yellow"
        )
    );
    $response = $client->object()->removeTagByName($requestParams);
    

    Example Response:

    {
      "data": "The tag is now being processed.",
      "account_id": "12345"
    }
    

    This endpoint removes one or more tags from one or more objects by the tag name.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects/tagByName

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/json

    Request Parameters

    Parameters should be sent in the request body as a JSON-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    remove_names string An array of the names of the tag(s) to be removed from objects. Nonexistent tag names will be ignored and will not cause a failure. Required.
    ids string An array of the IDs of the objects to remove from tag(s). Required.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Unsubscribe an object from a campaign or sequence

    Note:

    "campaign" throughout this doc is called "automation" throughout the Ontraport app.

    curl -X DELETE -d 'objectID=0&remove_list=3&ids=2&sub_type=Campaign' 'https://api.ontraport.com/1/objects/subscribe' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"     => ObjectType::CONTACT, // Object type ID: 0
        "ids"          => 2,
        "remove_list"  => 3,
        "sub_type"     => "Campaign"
    );
    $response = $client->object()->unsubscribe($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "The subscription is now being processed.",
      "account_id": "12345"
    }
    

    This endpoint unsubscribes one or more objects from one or more campaigns or sequences.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/objects/subscribe

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Required.
    remove_list string An array as a comma-delimited list of the IDs of the campaign(s) or sequence(s) to unsubscribe objects from. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to unsubscribe. Required.
    sub_type string Either Campaign or Sequence. If no value is provided, Campaign will be used.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Pause rules and sequences for an object

    curl -X POST -d 'objectID=5&ids=1' 'https://api.ontraport.com/1/objects/pause' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"     => ObjectType::SEQUENCE, // Object type ID: 5
        "ids"          => 1
    );
    $response = $client->object()->pause($requestParams);
    

    Example Response:

    {
      "code": 0,
      "account_id": "12345"
    }
    

    This endpoint pauses rules, sequences, and sequence subscribers.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/objects/pause

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID. Possible object types are rules, sequences, and sequence subscribers. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to be paused. Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Unpause rule and sequences for an object

    curl -X POST -d 'objectID=5&ids=1' 'https://api.ontraport.com/1/objects/unpause' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    use OntraportAPI\ObjectType;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "objectID"     => ObjectType::SEQUENCE, // Object type ID: 5
        "ids"          => 1
    );
    $response = $client->object()->unpause($requestParams);
    

    Example Response:

    {
      "code": 0,
      "account_id": "12345"
    }
    

    Unpauses rules, sequences, and sequence subscribers.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/objects/unpause

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    objectID integer The object type ID to be unpaused. Possible object types are rules, sequences, and sequence subscribers. Required.
    ids string An array as a comma-delimited list of the IDs of the objects to unpause. Required.
    start integer The offset to start your search from.
    range integer The number of objects to include in your query. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which objects should be affected. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your objects for.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Custom objects

    # Retrieving a custom object using the generic objects endpoints
    curl -X GET 'https://api.ontraport.com/1/object?objectID=10003&id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    # Retrieving a custom object using the specific endpoint for an example object
    curl -X GET 'https://api.ontraport.com/1/Company?&id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    // Retrieving a sample custom object with object type ID 10003
    use OntraportAPI\Ontraport;
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
                "id" => 1
    );
    $response = $client->custom(10003)->retrieveSingle($requestParams);
    

    If you have custom objects you have created in the app, these can also be accessed through the API. All custom object attributes depend upon the object you have created.

    Like other object types, you can use the objects API with the object type ID to access CRUD functionality for custom objects. You also can use the plural and singular endpoints which are dynamically created for your account for each custom object type in your database. For example, if you created a "Company" object you would have the following two endpoints:

    https://api.ontraport.com/1/Company

    and

    https://api.ontraport.com/1/Companies

    A listing of the endpoints available to you can be viewed in our live documentation.

    Object type IDs for custom objects are always greater than 10000. You can spot these objects if you make a call to retrieve meta for all objects and look for IDs meeting that criteria.

    Responses for these calls will follow the same model as responses for other resources, but the content of the data array will vary.

    Calendar Events - COMING SOON!

    Object Type ID: 160

    A calendar event object can be created manually or added to your account via a google calendar sync. Each recurring calendar event has a single entry which represents all possible entries, unless edits have been made to a single occurrence or a group of occurences that differ from the parent event.

    Through the calendar events API, you can retrieve a single calendar event entry or a collection of calendar events. You can add and remove guests from events and change their RSVP status. You can create events, update events, and delete events.

    Throughout this documentation, you will see the term "composite ID" used frequently, both with respect to calendar event instances, and with respect to calendar event guests. Calendar events can be recurring, and they can reoccur infinitely. Each instance of the series has the same base ID, and a different recurrence timestamp. Therefore, an event composite ID is composed of the base ID, an underscore, and the recurrence timestamp. An event instance with a base ID of 4 and a recurrence timestamp of 1625713200 would have a composite ID of 4_1625713200. When events are not recurring, we can assume their recurrence timestamp is 0.

    Calendar events can have guests, and these guests can be one of two Ontraport object types: contacts and users. Guests will have a unique identifier, but most of the time we will refer to them by a composite ID as well. The guest composite ID is composed of the object type ID of the guest, an underscore, and the unique identifier of the contact or user tied to that guest. For example, contact ID 4 would have a guest composite ID of 0_4.

    The calendar event object

    {
        "id": "2_1625601600",
        "recurrence_timestamp": "0",
        "location": "2040 Alameda Padre Serra, Santa Barbara, CA, USA",
        "title": "Team meeting",
        "start_time": 1625601600,
        "end_time": 1625605200,
        "description": "Ontraport team meeting.",
        "duration": "3600",
        "status": "0",
        "repeat_every_count": "1",
        "repeat_every_frequency": "2",
        "repeat_monthly_modifier": "",
        "repeat_on_days": "Tuesday",
        "repeat_end_type": "0",
        "repeat_end_date": "0",
        "repeat_end_modifier": "",
        "computed_end_date": "0",
        "is_recurring": "1",
        "is_repeat_custom": "0",
        "is_all_day": "0",
        "staff_id": "1",
        "type_id": "1",
        "event_template": "0",
        "calendar_id": "0",
        "repeat_rule_string_rfc5545": "FREQ=WEEKLY;BYDAY=TU",
        "visibility": "1",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"all\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"start_time\",\"notification_action_email\":\"2\"}]}",
        "remote_id": "",
        "remote_parent_id": "",
        "dla": "1624572693",
        "dlm": "1624572693",
        "remote_start_timezone": "",
        "remote_end_timezone": "",
        "repeat": "weekly",
        "calendar_read_only": 0,
        "is_remote": 0,
        "calendar_access_role": "owner"
    }
    

    Calendar event attributes

    Attribute Type Description
    id string The calendar event's composite ID.
    actual_id integer The base ID for the entire event or recurrence series. All events belonging to the same series have the same base ID.
    recurrence_timestamp timestamp For exceptions made to recurring event series, the timestamp of the date of the original start time of that recurrence. This remains the same even if the actual start time is modified.
    location string The event location.
    title string The event title.
    start_time timestamp The UNIX timestamp of the event's start time. If the event is recurring, this represents the start time of the first event in the series.
    end_time timestamp The UNIX timestamp of the event's end time. If the event is recurring, this represents the end time of the first event in the series.
    description string A description of the event.
    duration integer The length of the event, in seconds.
    repeat_every_count integer For recurring events, given a frequency like weekly, the interval the event should repeat. For example, 1 for every week, 3 for every third week.
    repeat_every_frequency integer How often a recurring event should repeat. Integer codes are mapped as follows:
    0 => Yearly
    1 => Monthly
    2 => Weekly
    3 => Daily. Ontraport does not support finer granularity than daily.
    repeat_monthly_modifier integer For monthly recurring events, an indicator of what type of monthly repeat. Repeats can be based on the ordinal day of the month (e.g. the 5th of every month) or a specific day of the week (e.g. the 3rd Tuesday). Integer codes are mapped as follows:
    0 => Repeat on a specific ordinal day of the month
    1 => Repeat on a specific day of the week
    repeat_on_days string/integer For a recurring event, either a comma-separated list of the the day(s) of the week (for weekly recurring events or monthly recurring events on a particular day of the week) or the day number of the month (for monthly recurring events on a particular day of the month).
    repeat_end_type integer The indicator for when a recurring event should end. Integer codes are mapped as follows:
    0 => Never
    1 => After a number of recurrences
    2 => On a specific date.
    repeat_end_date timestamp If the repeat_end_type is on a specific date, the UNIX timestamp for the date the recurring event should end.
    repeat_end_modifier integer If the repeat_end_type is a number of recurrences, the number of recurrences it should continue.
    computed_end_date timestamp Available for some recurrence cases, the computed end date for a recurring series.
    is_recurring integer A binary integer flag indicating whether or not the event is recurring.
    is_repeat_custom integer A binary integer flag indicating whether or not this event contains custom recurrence settings.
    is_all_day integer A binary integer flag indicating whether or not this event lasts all day.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    event_template integer The template ID for this event.
    calendar_id integer The calendar ID (synced or local) for this event.
    repeat_rule_string_rfc5545 string The RFC standard recurrence rule for this event. Find documentation on RFC standards here.
    visibility integer The event visibility. Integer codes are mapped as follows:
    0 => Root event
    (When a recurring event has instances which have been modified, the original recurrence settings are retained for future calculations in this record.)
    1 => Visible
    2 => Deleted
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.
    remote_id string For events imported from Google calendar, Google's ID for the event.
    remote_parent_id string For events imported from Google calendar, Google's ID for this recurring event series.
    dla timestamp The date this event was created.
    dlm timestamp The date this event was last modified.
    remote_start_timezone string For events imported from Google calendar, the timezone of the start time.
    remote_end_timezone integer For events imported from Google calendar, the timezone of the end time.
    calendar_read_only integer A binary integer flag indicating whether or not this event is read only. An event is read-only if the linked calendar staff_id differs from the event staff_id, or if the calendar_access_role is not writer or owner. This setting is not editable.
    is_remote integer A binary integer flag indicating whether or not this event originated from a remote (synced) calendar.
    owner string An ineditable string representation of the event owner's name. Note that this is generated from the staff_id and is a separate field.
    is_multi_day integer A binary integer flag indicating whether or not this event was created to span multiple days. This flag is set internally and not editable.
    calendar_access_role string For events imported from Google calendar, whether we have write or owner permissions on the event.
    guest_status integer The guest RSVP status. Options are mapped as follows:
    0 => Unconfirmed
    1 => No
    2 => Maybe
    3 => Yes. This field can only be included when retrieving guests in sucollection mode so that events are limited to one guest.

    Create a calendar event object

    curl -X POST -d '{ 
       "title": "Repeat Every Day for 5 Days", 
       "start_time": 1625248800, 
       "duration": 1800, 
       "location": "My House", 
       "description": "Recurring Daily for 5 Days", 
       "repeat_every_frequency": 3, 
       "repeat_end_type": 1, 
       "repeat_end_modifier": 5, 
       "is_recurring": 1,  
       "staff_id": 1, 
       "guestInfo": {  
         "guestList": [ 
           { 
             "id": "0_1", 
             "fieldUpdates": { 
               "status": 2 
             } 
           } 
         ] 
       } 
     }' 'http://api.ontraport.com/1/CalendarEvents'
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "objectID": 160,
        "title": "Repeat Every Day for 5 Days",
        "start_time": 1625248800,
        "duration": 1800,
        "location": "My House",
        "description": "Recurring Daily for 5 Days",
        "repeat_every_frequency": 3,
        "repeat_end_type": 1,
        "repeat_end_modifier": 5,
        "is_recurring": 1,
        "staff_id": 1,
        "guestInfo": {
          "guestList": [
            {
              "id": "0_1",
              "fieldUpdates": {
                "status": 2
              }
            }
          ]
        },
        "timezone": "America/Los_Angeles",
        "repeat_on_days": "",
        "repeat_end_date": "",
        "end_time": 1625250600,
        "status": 0,
        "repeat_every_count": 1,
        "is_multi_day": 0,
        "repeat_rule_string_rfc5545": "FREQ=DAILY;COUNT=5",
        "computed_end_date": 1625594400,
        "id": "5_0",
        "calendar_read_only": 0,
        "is_remote": 0,
        "calendar_access_role": "owner"
      },
      "account_id": 12345
    }
    

    Creates a new calendar event.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/CalendarEvents

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    location string The event location.
    title string The event title.
    start_time timestamp The UNIX timestamp of the event's start time. If the event is recurring, this represents the start time of the first event in the series.
    end_time timestamp The UNIX timestamp of the event's end time. If the event is recurring, this represents the end time of the first event in the series.
    description string A description of the event.
    duration integer The length of the event, in seconds.
    repeat_every_count integer For recurring events, given a frequency like weekly, the interval the event should repeat. For example, 1 for every week, 3 for every third week.
    repeat_every_frequency integer How often a recurring event should repeat. Integer codes are mapped as follows:
    0 => Yearly
    1 => Monthly
    2 => Weekly
    3 => Daily. Ontraport does not support finer granularity than daily.
    repeat_monthly_modifier integer For monthly recurring events, an indicator of what type of monthly repeat. Repeats can be based on the ordinal day of the month (e.g. the 5th of every month) or a specific day of the week (e.g. the 3rd Tuesday). Integer codes are mapped as follows:
    0 => Repeat on a specific ordinal day of the month
    1 => Repeat on a specific day of the week
    repeat_on_days string/integer For a recurring event, either a comma-separated list of the the day(s) of the week (for weekly recurring events or monthly recurring events on a particular day of the week) or the day number of the month (for monthly recurring events on a particular day of the month).
    repeat_end_type integer The indicator for when a recurring event should end. Integer codes are mapped as follows:
    0 => Never
    1 => After a number of recurrences
    2 => On a specific date.
    repeat_end_date timestamp If the repeat_end_type is on a specific date, the UNIX timestamp for the date the recurring event should end.
    repeat_end_modifier integer If the repeat_end_type is after a certain number of recurrences, the number of occurrences.
    is_recurring integer A binary integer flag indicating whether or not the event is recurring.
    is_repeat_custom integer A binary integer flag indicating whether or not this event contains custom recurrence settings.
    is_all_day integer A binary integer flag indicating whether or not this event lasts all day.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    event_template integer The template ID for this event.
    calendar_id integer The calendar ID (synced or local) for this event.
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.
    guestInfo array [Guest Info]. An array of information managing guest adds, guest removes, and guest status changes.

    Guest Info

    An array of information managing guest adds, guest removes, and guest status changes. Optionally can be included with calendar event creates and updates.

    Parameter Type Description
    guestList array [Guest List]. An array of guest additions and / or status changes for the calendar event.
    removedList array An array of composite guest IDs to be removed from current guest list.

    Guest List

    An array of information managing guest adds and guest status changes.

    Parameter Type Description
    id integer The composite ID of the guest to add or update.
    fieldUpdates array If updating the guest status, an array containing a status key. Options for status are mapped as follows:
    0 => Unconfirmed
    1 => No
    2 => Maybe
    3 => Yes

    Notifications

    Notifications are an array of data controlling rules that fire based on some calendar event action or relative time. They are sent to the API as a json-encoded string.

    curl -X PUT -d '{  
       "id": "6_1625248800",  
       "title": "Edited Recurring",  
       "guestInfo": {  
         "removedList": ["0_1"]  
       },  
       "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",  
       "edit_scope": 2  
     }' 'http://api.ontraport.com/1/CalendarEvents'
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "6_1625248800",
        "recurrence_timestamp": "0",
        "location": "My House",
        "title": "Edited Recurring",
        "start_time": 1625248800,
        "end_time": 1625250600,
        "description": "Recurring Daily for 5 Days",
        "duration": "1800",
        "status": "0",
        "repeat_every_count": "1",
        "repeat_every_frequency": "3",
        "repeat_monthly_modifier": "",
        "repeat_on_days": "",
        "repeat_end_type": "1",
        "repeat_end_date": "0",
        "repeat_end_modifier": "5",
        "computed_end_date": "1625594400",
        "is_recurring": "1",
        "is_repeat_custom": "0",
        "is_all_day": "0",
        "staff_id": "1",
        "type_id": "0",
        "event_template": "0",
        "calendar_id": "0",
        "repeat_rule_string_rfc5545": "FREQ=DAILY;COUNT=5",
        "visibility": "1",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
        "remote_id": "",
        "remote_parent_id": "",
        "dla": "1625681964",
        "dlm": "1625690463",
        "remote_start_timezone": "",
        "remote_end_timezone": "",
        "repeat": "daily",
        "calendar_read_only": 0,
        "is_remote": 0,
        "calendar_access_role": "owner",
        "objectID": 160,
        "edit_scope": 2,
        "guest_ids": {
          "remove": {
            "0_1": "1"
          },
          "all": []
        },
        "timezone": "America/Los_Angeles",
        "is_multi_day": 0
      },
      "account_id": 1234560
    }
    
    

    Parameters used to control the type of notification:

    Parameter Type Description
    notification_trigger_type string Whether the notifications will be triggered by an action taken in the account, or by a time relative to the event start or end. time for time-based and action for action-based notifications. Required

    Parameters needed for the trigger on time-based notifications:

    Parameter Type Description
    notification_time_count integer The quantity of the time unit you are using for your notifications. For example, if you want to trigger notifications 1 day before an event, this number will be 1. The total time cannot add up to more than one year. Required
    notification_time_interval string The indicator for the time unit the notifications should trigger based on relative to the target. Options are as follows:
    minutes
    hours
    days
    Required.
    notification_time_relative_direction string The indicator for when the notifications should trigger with respect to the target. before or after. Required
    notification_time_relative_target string The event bound you wish to trigger notifications based on. start_time or end_time. Required

    Parameters needed for the trigger on action-based notifications:

    Parameter Type Description
    notification_trigger_action_type string The event triggering the notification for this event. Options are as follows:
    event_update => Trigger a notification when a particular field or any field is updated in the event.
    event_cancel => Trigger a notification when the event is deleted.
    guest_added => Trigger a notification when a guest is added to an event.
    guest_removed => Trigger a notification when a guest is removed from an event.
    Required
    notification_trigger_action_field_type string For event_update triggers only, the field to trigger notifications on for event updates. Defaults to any. Specific fields include: title, start_time, end_time, location, staff_id, description, location.

    Parameters needed for the action on all notifications:

    Parameter Type Description
    notification_send_to string Who this notification will be sent to. Options are as follows:
    all => Send to all guests
    contacts => Send to all guests who are contacts
    owner => Send to the guest who is the owner of the event. This option cannot be used for campaign rules.
    users => Send to all guests who are users. This option cannot be used with campaign rules.
    attending => Send to all guests who have RSVP'd that they are attending this event
    unconfirmed => Send to all guests who have not responded to this event
    this => Send to only the collection of guests an action occurred on. This option can be used only for guest_added and guest_removed rules.
    email => Send to a specific email address.
    sms => Send to a specific SMS number.
    Required
    notification_action_type string What type of notification this is. Options are as follows:
    email => Send an email when this notification is triggered.
    sms => Send an SMS when this notification is triggered.
    campaign => Add the guests who are contacts only to a campaign when this notification is triggered.
    Required
    notification_action_email integer If the notification should send an email, the email ID.
    notification_action_sms integer If the notification should send an sms, the SMS ID.
    notification_action_campaign integer If the notification should add contacts to a campaign, the campaign ID.
    notification_specific_email string If the notification should sent to a specific email, the email it should send to.
    notification_specific_sms string If the notification should sent to a specific SMS number, the SMS number it should send to.
    notification_action_sms_number string If the notification should send an SMS, the SMS number in the account it should send from.

    Retrieve a single calendar event

    curl -X GET 'https://api.ontraport.com/1/CalendarEvent?id=2_1625601600' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    coming soon
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "2_1625601600",
        "recurrence_timestamp": "0",
        "location": "2040 Alameda Padre Serra, Santa Barbara, CA, USA",
        "title": "Team meeting",
        "start_time": 1625601600,
        "end_time": 1625605200,
        "description": "Ontraport team meeting.",
        "duration": "3600",
        "status": "0",
        "repeat_every_count": "1",
        "repeat_every_frequency": "2",
        "repeat_monthly_modifier": "",
        "repeat_on_days": "Tuesday",
        "repeat_end_type": "0",
        "repeat_end_date": "0",
        "repeat_end_modifier": "",
        "computed_end_date": "0",
        "is_recurring": "1",
        "is_repeat_custom": "0",
        "is_all_day": "0",
        "staff_id": "1",
        "type_id": "1",
        "event_template": "0",
        "calendar_id": "0",
        "repeat_rule_string_rfc5545": "FREQ=WEEKLY;BYDAY=TU",
        "visibility": "1",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"all\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"start_time\",\"notification_action_email\":\"2\"}]}",
        "remote_id": "",
        "remote_parent_id": "",
        "dla": "1624572693",
        "dlm": "1624572693",
        "remote_start_timezone": "",
        "remote_end_timezone": "",
        "repeat": "weekly",
        "calendar_read_only": 0,
        "is_remote": 0,
        "calendar_access_role": "owner"
      },
      "account_id": 12345
    }
    

    Retrieves all the information for an existing calendar event.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarEvent

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id string The calendar event's composite ID. Required.

    Retrieve multiple calendar events

    curl -X GET 'http://api.ontraport.com/1/CalendarEvents?start_time=1624474800' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": [
        {
          "id": "1_0",
          "actual_id": "1",
          "staff_id": "1",
          "type_id": "4",
          "title": "Haircut",
          "description": "",
          "location": "",
          "start_time": 1624581000,
          "end_time": 1624582800,
          "duration": "1800",
          "dla": "1624579571",
          "dlm": "1624579571",
          "is_recurring": "0",
          "repeat_every_count": "1",
          "repeat_every_frequency": "",
          "repeat_on_days": "",
          "repeat_end_type": "0",
          "repeat_end_modifier": "",
          "is_repeat_custom": "0",
          "is_all_day": "0",
          "status": "0",
          "repeat_end_date": "0",
          "owner": "joe tester",
          "guest_status": null,
          "guests": null,
          "calendar_id": "0",
          "remote_start_timezone": "",
          "remote_end_timezone": ""
        },
        {
          "id": "2_0",
          "actual_id": "2",
          "staff_id": "1",
          "type_id": "5",
          "title": "Dinner with client",
          "description": "",
          "location": "Dario's Pizza, Bridgeway, Sausalito, CA, USA",
          "start_time": 1624761000,
          "end_time": 1624766400,
          "duration": "5400",
          "dla": "1624579612",
          "dlm": "1624579612",
          "is_recurring": "0",
          "repeat_every_count": "1",
          "repeat_every_frequency": "",
          "repeat_on_days": "",
          "repeat_end_type": "0",
          "repeat_end_modifier": "",
          "is_repeat_custom": "0",
          "is_all_day": "0",
          "status": "0",
          "repeat_end_date": "0",
          "owner": "joe tester",
          "guest_status": null,
          "guests": null,
          "calendar_id": "0",
          "remote_start_timezone": "",
          "remote_end_timezone": ""
        },
        {
          "id": "3_0",
          "actual_id": "3",
          "staff_id": "1",
          "type_id": "5",
          "title": "Disneyland",
          "description": "",
          "location": "Disneyland Park, Disneyland Drive, Anaheim, CA, USA",
          "start_time": 1625099400,
          "end_time": 1625101200,
          "duration": "1800",
          "dla": "1624579645",
          "dlm": "1624579645",
          "is_recurring": "0",
          "repeat_every_count": "1",
          "repeat_every_frequency": "",
          "repeat_on_days": "",
          "repeat_end_type": "0",
          "repeat_end_modifier": "",
          "is_repeat_custom": "0",
          "is_all_day": "0",
          "status": "0",
          "repeat_end_date": "0",
          "owner": "joe tester",
          "guest_status": null,
          "guests": null,
          "calendar_id": "0",
          "remote_start_timezone": "",
          "remote_end_timezone": ""
        }
      ],
      "account_id": 12345
    }
    

    Retrieves a collection of calendar events based on a set of parameters. Each of the different possible modes mimics the way the data is retrieved in the Ontraport app. Pagination works differently for calendar events. Rather than passing in a range value for items desired per page, the range is fixed based on the mode. For the primary mode, events, each page will return 50 events, in addition to all the events on the first and last day of that range. For the subcollection mode, that range is lowered to 25.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarEvents

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    start_time timestamp The timestamp you would like to begin retrieving events from. Calendar event pagination is different from regular event pagination, and is controlled by changing the start time. Required
    search string A string to search your calendar event objects for. Search fields include: title, location, description, start_time, and end_time. Additionally, in subcollection mode, guest_status can be searched.
    group_id integer The group ID of calendar events to retrieve.
    calendarEventOwner string Which staff member or staff members to retrieve events for. Options are as follows:
    all: Retrieve all events regardless of owner.
    me: Retrieve only the events belonging to the owner of your API keys.
    team: Return the events for the owner of your API keys and their subordinates
    You can also pass in the ID of any user on the account to retrieve only the events belonging to them.
    mode string Calendar events can be retrieved in slightly different ways to mimic the behavior of the Ontraport app. Options are as follows:
    events: This is the default option. This mode's pagination is controlled by the start_time parameter, and will return 50 events per page, plus all of the other events on the first and last day of the page. Events spanning multiple days will be represented by an event on each day of the date range.
    subcollection: This option mimics the subcollection in the Ontraport app. This mode's pagination is controlled by start_time and the relative_paginate parameter, and will return 25 events per page, plus all of the other events on the first and last day of the page. Events spanning multiple days will be represented by a single event record. For this mode, the guestsearch parameter must be set.
    bullets: This mode's pagination is controlled by the start_time parameter, and will return for the entire relevant month the day numbers that have existing events. No other event data is returned for this option.
    submenu: This option does not allow for pagination and will return a list of event IDs from the context of today, with all events up to one month in the past and six months in the future. No other filter applies to the submenu.
    recents: Returns the ten most recently edited events.
    relative_paginate string This option can only be used with mode set to subcollection, and is a set of controls that allows skipping to the previous or next page, all the way to the beginning, or all the way to the end of the event collection. Skipping to the end is not supported where infinitely recurring events are present. These options must be used in conjunction with the start_time parameter. Options map as follows:
    -2 => Skip to the beginning
    -1 => Skip to previous page
    1 => Skip to next page
    2 => Skip to the end.
    guestsearch string The composite ID of a guest to search for. This option is necessary when mode is set to subcollection.

    Update a calendar event

    curl -X PUT -d '{  
       "id": "6_1625248800",  
       "title": "Edited Recurring",  
       "guestInfo": {  
         "removedList": ["0_1"]  
       },  
       "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",  
       "edit_scope": 2  
     }' 'http://api.ontraport.com/1/CalendarEvents'
        --header 'Content-Type: application/json' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "6_1625248800",
        "recurrence_timestamp": "0",
        "location": "My House",
        "title": "Edited Recurring",
        "start_time": 1625248800,
        "end_time": 1625250600,
        "description": "Recurring Daily for 5 Days",
        "duration": "1800",
        "status": "0",
        "repeat_every_count": "1",
        "repeat_every_frequency": "3",
        "repeat_monthly_modifier": "",
        "repeat_on_days": "",
        "repeat_end_type": "1",
        "repeat_end_date": "0",
        "repeat_end_modifier": "5",
        "computed_end_date": "1625594400",
        "is_recurring": "1",
        "is_repeat_custom": "0",
        "is_all_day": "0",
        "staff_id": "1",
        "type_id": "0",
        "event_template": "0",
        "calendar_id": "0",
        "repeat_rule_string_rfc5545": "FREQ=DAILY;COUNT=5",
        "visibility": "1",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
        "remote_id": "",
        "remote_parent_id": "",
        "dla": "1625681964",
        "dlm": "1625690463",
        "remote_start_timezone": "",
        "remote_end_timezone": "",
        "repeat": "daily",
        "calendar_read_only": 0,
        "is_remote": 0,
        "calendar_access_role": "owner",
        "objectID": 160,
        "edit_scope": 2,
        "guest_ids": {
          "remove": {
            "0_1": "1"
          },
          "all": []
        },
        "timezone": "America/Los_Angeles",
        "is_multi_day": 0
      },
      "account_id": 1234560
    }
    
    

    Updates an existing calendar event with given data. The composite ID of the calendar event to update is required.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/CalendarEvents

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    id string The composite ID of the event.
    location string The event location.
    title string The event title.
    start_time timestamp The UNIX timestamp of the event's start time. If the event is recurring, this represents the start time of the first event in the series.
    end_time timestamp The UNIX timestamp of the event's end time. If the event is recurring, this represents the end time of the first event in the series.
    description string A description of the event.
    duration integer The length of the event, in seconds.
    repeat_every_count integer For recurring events, given a frequency like weekly, the interval the event should repeat. For example, 1 for every week, 3 for every third week.
    repeat_every_frequency integer How often a recurring event should repeat. Integer codes are mapped as follows:
    0 => Yearly
    1 => Monthly
    2 => Weekly
    3 => Daily. Ontraport does not support finer granularity than daily.
    repeat_monthly_modifier integer For monthly recurring events, an indicator of what type of monthly repeat. Repeats can be based on the ordinal day of the month (e.g. the 5th of every month) or a specific day of the week (e.g. the 3rd Tuesday). Integer codes are mapped as follows:
    0 => Repeat on a specific ordinal day of the month
    1 => Repeat on a specific day of the week
    repeat_on_days string/integer For a recurring event, either a comma-separated list of the the day(s) of the week (for weekly recurring events or monthly recurring events on a particular day of the week) or the day number of the month (for monthly recurring events on a particular day of the month).
    repeat_end_type integer The indicator for when a recurring event should end. Integer codes are mapped as follows:
    0 => Never
    1 => After a number of recurrences
    2 => On a specific date.
    repeat_end_date timestamp If the repeat_end_type is on a specific date, the UNIX timestamp for the date the recurring event should end.
    repeat_end_modifier integer If the repeat_end_type is after a certain number of recurrences, the number of occurrences.
    is_recurring integer A binary integer flag indicating whether or not the event is recurring.
    is_repeat_custom integer A binary integer flag indicating whether or not this event contains custom recurrence settings.
    is_all_day integer A binary integer flag indicating whether or not this event lasts all day.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    event_template integer The template ID for this event.
    calendar_id integer The calendar ID (synced or local) for this event.
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.
    guestInfo array [Guest Info]. An array of information managing guest adds, guest removes, and guest status changes.
    edit_scope integer For recurring events, the scope of the recurrences to be edited. Integer codes are mapped as follows:
    0 => This event
    1 => This and following events
    2 => All events Default is all events.

    Update guest status for calendar event(s)

    curl -X PUT -d 'guest_id=0_1&ids=3_1625358600&status=1' 'http://api.ontraport.com/1/CalendarEvent/updateGuestStatus' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "guest_id": "0_1",
        "event_ids": [
          "3_1625358600"
        ],
        "status": "1"
      },
      "account_id": 12345
    }
    

    Updates the guest status for one or more calendar events. Each event instance must be specified individually for this endpoint. The guest composite ID, a status, and at least one event composite ID are required. If a guest composite ID is passed and that guest is not currently on the event, they will be added with the status indicated.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/CalendarEvents/updateGuestStatus

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    guest_id string The guest composite ID. Required
    ids array An array as a comma-separated list of the event instance composite ids to change the status of the guest for. Required
    status integer The guest attendance status. Integer codes are mapped as follows:
    0 => Unconfirmed
    1 => No
    2 => Maybe
    3 => Yes
    Required

    Remove a guest from calendar event(s)

    curl -X PUT -d 'guest_id=0_1&ids=3_1625445000' 'http://api.ontraport.com/1/CalendarEvent/removeGuest' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "guest_id": "0_1",
        "event_ids": [
          "3_1625445000"
        ]
      },
      "account_id": 12345
    }
    
    

    Removes a guest from one or more calendar event instances. Each event instance must be specified individually for this endpoint. The guest composite ID and at least one event composite ID are required.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/CalendarEvents/removeGuest

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    guest_id string The guest composite ID. Required
    ids array An array as a comma-separated list of the event instance composite ids to change the status of the guest for. Required

    Delete a specific calendar event

    curl -X DELETE 'http://api.ontraport.com/1/CalendarEvent?id=2_1625335200&edit_scope=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "2_1625335200",
        "notify_event_guests": false,
        "isMultipleEvents": true
      },
      "account_id": 12345
    }
    

    Deletes a specific calendar event by its ID.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/CalendarEvent

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id string The composite ID of the calendar event to delete. Required.
    edit_scope integer For recurring events, the scope of the recurrences to be deleted. Integer codes are mapped as follows:
    0 => This event
    1 => This and following events
    2 => All events
    Default is all events.
    notify_event_guests integer A binary integer flag indicating whether or not a system email should be sent to all event guests to notify them of event deletion.

    Calendar Event Guests - COMING SOON!

    Object Type ID: 161

    A calendar event guest is a contact or user who is invited to a calendar event. There is a limit of 300 guests per calendar event. The Ontraport API offers retrieval only on CalendarEventGuest endpoints. Guests can be added to events using the CalendarEvents POST/PUT endpoints, and their RSVP status can be changed using those endpoints or the dedicated endpoint for changing status.

    Sometimes in this documentation we will refer to a guest's composite ID. Guests will have a unique identifier, but most of the time we will refer to them by a composite ID as well. The guest composite ID is composed of the object type ID of the guest, an underscore, and the unique identifier of the contact or user tied to that guest. For example, contact ID 4 would have a guest composite ID of 0_4.

    The calendar event guest object

    {
        "id": "2_1",
        "guest_id": "17",
        "owner": "1",
        "name": "joe tester",
        "firstname": "joe",
        "lastname": "tester",
        "email": "tester@ontraport.com",
        "sms_number": null,
        "bulk_mail": "1",
        "bulk_sms": "2",
        "object_type_id": "2",
        "object_id": "1",
        "contact_id": "0",
        "staff_id": "1",
        "event_id": "7",
        "event_recurrence_ts": "1625266800",
        "recurrence_flag": "0",
        "external_id": "",
        "gcal_email": "",
        "date": "1625697168",
        "dlm": "1625697168",
        "deleted": "0",
        "status": "3"
    }
    

    Calendar event attributes

    Attribute Type Description
    id integer The guest's composite ID.
    guest_id integer This is the unique identifier for a guest who belongs to a particular event instance or series. It is unique across the entire account and cannot be reused on multiple events.
    owner integer The ID of the user who owns this guest. The guest owner is the owner of the event the guest belongs to and cannot be changed.
    name string The first and last name of the contact or user who is a guest. This field will update as the corresponding fields in the contact or user records update.
    firstname string The first name of the contact or user who is a guest. This field will update as the corresponding field in the contact or user records update.
    lastname string The last name of the contact or user who is a guest. This field will update as the corresponding field in the contact or user records update.
    email string The email of the contact or user who is a guest. This field will update as the corresponding field in the contact or user records update.
    bulk_mail integer The bulk mail field of the contact or user who is a guest. If the guest is a user, the status will always be opted in. If the guest is a contact, this field will update as the corresponding field in the contact record updates. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    bulk_sms integer The bulk sms field of the contact or user who is a guest. If the guest is a user, the status will always be opted in. If the guest is a contact, this field will update as the corresponding field in the contact record updates. Values are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    object_type_id integer The object type ID for the guest. All guests will be either contacts (0) or users (2).
    object_id integer The ID of the contact or user.
    contact_id integer The ID of the contact, if any.
    staff_id integer The ID of the staff, if any.
    event_id integer The ID of event the guest belongs to.
    event_recurrence_ts timestamp For exceptions made to recurring event series, the timestamp of the date of the original start time of that recurrence. This remains the same even if the actual start time is modified.
    recurrence_flag integer A binary flag indicating whether or not this guest is tied to a recurring event. This flag will be 0 for single events, and for single exceptions made to recurring events.
    external_id string A Google unique identifier imported from synced calendar.
    gcal_email string A Google email field imported from synced calendar.
    date integer A UNIX timestamp for the date the guest was added to the event.
    dlm integer A UNIX timestamp for the date the guest was last updated.
    deleted integer A binary integer flag indicating whether or not this guest has been deleted.
    status integer The guest RSVP status. Options are mapped as follows:
    0 => Unconfirmed
    1 => No
    2 => Maybe
    3 => Yes

    Retrieve a list of calendar event guests

    curl -X GET 'https://api.ontraport.com/1/CalendarEventGuests?range=50&event_id=6_1629950400' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "id": "0_5005",
          "guest_id": "320",
          "owner": "1",
          "name": "Clark Kent",
          "firstname": "Clark",
          "lastname": "Kent",
          "email": "ClarkKent5005@test.ontramail.com",
          "sms_number": null,
          "bulk_mail": "1",
          "bulk_sms": "0",
          "object_type_id": "0",
          "object_id": "5005",
          "contact_id": "5005",
          "staff_id": "0",
          "event_id": "6",
          "event_recurrence_ts": "1629777600",
          "recurrence_flag": "1",
          "external_id": "",
          "gcal_email": "",
          "date": "1629843199",
          "dlm": "1629843221",
          "deleted": "0",
          "status": "0"
        },
        {
          "id": "2_1",
          "guest_id": "1",
          "owner": "1",
          "name": "joe tester",
          "firstname": "joe",
          "lastname": "tester",
          "email": "tester@ONTRAPORT.com",
          "sms_number": null,
          "bulk_mail": "1",
          "bulk_sms": "2",
          "object_type_id": "2",
          "object_id": "1",
          "contact_id": "0",
          "staff_id": "1",
          "event_id": "6",
          "event_recurrence_ts": "1629777600",
          "recurrence_flag": "1",
          "external_id": "",
          "gcal_email": "",
          "date": "1629764006",
          "dlm": "1629843221",
          "deleted": "0",
          "status": "3"
        }
      ],
      "account_id": 12345
    }
    

    Retrieves a collection of calendar event guests based on a set of parameters. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarEventGuests

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids array An array as a comma-delimited list of the composite IDs of the guests to retrieve. If this parameter is used, it must be used in conjunction with event_id for correct results.
    start integer The offset to return results from.
    range integer The number of guests you want to retrieve. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which guests to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your guest objects for.
    event_id string The calendar event composite ID. This parameter will limit guests retrieved by event instance. It must be included to retrieve a list of guests on a particular event. If the parameter is not included, a new event is assumed and the default guest (the current user) will be returned.

    Calendar Potential Guests - COMING SOON!

    Object Type ID: 174

    Potential guests are a list of contacts and users who can be added to an event as a guest. They can't be created, updated or deleted and are only returned as a list. The potential guests endpoint provides the ability to retrieve composite guest IDs corresponding to contacts and users. These can then be used in requests to add guests to events.

    The calendar potential guest object

    {
        "type":"0",
        "value":"0_2",
        "label":"Two (2@o.com)"
    }
    

    Calendar potential guest attributes

    Attribute Type Description
    type integer The potential guest's object type ID, or "suggested" if the contact belongs to the five most recently edited contacts or added users.
    value string The guest's composite ID.
    label string The potential guest's first name, last name, and email.

    Retrieve a list of calendar potential guests

    curl -X GET 'https://api.ontraport.com/1/CalendarPotentialGuests' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "type": "suggested",
          "value": "0_2",
          "label": "Two (2@o.com)"
        },
        {
          "type": "suggested",
          "value": "0_1",
          "label": "One (1@o.com)"
        },
        {
          "type": "2",
          "value": "2_1",
          "label": "joe tester (tester@ONTRAPORT.com)"
        },
        {
          "type": "0",
          "value": "0_2",
          "label": "Two (2@o.com)"
        },
        {
          "type": "0",
          "value": "0_1",
          "label": "One (1@o.com)"
        }
      ],
      "account_id": 60
    }
    

    Retrieves a list of potential guests based on a set of parameters. You can limit unnecessary API requests by utilizing our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarPotentialGuests

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    start integer The offset to return results from.
    range integer The number of guests you want to retrieve. The maximum and default range is 200. The first request will return all suggested potential guests and user potential guests, as well as the first page of contacts. Subsequent pages will contain contact potential guests only.
    search string A string to search potential guests for.
    guestmode integer A binary integer flag indicating a change in the data returned. If this value is 1, email and object type will be returned in the data.

    Calendar Templates - COMING SOON!

    Object Type ID: 164

    Calendar templates are templates that can be applied to an event to fill in blank fields and add notifications. When a template is applied to an event, existing field values will take precedence, and the template data will be selectively applied to any empty fields.

    The calendar template object

    {
        "id": "1",
        "name": "Test Template",
        "title": "Template Event",
        "staff_id": "1",
        "location": "123 XYZ St",
        "description": "My description",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
        "date": "1626121179",
        "dlm": "1626121202",
        "deleted": "0",
        "type_id": "4"
    }
    

    Calendar template attributes

    Attribute Type Description
    id integer The calendar template's ID.
    name string The template name.
    location string The event location.
    title string The event title.
    description string A description of the event.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.
    date integer The UNIX timestamp for when the template was created.
    dlm integer The UNIX timestamp for the last time the template was modified.

    Create a calendar template

    curl -X POST -d 'name=New%20Template&title=Template%20for%20Events&location=My%20House&staff_id=1&type_id=1&notifications=%7B%22event_notification%22%3A%5B%7B%22notification_trigger_type%22%3A%22action%22%2C%22notification_send_to%22%3A%22contact%22%2C%22notification_action_type%22%3A%22email%22%2C%22notification_trigger_action_type%22%3A%22event_update%22%2C%22notification_trigger_action_field_type%22%3A%22any%22%2C%22notification_action_email%22%3A%222%22%7D%5D%7D&description=Meeting' 'http://api.ontraport.com/1/CalendarTemplates' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "name": "New Template",
        "title": "Template for Events",
        "location": "My House",
        "staff_id": "1",
        "type_id": "1",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
        "description": "Meeting",
        "id": "2",
        "date": "1626123617",
        "dlm": "1626123617",
        "deleted": "0"
      },
      "account_id": 12345
    }
    

    Creates a new calendar template object.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/CalendarTemplates

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    location string The event location.
    name string The template name.
    title string The event title.
    description string A description of the event.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.

    Retrieve a specific calendar template

    curl -X GET 'https://api.ontraport.com/1/CalendarTemplate?id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "name": "Test Template",
        "title": "Template Event",
        "date": 1626121202,
        "dlm": 1626121202,
        "location": "123 XYZ St",
        "staff_id": "1",
        "type_id": "4",
        "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
        "description": "My description",
        "id": "1",
        "owner": "1"
      },
      "account_id": 12345
    }
    

    Retrieves all the information for an existing calendar template. The only parameter needed is the ID for the calendar template which is returned in the response upon template creation.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://.ontraport.com/1/CalendarTemplate

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The calendar template ID. Required.

    Retrieve multiple calendar templates

    curl -X GET 'https://api.ontraport.com/1/CalendarTemplates?range=50' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "id": "1",
          "name": "Test Template",
          "title": "Template Event",
          "staff_id": "1",
          "location": "123 XYZ St",
          "description": "My description",
          "notifications": "{\"event_notification\":[{\"notification_trigger_type\":\"action\",\"notification_send_to\":\"contact\",\"notification_action_type\":\"email\",\"notification_trigger_action_type\":\"event_update\",\"notification_trigger_action_field_type\":\"any\",\"notification_action_email\":\"2\"}]}",
          "date": "1626121179",
          "dlm": "1626121202",
          "deleted": "0",
          "type_id": "4"
        }
      ],
      "account_id": 12345,
      "misc": []
    }
    

    Retrieves a list of calendar templates based on a set of parameters. You can limit unnecessary API requests by utilizing our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarTemplates

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An array as a comma-delimited list of the IDs of the templates to retrieve. Entering a value of 0 will result in all templates being selected.
    start integer The offset to return results from.
    range integer The number of templates you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which templates to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your template objects for.
    group_id integer The group id of templates to retrieve.
    listFields string An array as a comma-delimited list of the fields which should be returned in your results.

    Update a calendar template

    curl -X PUT -d 'id=2&title=New%20Title%20-%20Template' 'http://api.ontraport.com/1/CalendarTemplates' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "attrs": {
          "title": "New Title",
          "staff_id": null,
          "location": null,
          "description": null,
          "notifications": null,
          "dlm": "1626968421",
          "deleted": "0",
          "type_id": "0",
          "id": "2"
        }
      },
      "account_id": 12345
    }
    

    Updates an existing calendar template with given data. An ID is required. The other fields should only be used if you want to change the existing value.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/CalendarTemplates

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    id integer The calendar template's ID.
    location string The event location.
    name string The template name.
    title string The event title.
    description string A description of the event.
    staff_id integer The user ID for the owner of this event.
    type_id integer The event type ID for this event.
    notifications string [Notifications]. A JSON-encoded string of the notification rules for this event.

    Delete a specific calendar template

    curl -X DELETE 'https://api.ontraport.com/1/CalendarTemplate?id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "account_id": "12345"
    }
    

    Deletes a specific calendar template by its ID.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/CalendarTemplate

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The ID of the calendar template to delete. Required.

    Calendar Event Types - COMING SOON!

    Object Type ID: 177

    Calendar event types are essentially tags that can be applied to events to label them as a particular type. There are some default types in every account, and you can also create new types and delete existing.

    The calendar event type object

    {
        "id": "1",
        "name": "Meeting",
        "deleted": "0"
    }
    

    Calendar event type attributes

    Attribute Type Description
    id integer The calendar event type's ID.
    name string The type name.
    deleted integer A binary integer flag indicating whether or not the type is deleted.

    Create a calendar event type

    curl -X POST -d 'name=Check-in' 'https://api.ontraport.com/1/CalendarEventTypes' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "name": "Check-in",
        "id": "6",
        "deleted": "0"
      },
      "account_id": 12345
    }
    

    Creates a new calendar event type object.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/CalendarEventTypes

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    name string The type name.

    Retrieve a specific calendar event type

    curl -X GET 'https://api.ontraport.com/1/CalendarEventType?id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "1",
        "name": "Meeting",
        "deleted": "0"
      },
      "account_id": 12345
    }
    

    Retrieves all the information for an existing calendar event type. The only parameter needed is the ID for the calendar event which is returned in the response upon type creation.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://.ontraport.com/1/CalendarEventType

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The calendar event type's ID. Required.

    Retrieve multiple calendar event types

    curl -X GET 'http://api.ontraport.com/1/CalendarEventTypes?range=50' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "id": "1",
          "name": "Meeting",
          "deleted": "0"
        },
        {
          "id": "2",
          "name": "Call",
          "deleted": "0"
        },
        {
          "id": "3",
          "name": "Conference Call",
          "deleted": "0"
        },
        {
          "id": "4",
          "name": "Appointment",
          "deleted": "0"
        },
        {
          "id": "5",
          "name": "Event",
          "deleted": "0"
        },
        {
          "id": "6",
          "name": "Check-in",
          "deleted": "0"
        }
      ],
      "account_id": 12345,
      "misc": []
    }
    

    Retrieves a list of calendar event types based on a set of parameters. You can limit unnecessary API requests by utilizing our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CalendarEventTypes

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An array as a comma-delimited list of the IDs of the types to retrieve. Entering a value of 0 will result in all types being selected.
    start integer The offset to return results from.
    range integer The number of types you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which types to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your calendar event type objects for.
    listFields string An array as a comma-delimited list of the fields which should be returned in your results.

    Delete a specific calendar event type

    curl -X DELETE 'https://api.ontraport.com/1/CalendarEventType?id=6' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    Coming soon!
    

    Example Response:

    {
      "code": 0,
      "account_id": 12345
    }
    

    Deletes a specific calendar event type by its ID.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/CalendarEventType

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The ID of the calendar event type to delete. Required.

    Campaign Builder Items

    Object Type ID: 140

    These objects contain data on your CampaignBuilder campaigns, such as names, IDs, and current status. In this section, "campaign" refers to automated marketing campaigns. You can retrieve a single campaign or a list of campaigns. If you want to add a contact or custom object to a campaign, see this endpoint.

    Note:

    "campaign" throughout this doc is called "automation" throughout the Ontraport app.

    The Campaign Builder object

    {
        "id": "1",
        "name": "Test Campaign",
        "date": "1503016553",
        "dlm": "1503016553",
        "object_type_id": "0",
        "pause": "0",
        "deleted": "false"
    }
    

    Campaign attributes

    Attribute Type Description
    id integer The campaign ID.
    name string The campaign name.
    date timestamp The date the campaign was created, measured in seconds from the Unix Epoch.
    dlm timestamp The date the campaign was last modified, measured in seconds from the Unix Epoch.
    object_type_id integer The ID of the object type the campaign relates to.
    pause integer A binary integer flag indicating whether or not the campaign is paused.
    deleted boolean Whether or not the campaign has been deleted.

    Retrieve a specific campaign

    curl -X GET 'https://api.ontraport.com/1/CampaignBuilderItem?id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "id" => 1
    );
    $response = $client->campaignbuilder()->retrieveSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "1",
        "name": "Test Campaign",
        "date": "1503016553",
        "dlm": "1503016553",
        "object_type_id": "0",
        "pause": "0",
        "deleted": "false"
      },
      "account_id": "12345"
    }
    

    Retrieves data on an existing campaign.

    TRY IT OUT LIVE

    Request URL

    GET https://api.ontraport.com/1/CampaignBuilderItem

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The campaign ID. Required.

    Retrieve multiple campaigns

    curl -X GET 'https://api.ontraport.com/1/CampaignBuilderItems?listFields=ids%2Cname' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "listFields" => "id,name"
    );
    $response = $client->campaignbuilder()->retrieveMultiple($requestParams);
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "id": "1",
          "name": "Test Campaign"
        },
        {
          "id": "2",
          "name": "Test Campaign 2"
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a list of Campaigns. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request URL

    GET https://api.ontraport.com/1/CampaignBuilderItems

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An integer array as a comma-delimited list of the IDs of the campaigns to retrieve. Entering a value of 0 will result in all campaigns being selected.
    start integer The offset to return results from.
    range integer The number of campaigns you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which campaigns to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your campaign objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not notes should be searched for the specified string in addition to other task fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your campaign object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve campaign meta

    curl -X GET 'https://api.ontraport.com/1/Tasks/meta' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->task()->retrieveMeta();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "140": {
          "name": "CampaignBuilder",
          "fields": {
            "name": {
              "alias": "Name",
              "type": "text"
            },
            "date": {
              "alias": "Date Created",
              "type": "fulldate"
            },
            "state": {
              "alias": "State",
              "type": "drop",
              "options": {
                "0": "Live",
                "1": "Paused",
                "2": "Unpublished"
              }
            },
            "element_num": {
              "alias": "# Elements",
              "type": "numeric"
            },
            "todos": {
              "alias": "# ToDos",
              "type": "numeric"
            },
            "subs_ever": {
              "alias": "# On Campaign Ever",
              "type": "numeric"
            },
            "subs": {
              "alias": "# On Campaign Now",
              "type": "numeric"
            },
            "dlm": {
              "alias": "Date Modified",
              "type": "fulldate"
            }
          }
        }
      },
      "account_id": "12345"
    }
    

    Retrieves the field meta data for the campaign object.

    TRY IT OUT LIVE

    Request URL

    GET https://api.ontraport.com/1/CampaignBuilderItems/meta

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    None

    Retrieve campaign collection info

    curl -X GET 'https://api.ontraport.com/1/CampaignBuilderItems/getInfo?search=Test' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "search"     => "Test"
    );
    $response = $client->campaignbuilder()->retrieveCollectionInfo($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "listFields": [
          "name",
          "state",
          "date",
          "dlm",
          "subs",
          "subs_ever",
          "element_num",
          "todos"
        ],
        "listFieldSettings": [],
        "count": "2"
      },
      "account_id": "12345"
    }
    

    Retrieves information about a collection of campaigns, such as the number of campaigns that match the given criteria.

    TRY IT OUT LIVE

    Request URL

    GET https://api.ontraport.com/1/CampaignBuilderItems/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    condition string A JSON encoded string to more specifically set criteria for which campaigns to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your campaign objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not notes should be searched for the specified string in addition to other campaign fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Contacts

    Object Type ID: 0

    Contact objects allow you to keep up-to-date records for all the contacts you are managing.

    Through the contacts API, you can create, retrieve, update, merge and delete contacts. You can also retrieve meta for a contact object to obtain more detailed information about its attributes and retrieve information about a collection of contacts.

    Contacts can be associated with many other objects such as tasks, tags, rules, and sequences. You can access additional functionality for tagging contacts and adding and removing contacts from sequences using the objects API with an objectID of 0.

    The contact object

    
    {
        "id": "27",
        "owner": "1",
        "firstname": "First",
        "lastname": "Last",
        "email": "user@ontraport.com",
        "address": "2040 Alameda Padre Serra",
        "city": "Santa Barbara",
        "state": "CA",
        "zip": "93103",
        "birthday": "469569600",
        "date": "1531352701",
        "priority": "0",
        "status": null,
        "home_phone": null,
        "sms_number": "+18055555555",
        "dla": "1531352701",
        "contact_cat": "",
        "bulk_mail": "1",
        "bulk_sms": "0",
        "office_phone": "805-555-5555",
        "fax": null,
        "dlm": "1531352717",
        "company": "Ontraport",
        "address2": "Suite 220",
        "title": "Employee",
        "website": "www.ontraport.com",
        "country": "US",
        "system_source": "0",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "l_lead_source": "0",
        "l_content": "0",
        "l_term": "0",
        "l_medium": "0",
        "l_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_gender": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "last_inbound_sms": null,
        "timezone": null,
        "time_since_dla": "0",
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "grade": "0.00",
        "unique_id": "D4GD000"
    }
    
    
    Attributes Type Description
    id integer The contact's ID.
    unique_id string A unique identifier for the contact. This field does not reveal the actual account contact ID. It is unique across all ORM objects in your account, making it useful for merging duplicate contacts in form fillouts. This field is system generated and can't be updated.
    owner integer The ID of the user who controls the contact. This field must contain a value for a contact object to be saved properly.
    firstname string The contact's first name.
    lastname string The contact's last name.
    email string The contact's email address.
    address string The contact's postal address.
    city string The contact's city.
    state string The contact's state.
    zip string The contact's postal code.
    birthday timestamp The contact's birthday, measured in seconds from the Unix Epoch.
    date timestamp The date the contact was added, measured in seconds from the Unix Epoch.
    priority integer The contact's priority.
    High => 8
    Medium => 9
    Low => 10
    None => 0
    status integer The contact's Sales Stage. Integer codes map as follows:
    1 => Closed - Lost
    2 => Closed - Won
    3 => Committed
    4 => Consideration
    5 => Demo Scheduled
    6 => Qualified Lead
    7 => New Prospect
    cell_phone string The contact's mobile phone number.
    home_phone string The contact's home phone number.
    sms_number string The mobile number where the contact prefers receive text messages.
    dla integer Date of the contact's last activity. In this documentation, activity means that the contact interacted with a form, website, or email link.
    contact_cat string Deprecated. The tags a contact is subscribed to. Each tag has an ID, and in this field the tags are appended together with the delimiter */*. A contact_cat entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Tags are now related to contacts in a separate tag subscriber object.
    bulk_mail integer A flag that indicates a contact's bulk email status. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted to receive only transactional mail.
    bulk_sms integer A flag that indicates whether or not a contact is opted in to receive bulk texts. Values are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted out.
    office_phone string The contact's office phone number.
    fax string The contact's fax number.
    dlm timestamp The date the contact was last modified, measured in seconds from the Unix Epoch.
    company string The company the contact is affiliated with.
    address2 string A second address field which is generally used for storing suite or unit numbers.
    title string The contact's job title.
    website string The contact's website.
    country string The contact's country.
    system_source integer System field. Can't be updated through the API. Identifies the source from which the contact was added to the database.
    source_location string System field. Can't be updated through the API. Identifies the specific location from which the contact was added to the database.
    import_id integer System field. Can't be updated through the API. The ID of the import batch the contact was imported with, if any.
    ip_addy string Deprecated. The contact's IP address. This is an old version of ip_addy_display and is not used anymore.
    ip_addy_display string The contact's IP address.
    freferrer integer The affiliate ID of the first affiliate to refer the contact.
    lreferrer integer The affiliate ID of the last affiliate to refer the contact.
    n_lead_source integer The lead source ID for the tracking URL the contact arrived from.
    n_content integer The content ID for the tracking URL the contact arrived from.
    n_medium integer The medium ID for the tracking URL the contact arrived from.
    n_campaign integer The tracking campaign ID for the tracking URL the contact arrived from.
    n_term integer The term ID for the tracking URL the contact arrived from.
    l_lead_source integer The last lead source ID for the tracking URL the contact arrived from.
    l_content integer The last content ID for the tracking URL the contact arrived from.
    l_medium integer The last medium ID for the tracking URL the contact arrived from.
    l_campaign integer The last tracking campaign ID for the tracking URL the contact arrived from.
    l_term integer The last term ID for the tracking URL the contact arrived from.
    referral_page string The page the contact was referred from.
    aff_sales integer If the contact is an affiliate, the total number of affiliate sale transactions.
    aff_amount double If the contact is an affiliate, the total amount of affiliate sales.
    program_id integer For affiliates, the partner program ID.
    aff_paypal string Affiliate email address for Paypal payments.
    fb_gender string The contact's gender as listed on Facebook.
    mrcAmount double The amount of the contact's most recent credit card charge.
    mrcUnpaid double Total contact transactions remaining unpaid.
    mriInvoiceNum integer The contact's most recent invoice number.
    mriInvoiceTotal double The contact's most recent invoice total.
    ccType integer The contact's credit card type. Integer codes map to card providers as follows:
    0 => none,
    1 => Visa
    2 => Mastercard
    3 => American Express
    4 => Discover
    5 => Paypal.
    ccExpirationMonth integer The expiration month of the contact's credit card. Integer values are mapped as follows:
    1 => January
    2 => February
    3 => March
    4 => April
    5 => May
    6 => June
    7 => July
    8 => August
    9 => September
    10 => October
    11 => November
    12 => December
    ccExpirationYear integer The year the contact's credit card expires.
    ccExpirationDate integer The day of the month that the contact's credit card expires.
    ccNumber string The last 4 digits of the contact's credit card number.
    mrcResult integer The result of the contact's most recent credit card charge. Integer values map as follows:
    0 => Success
    1 => Declined
    last_inbound_sms string The last text message that you received from the contact.
    timezone string The contact's timezone.
    time_since_dla integer The time since the contact's last activity. Only accounts after 2018 will have this field.
    spent double The total amount the contact has spent with your company.
    num_purchased integer The contact's total orders.
    updateSequence string Deprecated. The sequences a contact is subscribed to. Each sequence has an ID, and in this field the sequences are appended together with the delimiter */*. An updateSequence entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Sequences are now related to contacts in a separate sequence subscribers object. If you want to subscribe a contact to a sequence please see the /objects/subscribe endpoint.
    updateCampaign string Deprecated. The campaigns a contact is subscribed to. Note: "campaign" throughout this doc is called "automation" throughout the Ontraport app. Each campaign has an ID, and in this field the campaigns are appended together with the delimiter */*. This field will appear in responses, but should not be updated. If you want to subscribe a contact to a campaign please see the /objects/subscribe endpoint.
    grade integer The contact's score based upon lead scoring rules.
    {custom fields} varies If you have created custom fields for your contact objects, they can be accessed through the API. These fields are unique to your account and will appear in the response when you retrieve a contact object. If you are not sure what a response field is used for, you can retrieve contact meta to check for the field name.

    Create a contact

    curl -X POST -d 'firstname=Angie&lastname=Lopez&email=alopez%40ontraport.com' 'https://api.ontraport.com/1/Contacts' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "firstname" => "Angie",
        "lastname"  => "Lopez",
        "email"     => "alopez@gmail.com"
    );
    $response = $client->contact()->create($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "firstname": "Angie",
        "lastname": "Lopez",
        "email": "alopez@ontraport.com",
        "id": "1",
        "owner": "1",
        "address": null,
        "city": null,
        "state": null,
        "zip": null,
        "birthday": null,
        "date": "1493143903",
        "status": null,
        "priority": "0",
        "home_phone": null,
        "sms_number": null,
        "dla": "1493143903",
        "contact_cat": "",
        "bulk_mail": "-5",
        "bulk_sms": "0",
        "office_phone": null,
        "fax": null,
        "dlm": "1493143903",
        "company": null,
        "address2": null,
        "title": null,
        "website": null,
        "country": null,
        "system_source": "3",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "ip_addy_display": null,
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "l_lead_source": "0",
        "l_content": "0",
        "l_term": "0",
        "l_medium": "0",
        "l_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_gender": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "last_inbound_sms": null,
        "timezone": null,
        "time_since_dla": "0",
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "grade": "0.00",
        "unique_id": "D4GD000"
      },
      "account_id": "12345"
    }
    

    Creates a new contact object. This endpoint allows duplication; if you want to avoid duplicate emails you should merge instead.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/Contacts

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    firstname string The contact's first name.
    lastname string The contact's last name.
    email string The contact's email address.
    freferrer integer The affiliate ID of the first affiliate to refer the contact.
    lreferrer integer The affiliate ID of the last affiliate to refer the contact.
    address string The contact's postal address.
    address2 string A second address field which is generally used for storing suite or unit numbers.
    city string The contact's city.
    state string The contact's state.
    zip string The contact's postal code.
    country string The contact's country.
    birthday timestamp The contact's birthday, measured in seconds from the Unix Epoch.
    priority integer The contact's priority.
    High => 8
    Medium => 9
    Low => 10
    None => 0
    status integer The contact's Sales Stage. Integer codes map as follows:
    1 => Closed - Lost
    2 => Closed - Won
    3 => Committed
    4 => Consideration
    5 => Demo Scheduled
    6 => Qualified Lead
    7 => New Prospect
    cell_phone string The contact's mobile phone number.
    home_phone string The contact's home phone number.
    sms_number string The mobile number where the contact prefers receive text messages.
    office_phone string The contact's office phone number.
    fax string The contact's fax number.
    company string The company the contact is affiliated with.
    title string The contact's job title.
    website string The contact's website.
    contact_cat string Deprecated. The tags a contact is subscribed to. Each tag has an ID, and in this field the tags are appended together with the delimiter */*. A contact_cat entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Tags are now related to contacts in a separate tag subscriber object.
    bulk_mail integer A flag that indicates a contact's bulk email status. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted to receive only transactional mail.
    bulk_sms integer A flag that indicates whether or not a contact is opted in to receive bulk texts. Values are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted out.
    n_lead_source integer/string The lead source for the first tracking URL the contact arrived from. This field accepts the lead source name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_content integer/string The content for the first tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_medium integer/string The medium for the first tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_campaign integer/string The tracking campaign for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_term integer/string The term for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_lead_source integer/string The lead source for the last tracking URL the contact arrived from. This field accepts the lead source name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_content integer/string The content for the last tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_medium integer/string The medium for the last tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_campaign integer/string The tracking campaign for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_term integer/string The term for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    use_utm_names boolean Used to indicate that utm variables will be passed by name rather than ID. Defaults to false.
    referral_page string The page the contact was referred from.
    aff_sales integer If the contact is an affiliate, the total number of affiliate sale transactions.
    aff_amount double If the contact is an affiliate, the total amount of affiliate sales.
    program_id integer For affiliates, the partner program ID.
    aff_paypal string Affiliate email address for Paypal payments.
    timezone string The contact's timezone.
    time_since_dla integer The time since the contact's last activity. Only accounts after 2018 will have this field.
    num_purchased integer The contact's total orders.
    updateSequence string Deprecated. The sequences a contact is subscribed to. Each sequence has an ID, and in this field the sequences are appended together with the delimiter */*. An updateSequence entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Sequences are now related to contacts in a separate sequence subscribers object. If you want to subscribe a contact to a sequence please see the /objects/subscribe endpoint.
    updateCampaign string Deprecated. The campaigns a contact is subscribed to. Each campaign has an ID, and in this field the campaigns are appended together with the delimiter */*. This field will appear in responses, but should not be updated. If you want to subscribe a contact to a campaign please see the /objects/subscribe endpoint.

    Note when using custom fields of the list selection type as a parameter, it must have the option's id wrapped with the delimiter */*. If a list selection field has "field" => "f1500" with options mapped as follows: "1" => "one", "2" => "two". An entry containing multiple options looks like this: "f1500": "*/*1*/*2*/*". You can obtain information regarding your custom fields with the GET /Contacts/meta endpoint.

    Retrieve a specific contact

    curl -X GET 'https://api.ontraport.com/1/Contact?id=27' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "id" => 27
    );
    $response = $client->contact()->retrieveSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "27",
        "owner": "1",
        "firstname": "First",
        "lastname": "Last",
        "email": "user@ontraport.com",
        "address": "2040 Alameda Padre Serra",
        "city": "Santa Barbara",
        "state": "CA",
        "zip": "93103",
        "birthday": "469569600",
        "date": "1491866009",
        "priority": "0",
        "status": null,
        "cell_phone": null,
        "home_phone": null,
        "sms_number": "+18055555555",
        "dla": "1491866009",
        "contact_cat": "",
        "bulk_mail": "1",
        "bulk_sms": "0",
        "office_phone": "805-555-5555",
        "fax": null,
        "dlm": "1491866203",
        "company": "Ontraport",
        "address2": "Suite 220",
        "title": "Employee",
        "website": "www.ontraport.com",
        "country": "US",
        "system_source": "0",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "ip_addy_display": null,
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_gender": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "last_inbound_sms": null,
        "time_since_dla": "0",
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "grade": "0.00",
        "unique_id": "D4GD000"
      },
      "account_id": "12345"
    }
    

    Retrieves all the information for an existing contact. The only parameter needed is the ID for the contact which is returned in the response upon contact creation.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Contact

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The contact ID. Required.

    Retrieve multiple contacts

    curl -X GET 'https://api.ontraport.com/1/Contacts?ids=29%2C30%2C31&sort=lastname&sortDir=desc&listFields=firstname%2Clastname%2Cemail' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "ids"        => "29,30,31",
        "sort"       => "lastname",
        "sortDir"    => "desc",
        "listFields" => "firstname,lastname,email"
    );
    $response = $client->contact()->retrieveMultiple($requestParams);
    

    Example response:

    {
      "code": 0,
      "data": [
        {
          "firstname": "John",
          "lastname": "Smith",
          "email": "john@ontraport.com",
          "id": "29",
          "owner": "1"
        },
        {
          "firstname": "Jane",
          "lastname": "Doe",
          "email": "jane@ontraport.com",
          "id": "30",
          "owner": "1"
        },
        {
          "firstname": "Mary",
          "lastname": "Brown",
          "email": "mary@ontraport.com",
          "id": "31",
          "owner": "1"
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a collection of contacts based on a set of parameters. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Contacts

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An array as a comma-delimited list of the IDs of the contacts to retrieve. Entering a value of 0 will result in all contacts being selected.
    start integer The offset to return results from.
    range integer The number of contacts you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which contacts to bring back. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your contact objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not contact notes should be searched for the specified string in addition to other contact fields.
    group_id integer The group id of contacts to retrieve. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your contact object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string An array as a comma-delimited list of the fields which should be returned in your results.

    Update a contact

    curl -X PUT -d 'id=29&firstname=Bob&email=bob%40ontraport.com' 'https://api.ontraport.com/1/Contacts' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "id"        => 29,
        "firstname" => "Bob",
        "email"     => "bob@ontraport.com"
    );
    $response = $client->contact()->update($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "attrs": {
          "firstname": "Bob",
          "dlm": "1500507946",
          "id": "29"
        }
      },
      "account_id": "12345"
    }
    

    Updates an existing contact with given data. Either the ID or the Unique ID of the contact to update is required. ID will take precedence over Unique ID. The other fields should only be used if you want to change the existing value.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/Contacts

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    id integer The contact's ID. Either id or unique_id are required to update a contact.
    unique_id string A unique identifier for the contact. This field is system generated and can't be updated. If the unique_id sent matches a contact in the account, that contact's data will be updated. Either id or unique_id are required. If both are sent, unique_id will be ignored.
    firstname string The contact's first name.
    lastname string The contact's last name.
    email string The contact's email address.
    freferrer integer The affiliate ID of the first affiliate to refer the contact.
    lreferrer integer The affiliate ID of the last affiliate to refer the contact.
    address string The contact's postal address.
    address2 string A second address field which is generally used for storing suite or unit numbers.
    city string The contact's city.
    state string The contact's state.
    zip string The contact's postal code.
    country string The contact's country.
    timezone string The contact's timezone.
    birthday timestamp The contact's birthday, measured in seconds from the Unix Epoch.
    priority integer The contact's priority.
    High => 8
    Medium => 9
    Low => 10
    None => 0
    status integer The contact's Sales Stage. Integer codes map as follows:
    1 => Closed - Lost
    2 => Closed - Won
    3 => Committed
    4 => Consideration
    5 => Demo Scheduled
    6 => Qualified Lead
    7 => New Prospect
    cell_phone string The contact's mobile phone number.
    home_phone string The contact's home phone number.
    sms_number string The mobile number where the contact prefers receive text messages.
    office_phone string The contact's office phone number.
    fax string The contact's fax number.
    company string The company the contact is affiliated with.
    title string The contact's job title.
    website string The contact's website.
    bulk_mail integer A flag that indicates a contact's bulk email status. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted to receive only transactional mail.
    bulk_sms integer A flag that indicates whether or not a contact is opted in to receive bulk texts. Values are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted out.
    n_lead_source integer/ string The lead source for the first tracking URL the contact arrived from. This field accepts the lead source name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_content integer/string The content for the first tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_medium integer/string The medium for the first tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_campaign integer/string The tracking campaign for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_term integer/string The term for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_lead_source integer/string The lead source for the last tracking URL the contact arrived from. This field accepts the lead source name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_content integer/string The content for the last tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_medium integer/string The medium for the last tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_campaign integer/string The tracking campaign for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_term integer/string The term for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    use_utm_names boolean Used to indicate that utm variables will be passed by name rather than ID. Defaults to false.
    referral_page string The page the contact was referred from.
    program_id integer For affiliates, the partner program ID.
    aff_paypal string Affiliate email address for Paypal payments.
    num_purchased integer The contact's total orders.

    Delete a specific contact

    curl -X DELETE 'https://api.ontraport.com/1/Contact?id=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "id" => 2
    );
    $response = $client->contact()->deleteSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "account_id": "12345"
    }
    

    Deletes a specific contact by its ID.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/Contact

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The ID of the contact to delete. Required.

    Delete multiple contacts

    curl -X DELETE 'https://api.ontraport.com/1/Contacts?ids=567%2C568%2C569&range=3&sort=firstname&sortDir=desc' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "ids"        => "1,2,3",
        "sort"       => "lastname",
        "sortDir"    => "desc",
        "listFields" => "firstname,lastname,email"
    );
    $response = $client->contact()->deleteMultiple($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": "Deleted",
      "account_id": "12345"
    }
    

    Deletes a collection of contacts based on a set of parameters. You can choose the ids for the contacts to delete or use our pagination tools for a mass delete. Be very careful using this endpoint with your API key. Specified contacts will be permanently deleted from your database.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/Contacts

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An array as a comma-delimited list of the IDs of the contacts to delete. Entering a value of 0 will result in all contacts being selected. Caution should be used with this endpoint.
    start integer The offset to delete results from.
    range integer The number of contacts you want to delete. The maximum and default range is 50.
    condition string A JSON encoded string to more specifically set criteria for which contacts to delete. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your contact objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not contact notes should be searched for the specified string in addition to other contact fields.
    group_id integer The group id of contacts to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Merge or create a contact

    curl -X POST -d 'firstname=John&lastname=Doe&email=user%40ontraport.com' 'https://api.ontraport.com/1/Contacts/saveorupdate' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    curl -X POST -d 'birthday=804798000&email=user%40ontraport.com' 'https://api.ontraport.com/1/Contacts/saveorupdate' \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    
    // Creating a contact with an email that does not exist in the account
    $requestParams = array(
        "firstname" => "John",
        "lastname"  => "Doe",
        "email"     => "user@ontraport.com"
    );
    
    // Updating birthday for contact with existing email in the account
    $requestParams = array(
        "birthday"  => "804798000",
        "email"     => "user@ontraport.com"
    );
    $response = $client->contact()->saveOrUpdate($requestParams);
    

    Example Response for Creating a Contact:

    {
      "code": 0,
      "data": {
        "firstname": "John",
        "id": "1",
        "owner": "1",
        "lastname": "Doe",
        "email": "user@ontraport.com",
        "address": null,
        "city": null,
        "state": null,
        "zip": null,
        "birthday": null,
        "date": "1531352827",
        "priority": "0",
        "status": null,
        "home_phone": null,
        "sms_number": null,
        "dla": "1531352827",
        "contact_cat": "",
        "bulk_mail": "-5",
        "bulk_sms": "0",
        "office_phone": null,
        "fax": null,
        "dlm": "1531352827",
        "company": null,
        "address2": null,
        "title": null,
        "website": null,
        "country": null,
        "system_source": "3",
        "source_location": null,
        "import_id": "0",
        "ip_addy": null,
        "ip_addy_display": null,
        "freferrer": "0",
        "lreferrer": "0",
        "n_lead_source": "0",
        "n_content": "0",
        "n_term": "0",
        "n_media": "0",
        "n_medium": "0",
        "n_campaign": "0",
        "l_lead_source": "0",
        "l_content": "0",
        "l_term": "0",
        "l_medium": "0",
        "l_campaign": "0",
        "referral_page": null,
        "aff_sales": "0",
        "aff_amount": "0",
        "program_id": "0",
        "aff_paypal": null,
        "fb_gender": null,
        "mrcAmount": "0",
        "mrcUnpaid": "0.00",
        "mriInvoiceNum": "0",
        "mriInvoiceTotal": "0",
        "ccType": "0",
        "ccExpirationMonth": "0",
        "ccExpirationYear": "0",
        "ccExpirationDate": "0",
        "ccNumber": null,
        "mrcResult": "0",
        "last_inbound_sms": null,
        "timezone": null,
        "time_since_dla": "0",
        "spent": null,
        "num_purchased": null,
        "updateSequence": "",
        "grade": "0.00",
        "unique_id": "D4GD000"
      },
      "account_id": "12345"
    }
    

    Example Response for Updating a Contact:

    {
      "code": 0,
      "data": {
        "attrs": {
          "birthday": "804798000",
          "dlm": "1531348174",
          "id": "1"
        }
      },
      "account_id": "12345"
    }
    

    Looks for an existing contact with a matching unique field and merges supplied data with existing data. If no unique field is supplied or if no existing contact has a matching unique field field, a new contact will be created. Recommended to avoid unwanted duplicate mailings. While merging on the unique_id field is supported, merging on the id field is not, and may cause unintended consequences. If you would like to update a contact based on its ID, you should use the update endpoint.

    TRY IT OUT LIVE

    Request Endpoint

    POST https://api.ontraport.com/1/Contacts/saveorupdate

    Required Headers

    Api-Key: {api_key} Api-Appid: {app_id} Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    firstname string The contact's first name.
    lastname string The contact's last name.
    email string The contact's email address.
    unique_id string A unique identifier for the contact. This field is system generated and can't be updated. If a unique_id is sent that matches a contact in the account, that contact's data will be updated. This field will take precedence over other unique fields.
    freferrer integer The affiliate ID of the first affiliate to refer the contact.
    lreferrer integer The affiliate ID of the last affiliate to refer the contact.
    address string The contact's postal address.
    address2 string A second address field which is generally used for storing suite or unit numbers.
    city string The contact's city.
    state string The contact's state.
    zip string The contact's postal code.
    country string The contact's country.
    timezone string The contact's timezone.
    birthday timestamp The contact's birthday, measured in seconds from the Unix Epoch.
    priority integer The contact's priority.
    High => 8
    Medium => 9
    Low => 10
    None => 0
    status integer The contact's Sales Stage. Integer codes map as follows:
    1 => Closed - Lost
    2 => Closed - Won
    3 => Committed
    4 => Consideration
    5 => Demo Scheduled
    6 => Qualified Lead
    7 => New Prospect
    cell_phone string The contact's mobile phone number.
    home_phone string The contact's home phone number.
    sms_number string The mobile number where the contact prefers receive text messages.
    office_phone string The contact's office phone number.
    fax string The contact's fax number.
    company string The company the contact is affiliated with.
    title string The contact's job title.
    website string The contact's website.
    contact_cat string Deprecated. The tags a contact is subscribed to. Each tag has an ID, and in this field the tags are appended together with the delimiter */*. A contact_cat entry containing multiple tags looks like this: */*1*/*2*/*3*/*. Tags are now related to contacts in a separate tag subscriber object.
    bulk_mail integer A flag that indicates a contact's bulk email status. Values are mapped as follows:
    0 => Transactional Only
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    -5 => Under review
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted to receive only transactional mail.
    bulk_sms integer A flag that indicates whether or not a contact is opted in to receive bulk texts. alues are mapped as follows:
    0 => Opted-out
    1 => Opted-in
    2 => Double opt-in
    -2 => Hard bounce
    You can only set the value to 0 through the API. You cannot manually opt-in a contact who has opted out.
    n_lead_source integer The lead source ID for the tracking URL the contact arrived from.
    n_content integer/string The content for the first tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_medium integer/string The medium for the first tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_campaign integer/string The tracking campaign for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    n_term integer/string The term for the first tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_lead_source integer/string The lead source for the last tracking URL the contact arrived from. This field accepts the lead source name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_content integer/string The content for the last tracking URL the contact arrived from. This field accepts the content name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_medium integer/string The medium for the last tracking URL the contact arrived from. This field accepts the medium name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_campaign integer/string The tracking campaign for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    l_term integer/string The term for the last tracking URL the contact arrived from. This field accepts the tracking campaign name if use_utm_names has a value of true, and ID if it is not passed or has a value of false. Utm variables passed by name will be created if they do not exist.
    use_utm_names boolean Used to indicate that utm variables will be passed by name rather than ID. Defaults to false.
    referral_page string The page the contact was referred from.
    aff_sales integer If the contact is an affiliate, the total number of affiliate sale transactions.
    aff_amount double If the contact is an affiliate, the total amount of affiliate sales.
    program_id integer For affiliates, the partner program ID.
    aff_paypal string Affiliate email address for Paypal payments.
    num_purchased integer The contact's total orders.
    updateSequence string Deprecated. The sequences a contact is subscribed to. Each sequence has an ID, and in this field the sequences are appended together with the delimiter /. An updateSequence entry containing multiple tags looks like this: /*1/2/3/*. Sequences are now related to contacts in a separate sequence subscribers object. If you want to subscribe a contact to a sequence please see the /objects/subscribe endpoint.
    updateCampaign string Deprecated. The campaigns a contact is subscribed to. Each campaign has an ID, and in this field the campaigns are appended together with the delimiter */*. This field will appear in responses, but should not be updated. If you want to subscribe a contact to a campaign please see the /objects/subscribe endpoint.

    Retrieve contact object meta

    curl -X GET 'https://api.ontraport.com/1/Contacts/meta' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->contact()->retrieveMeta();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "0": {
          "name": "Contact",
          "fields": {
            "firstname": {
              "alias": "First Name",
              "type": "text"
            },
            "lastname": {
              "alias": "Last Name",
              "type": "text"
            },
            "email": {
              "alias": "Email",
              "type": "email"
            },
            "freferrer": {
              "alias": "First Referrer",
              "type": "parent",
              "parent_object": 36
            },
            "lreferrer": {
              "alias": "Last Referrer",
              "type": "parent",
              "parent_object": 36
            },
            "address": {
              "alias": "Address",
              "type": "text"
            },
            "city": {
              "alias": "City",
              "type": "text"
            },
            "state": {
              "alias": "State",
              "type": "state"
            },
            "zip": {
              "alias": "Zip Code",
              "type": "text"
            },
            "birthday": {
              "alias": "Birthday",
              "type": "fulldate"
            },
            "aff_paypal": {
              "alias": "Paypal Address",
              "type": "text"
            },
            "program_id": {
              "alias": "Partner Program",
              "type": "parent",
              "parent_object": 35
            },
            "contact_cat": {
              "alias": "Contact Tags",
              "type": "subscription"
            },
            "bulk_mail": {
              "alias": "Bulk Email Status",
              "type": "check"
            },
            "office_phone": {
              "alias": "Office Phone",
              "type": "phone"
            },
            "fax": {
              "alias": "Fax",
              "type": "phone"
            },
            "company": {
              "alias": "Company",
              "type": "text"
            },
            "address2": {
              "alias": "Address 2",
              "type": "text"
            },
            "website": {
              "alias": "Website",
              "type": "text"
            },
            "title": {
              "alias": "Title",
              "type": "text"
            },
            "country": {
              "alias": "Country",
              "type": "country"
            },
            "date": {
              "alias": "Date Added",
              "type": "timestamp"
            },
            "dlm": {
              "alias": "Date Modified",
              "type": "timestamp"
            },
            "dla": {
              "alias": "Last Activity",
              "type": "timestamp"
            },
            "spent": {
              "alias": "Spent",
              "type": "price"
            },
            "n_lead_source": {
              "alias": "First Lead Source",
              "type": "parent",
              "parent_object": 76
            },
            "n_campaign": {
              "alias": "First Campaign",
              "type": "parent",
              "parent_object": 75
            },
            "n_content": {
              "alias": "First Content",
              "type": "parent",
              "parent_object": 78
            },
            "n_medium": {
              "alias": "First Medium",
              "type": "parent",
              "parent_object": 77
            },
            "referral_page": {
              "alias": "Referring Page",
              "type": "text"
            },
            "aff_sales": {
              "alias": "Number of Sales",
              "type": "numeric"
            },
            "aff_amount": {
              "alias": "Total Sales",
              "type": "price"
            },
            "mriInvoiceNum": {
              "alias": "Last Invoice #",
              "type": "numeric"
            },
            "mriInvoiceTotal": {
              "alias": "Last Total Invoice Amount",
              "type": "price"
            },
            "mrcAmount": {
              "alias": "Last Charge Amount",
              "type": "price"
            },
            "mrcUnpaid": {
              "alias": "Total Amount of Unpaid Transactions",
              "type": "price"
            },
            "ccType": {
              "alias": "Card Type",
              "type": "drop",
              "options": {
                "0": "",
                "1": "Visa",
                "2": "Mastercard",
                "3": "American Express",
                "4": "Discover",
                "5": "Paypal",
                "6": "Other"
              }
            },
            "ccExpirationMonth": {
              "alias": "Card Expiration Month",
              "type": "drop",
              "options": {
                "1": "January",
                "2": "February",
                "3": "March",
                "4": "April",
                "5": "May",
                "6": "June",
                "7": "July",
                "8": "August",
                "9": "September",
                "10": "October",
                "11": "November",
                "12": "December"
              }
            },
            "ccExpirationYear": {
              "alias": "Card Expiration Year",
              "type": "numeric"
            },
            "ccNumber": {
              "alias": "Card Number (Last 4)",
              "type": "numeric"
            },
            "mrcResult": {
              "alias": "Last CC Status",
              "type": "drop",
              "options": {
                "0": "Success",
                "1": "Declined"
              }
            },
            "ccExpirationDate": {
              "alias": "Card Expiration Date",
              "type": "fulldate"
            },
            "lnf": {
              "alias": "Name",
              "type": "mergefield"
            },
            "fn": {
              "alias": "Name",
              "type": "mergefield"
            },
            "grade": {
              "alias": "Score",
              "type": "numeric"
            },
            "num_purchased": {
              "alias": "Orders",
              "type": "numeric"
            },
            "id": {
              "alias": "Contact ID",
              "type": "numeric"
            },
            "owner": {
              "alias": "Owner",
              "type": "parent",
              "parent_object": 2
            },
            "bulk_sms": {
              "alias": "Bulk SMS Status",
              "type": "check"
            },
            "sms_number": {
              "alias": "SMS Number",
              "type": "sms"
            },
            "timezone": {
              "alias": "Timezone",
              "type": "timezone"
            },
            "priority": {
              "alias": "Priority",
              "type": "drop",
              "options": {
                "8": "High",
                "9": "Medium",
                "10": "Low"
              }
            },
            "time_since_dla": {
              "alias": "Time Since Last Activity",
               "type": "drop",
               "required": 0,
               "unique": 0,
               "editable": 1,
               "deletable": 0,
               "options": {
                "60": "More than a month ago (Cold)",
                "61": "This month",
                "62": "This Week",
                "63": "Today (Hot!)"
              }
            },
            "status": {
              "alias": "Sales Stage",
              "type": "drop",
               "options": {
                  "1": "Closed - Lost",
                  "2": "Closed - Won",
                  "3": "Committed",
                  "4": "Consideration",
                  "5": "Demo Scheduled",
                  "6": "Qualified Lead",
                  "7": "New Prospect"
               }
            },
            "updateSequence": {
              "alias": "Sequences",
              "type": "subscription"
            },
            "n_term": {
              "alias": "Term",
              "type": "parent",
              "parent_object": 79
            },
            "last_note": {
              "alias": "Last Note",
              "type": "text"
            },
            "ip_addy_display": {
              "alias": "IP Address",
              "type": "text"
            },
            "last_inbound_sms": {
              "alias": "Last Inbound SMS",
              "type": "text"
            },
            "timezone": {
              "alias": "Timezone",
              "type": "timezone"
            },
            "l_lead_source": {
              "alias": "Last Lead Source",
              "type": "parent",
              "parent_object": 76
            },
            "l_campaign": {
              "alias": "Last Campaign",
              "type": "parent",
              "parent_object": 75
            },
            "l_content": {
              "alias": "Last Content",
              "type": "parent",
              "parent_object": 78
            },
            "l_medium": {
              "alias": "Last Medium",
              "type": "parent",
              "parent_object": 77
            },
            "l_term": {
              "alias": "Last Term",
              "type": "parent",
              "parent_object": 79
            }
          }
        }
      },
      "account_id": "12345"
    }
    

    Retrieves the field meta data for the contact object.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Contacts/meta

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    None

    Retrieve contact collection info

    curl -X GET 'https://api.ontraport.com/1/Contacts/getInfo?search=John' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "search" => "John"
    );
    $response = $client->contact()->retrieveCollectionInfo($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "listFields": [
          "fn",
          "email",
          "office_phone",
          "date",
          "grade",
          "dla",
          "contact_id"
        ],
        "listFieldSettings": [],
        "count": "2"
      },
      "account_id": "12345"
    }
    

    Retrieves information about a collection of contacts, such as the number of contacts that match the given criteria.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Contacts/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    condition string A JSON encoded string to more specifically set criteria for which contacts to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your contact objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not contact notes should be searched for the specified string in addition to other contact fields.
    group_id integer The group id of contacts to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Credit Cards

    Object Type ID: 45

    Credit cards objects store data for a contact's saved credit cards, including card information, type, status, and billing details.

    The credit card object

    {
          "id": "1",
          "firstname": "Maria",
          "lastname": "Romero",
          "contact_id": "1",
          "last4": "1111",
          "type": "1",
          "exp_month": "11",
          "exp_year": "2027",
          "address": "2040 Alameda Padre Serra",
          "address2": "Suite 220",
          "city": "Santa Barbara",
          "state": "CA",
          "zip": "93103",
          "country": "US",
          "status": "3",
          "recent_sale": "0",
          "invoice_id": "1"
    }
    

    Credit card attributes

    Attribute Type Description
    id integer The credit card ID.
    firstname string The first name of the credit card owner.
    lastname string The last name of the credit card owner.
    contact_id integer The ID of the contact associated with the credit card.
    last4 integer The last four digits of the credit card number.
    type integer The credit card issuer. Integer codes are mapped as follows:
    1 => Visa
    2 => Mastercard
    3 => American Express
    4 => Discover
    6 => Other
    exp_month integer The two-digit integer representation of the credit card's expiration month.
    exp_year integer The four-digit credit card expiration year.
    address string The credit card's billing address.
    address2 string Additional information about the credit card's billing address, such as unit number.
    city string The credit card's billing address city.
    state string The credit card's billing address state.
    zip string The credit card's billing address zip code.
    country string The credit card's billing address country.
    status integer The current status of the credit card. Integer codes are mapped as follows:
    1 => Active
    2 => Expired
    3 => Active Default
    4 => Expired Default
    recent_sale timestamp The date and time of the most recent charge measured in seconds from the Unix Epoch.
    invoice_id integer The ID of the invoice generated in relation to the most recent charge to the credit card.

    Retrieve a specific credit card

    curl -X GET 'https://api.ontraport.com/1/CreditCard?id=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 2
    );
    $response = $client->creditcard()->retrieveSingle($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
          "id": "1",
          "firstname": "Maria",
          "lastname": "Romero",
          "contact_id": "1",
          "last4": "1111",
          "type": "1",
          "exp_month": "11",
          "exp_year": "2027",
          "address": "2040 Alameda Padre Serra",
          "address2": "Suite 220",
          "city": "Santa Barbara",
          "state": "CA",
          "zip": "93103",
          "country": "US",
          "status": "3",
          "recent_sale": "0",
          "invoice_id": "1"
      },
      "account_id": "12345"
    }
    

    Retrieves all the information for an existing credit card.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CreditCard

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The credit card ID. Required.

    Retrieve multiple credit cards

    curl -X GET 'https://api.ontraport.com/1/CreditCards?listFields=contact_id%2C%20last4%2C%20exp_month%2C%20exp_year%2C%20status' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "listFields" => "contact_id, last4, exp_month, exp_year, status"
    );
    $response = $client->creditcard()->retrieveMultiple($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": [
        {
          "contact_id": "1",
          "last4": "1111",
          "exp_month": "11",
          "exp_year": "2027",
          "status": "3",
          "id": "1"
        },
        {
          "contact_id": "1",
          "last4": "1111",
          "exp_month": "9",
          "exp_year": "2037",
          "status": "1",
          "id": "2"
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a collection of credit cards based on a set of parameters. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CreditCards

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An integer array as a comma-delimited list of the IDs of the credit cards to retrieve. Entering a value of 0 will result in all forms being selected.
    start integer The id to start your search after.
    range integer The number of credit cards you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which credit cards to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your form objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native form fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your credit card object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve credit card collection info

    curl -X GET 'https://api.ontraport.com/1/CreditCards/getInfo?condition=%5B%7B%20%22field%22%3A%7B%22field%22%3A%22contact_id%22%7D%2C%20%22op%22%3A%22%3D%22%2C%20%22value%22%3A%7B%22value%22%3A1%7D%20%7D%5D' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $condition = new OntraportAPI\Criteria("contact_id", "=", 1);
    $queryParams = array(
        "condition"  => $condition->fromArray()
    );
    $response = $client->creditcard()->retrieveCollectionInfo($queryParams);
    

    Example Response:

    {
      "code": 0,
        "data": {
          "listFields": [
            "contact_id",
            "last4",
            "exp_month",
            "exp_year"
          ],
          "listFieldSettings": [],
          "count": "2"
        },
      "account_id": "12345"
    }
    

    Retrieves information about a collection of credit cards, such as the number of credit cards that match the given criteria.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CreditCards/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    condition string A JSON encoded string to more specifically set criteria for which credit cards to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your credit card objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native credit card fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Retrieve credit card meta

    curl -X GET 'https://api.ontraport.com/1/CreditCards/meta' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->creditcard()->retrieveMeta();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "45": {
          "name": "CreditCard",
          "fields": {
            "contact_id": {
              "alias": "Contact",
              "type": "parent"
            },
            "last4": {
              "alias": "Card Number (last 4)",
              "type": "text"
            },
            "type": {
              "alias": "Card Type",
              "type": "drop",
              "options": {
                "1": "Visa",
                "2": "Mastercard",
                "3": "AMEX",
                "4": "Discover",
                "6": "Other"
              }
            },
            "status": {
              "alias": "Card Status",
              "type": "drop",
              "options": {
                "0": "Hidden",
                "1": "Active",
                "2": "Expired",
                "3": "Active (Default)",
                "4": "Expired (Default)"
              }
            },
            "exp_month": {
              "alias": "Card Expiration Month",
              "type": "numeric"
            },
            "exp_year": {
              "alias": "Card Expiration Year",
              "type": "numeric"
            },
            "address": {
              "alias": "Billing Address",
              "type": "text"
            },
            "address2": {
              "alias": "Billing Address 2",
              "type": "text"
            },
            "city": {
              "alias": "Billing City",
              "type": "text"
            },
            "state": {
              "alias": "Billing State",
              "type": "state"
            },
            "zip": {
              "alias": "Billing Zip",
              "type": "text"
            },
            "country": {
              "alias": "Billing \nCountry",
              "type": "country"
            },
            "invoice_id": {
              "alias": "Invoice",
              "type": "parent",
              "parent_object": 46
            },
            "firstname": {
              "alias": "Billing First Name",
              "type": "text"
            },
            "lastname": {
              "alias": "Billing Last Name",
              "type": "text"
            }
          }
        }
      },
      "account_id": "12345"
    }
    

    Retrieves the field meta data for a credit card.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/CreditCards/meta

    Required Headers

    Api-Key: {api_key} Api-Appid: {app_id}

    Request Parameters

    None

    Set a default credit card

    curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' -d 'id=11' 'https://api.ontraport.com/1/CreditCard/default' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 2
    );
    $response = $client->creditcard()->setDefault($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "11",
        "status": 3
      },
      "account_id": "12345"
    }
    

    Sets the status of an existing card to default and adjusts the status of the current default card.

    TRY IT OUT LIVE

    Request Endpoint

    PUT https://api.ontraport.com/1/CreditCard/default

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Content-Type: application/x-www-form-urlencoded

    Request Parameters

    Parameters should be sent in the request body as a URL-encoded string.

    Parameter Type Description
    id integer The credit card ID. Required.

    Forms

    Object Type ID: 122

    Forms are used to simply and easily gather information from your contacts. Our ONTRAforms are the recommended form type, as we offer many pre-designed and customizable templates which will greatly simplify your process. We also offer legacy SmartForms, which allow you to create your own designs.

    Through the form API, you can retrieve a single form or a collection of forms. You can also retrieve meta for a form object and retrieve information about a collection of forms.

    The form object

    {
        "form_id": "2",
        "formname": "Test Form",
        "type": "11",
        "tags": null,
        "sequences": null,
        "campaigns": null,
        "redirect": null,
        "owner": "",
        "captcha": "1",
        "notif": null,
        "fillouts": "0",
        "json_raw_object": "0",
        "deleted": "",
        "object_type_id": "0",
        "responsive": "1",
        "visits": "0",
        "unique_visits": "0",
        "revenue": "0.00",
        "date": "1510703743",
        "dlm": "1510703743"
      }
    

    Form attributes

    Attribute Type Description
    form_id integer The form's ID.
    formname string An arbitrary name for the form.
    type integer The type of form. Integer codes are mapped as follows:
    10 => SmartForm
    11 => ONTRAform
    Any other codes correspond to deprecated form types.
    tags string The tags a contact should be added to upon form fillout.
    sequences string The sequences a contact should be added to upon form fillout.
    campaigns string The campaigns a contact should be added to upon form fillout.Note: These are referred to as automations throughout the Ontraport app.
    redirect string The URL for the thank you page the user is redirected to upon form fillout.
    owner integer The ID of the user controlling the form.
    captcha integer A binary integer flag indicating whether or not the form includes a Captcha. Values are mapped as follows:
    0 => false
    1 => true
    notif string The email address to be notified when the form is filled out.
    fillouts integer The number of times the form has been filled out.
    unique_fillouts integer The percentage of unique users that has filled out the form divided by the number of unique_visits.
    json_raw_object blob JSON-encoded form data.
    deleted integer/boolean A flag indicating whether or not the form has been deleted. Different forms may use either a binary integer or boolean value. If an integer, values are mapped as follows:
    0 => false
    1 => true
    object_type_id integer The ID of the object type associated with the form.
    responsive integer A flag indicating whether or not the form has a responsive layout. Values are mapped as follows:
    0 => false
    1 => true
    visits integer The number of times the form has been visited.
    unique_visits integer The number of times unique visitors have visited the form.
    revenue double The total amount of income accrued from the form (only applies to order and upsell forms).
    date timestamp The date and time the form was created measured in seconds from the Unix Epoch. Note that this field will not contain data for any forms created prior to November 7, 2017.
    dlm timestamp The date and time the form was last modified measured in seconds from the Unix Epoch.

    Retrieve a specific form

    curl -X GET 'https://api.ontraport.com/1/Form?id=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 2
    );
    $response = $client->form()->retrieveSingle($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "form_id": "2",
        "formname": "Test Form",
        "type": "11",
        "tags": null,
        "sequences": null,
        "campaigns": null,
        "redirect": null,
        "owner": "",
        "captcha": "1",
        "notif": null,
        "fillouts": "0",
        "json_raw_object": "0",
        "deleted": "",
        "object_type_id": "0",
        "responsive": "1",
        "visits": "0",
        "unique_visits": "0",
        "revenue": "0.00",
        "date": "1510703743",
        "dlm": "1510703743"
      },
      "account_id": "12345"
    }
    

    Retrieves all the information for an existing form.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Form

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The form ID. Required.

    Retrieve multiple forms

    curl -X GET 'https://api.ontraport.com/1/Forms?sort=type&sortDir=asc&listFields=form_id%2Cformname%2Ctype' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "sort"       => "type",
        "sortDir"    => "asc",
        "listFields" => "form_id,formname,type"
    );
    $response = $client->form()->retrieveMultiple($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": [
        {
          "form_id": "4",
          "formname": "Smart Form",
          "type": "10",
          "owner": ""
        },
        {
          "form_id": "2",
          "formname": "Test ONTRAform",
          "type": "11",
          "owner": ""
        },
        {
          "form_id": "3",
          "formname": "Test ONTRAform 2",
          "type": "11",
          "owner": ""
        }
      ],
      "account_id": "12345",
      "misc": []
    }
    

    Retrieves a collection of forms based on a set of parameters. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Forms

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An integer array as a comma-delimited list of the IDs of the forms to retrieve. Entering a value of 0 will result in all forms being selected.
    start integer The id to start your search after.
    range integer The number of forms you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which forms to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your form objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native form fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.
    externs string If you have a relationship between your form object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve form collection info

    curl -X GET 'https://api.ontraport.com/1/Forms/getInfo?search=Test' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "search"  => "Test"
    );
    $response = $client->form()->retrieveCollectionInfo($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "listFields": [
          "formname",
          "redirect"
        ],
        "listFieldSettings": [],
        "count": "1"
      },
      "account_id": "12345"
    }
    

    Retrieves information about a collection of forms, such as the number of forms that match the given criteria.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Forms/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    condition string A JSON encoded string to more specifically set criteria for which forms to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your form objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native form fields.
    group_id integer The group id of objects to act upon. If set to a non-zero value, performAll should be set to 1.
    performAll integer A binary integer flag to be used in conjunction with group_id. A value of 1 indicates that specified action should be performed on all members of a group. Be sure that group_id has a non-zero value when using this parameter unless you want to affect all objects in a collection.

    Retrieve Smart Form meta

    curl -X GET 'https://api.ontraport.com/1/Forms/meta' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->form()->retrieveMeta();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "122": {
          "name": "SmartFormFE",
          "fields": {
            "formname": {
              "alias": "Form Name",
              "type": "text",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            },
            "redirect": {
              "alias": "Thank You Page",
              "type": "url",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            },
            "fillouts": {
              "alias": "Conversions",
              "type": "numeric",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            },
            "unique_visits": {
              "alias": "Unique Visits",
              "type": "numeric",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            },
            "visits": {
              "alias": "Visits",
              "type": "numeric",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            },
            "type": {
              "alias": "Form Type",
              "type": "drop",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1,
              "options": {
                "1": "Legacy Smart Form",
                "10": "Smart Form",
                "11": "ONTRAform"
              }
            },
            "date": {
              "alias": "Date Created",
              "type": "timestamp",
              "required": 0,
              "unique": 0,
              "editable": 0,
              "deletable": 0
            },
            "dlm": {
              "alias": "Date Modified",
              "type": "timestamp",
              "required": 0,
              "unique": 0,
              "editable": 0,
              "deletable": 0
            },
            "unique_fillouts": {
              "alias": "Conversion Rate",
              "type": "raw_percentage",
              "required": 0,
              "unique": 0,
              "editable": 1,
              "deletable": 1
            }
          }
        }
      },
      "account_id": "12345"
    }
    

    Retrieves the field meta data for a SmartForm. If you want to retrieve meta for another form type, you should use the objects/meta endpoint with the appropriate object ID.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Forms/meta

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    None

    Retrieve Form HTML

    curl -X GET 'https://api.ontraport.com/1/form?id=4' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 4
    );
    $response = $client->form()->retrieveFormHTML($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": "<html>Insert HTML here</html>",
      "account_id": "12345"
    }
    

    Retrieves the HTML for a Form by its ID.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/form

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The ID of the form to retrieve HTML for.

    Retrieve all form blocks

    curl -X GET 'api.ontraport.com/1/Form/getAllFormBlocks' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->form()->retrieveFormBlocks();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "lp1.0.96bbda26-83fa-10ae-dd9a-5381b1fbf3dd": "Form on landingpage",
        "f1": "Standalone form"
      },
      "account_id": "12345"
    }
    

    Retrieves name and ID pairs for all existing form blocks.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Form/getAllFormBlocks

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    page integer The zero-indexed page number. 50 entries are returned per page. Optional.

    Retrieve all blocks for form

    curl -X GET 'api.ontraport.com/1/Form/getBlocksByFormName?name=myLandingPage' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
      "name" => "myLandingPage"
    );
    $response = $client->form()->retrieveBlocksByForm($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "block_ids": [
          "lp1.0.6d1f42fd-4e7f-706b-a20a-bd160bdd0439",
          "lp1.0.d41c1051-a2d8-7c68-d915-4f804185996e"
        ]
      },
      "account_id": "12345"
    }
    

    Retrieves IDs for all form blocks in a specified form or landing page.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/getBlocksByFormName

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    name string The name of the form or landing page. Required.

    Groups

    Object Type ID: 3

    Groups are a way of categorizing types of objects into specific segments based on some criteria.

    The group object

    Group attributes

    Attribute Type Description
    name string The group's name.
    is_public integer
    0 => Everyone can view and delete
    1 => Only owner can view and delete
    2 => Everyone can view, only owner can delete
    object_type_id integer The object's type id.
    writable boolean Whether the group can be edited or not.
    owner integer The user id of the owner of the group.
    conditions object The conditions that define the group
    id integer The group's id.

    Retrieve a specific group

    curl -X GET 'https://api.ontraport.com/1/Group?id=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 2
    );
    $response = $client->group()->retrieveSingle($queryParams);
    

    Example Response:

    {
        "name": "Clicked or Visited - Last 30 days",
        "is_public": "1",
        "object_type_id": "0",
        "writable": true,
        "owner": "1",
        "conditions": {
          "statement": [
            {
              "rule": {
                "field": "dla",
                "condition": "h",
                "value": [
                  "S30DAYS"
                ]
              }
            }
          ]
        },
        "id": "2"
     }
    

    Retrieves all the information for an existing Group.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Group

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The group's ID. Required.

    Retrieve multiple groups

    curl -X GET 'https://api.ontraport.com/1/Groups?range=50&condition=%5B%7B%22field%22%3A%7B%22field%22%3A%22type%22%7D%2C%22op%22%3A%22%3D%22%2C%22value%22%3A%7B%22value%22%3A%220%22%7D%7D%5D \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "sort"       => "type",
        "sortDir"    => "asc",
        "listFields" => "is_public"
    );
    $response = $client->group()->retrieveMultiple($queryParams);
    

    Example Response:

    {
        "code": 0,
        "data": [
            {
                "id": "29",
                "name": "NewGrrrroup",
                "type": "0",
                "owner": "1",
                "listfields": "",
                "public_view": "2",
                "is_public": "1"
            },
            {
                "id": "30",
                "name": "AAAAAAAAAAAAAAAAAAAAAAAAA",
                "type": "0",
                "owner": "1",
                "listfields": "",
                "public_view": "0",
                "is_public": "1"
            }
        ],
        "account_id": 50,
        "misc": []
    }
    

    Retrieves a collection of groups based on a set of parameters. You can limit unnecessary API requests by utilizing criteria and our pagination tools to select only the data set you require.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Groups

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    ids string An integer array as a comma-delimited list of the IDs of the groups to retrieve. Entering a value of 0 will result in all groups being selected.
    start integer The id to start your search after.
    range integer The number of groups you want to retrieve. The maximum and default range is 50.
    sort string The field results should be sorted on.
    sortDir string The direction your results should be sorted. Your options are asc and desc. This field must be used in conjunction with the sort parameter.
    condition string A JSON encoded string to more specifically set criteria for which groups to select. For example, to return only groups that match a specific Object Type ID. See criteria examples for more details.
    search string A string to search your group objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native group fields.
    group_id integer The group id of objects to act upon.
    externs string If you have a relationship between your group object and another object, you may want to include the data from a related field in your results. Each external field is listed in the format {object}//{field}. Multiple fields are separated by commas.
    listFields string A string array as a comma-delimited list of the fields which should be returned in your results.

    Retrieve group collection info

    curl -X GET 'https://api.ontraport.com/1/Groups/getInfo?search=Test' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "search"  => "Test"
    );
    $response = $client->group()->retrieveCollectionInfo($queryParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "listFields": [
          ""
        ],
        "listFieldSettings": [],
        "cardViewSettings": {
          "fields": [
            ""
          ]
        },
        "viewMode": [],
        "count": "14"
      },
      "account_id": 50
    }
    

    Retrieves information about a collection of groups, such as the number of groups that match the given criteria.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Groups/getInfo

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    condition string A JSON encoded string to more specifically set criteria for which groups to select. For example, to check that a field equals a certain value. See criteria examples for more details.
    search string A string to search your group objects for.
    searchNotes boolean A boolean flag used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to native group fields.
    group_id integer The group id of objects to act upon.

    Retrieve Group meta

    curl -X GET 'https://api.ontraport.com/1/Groups/meta' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $response = $client->group()->retrieveMeta();
    

    Example Response:

    {
      "code": 0,
      "data": {
        "3": {
          "name": "Group",
          "fields": {}
        }
      },
      "account_id": 50
    }
    

    Retrieves the field meta data for a Group.

    TRY IT OUT LIVE

    Request Endpoint

    GET https://api.ontraport.com/1/Groups/meta

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    None

    Delete a specific group

    curl -X DELETE 'https://api.ontraport.com/1/Group?id=2' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $queryParams = array(
        "id"  => 2
    );
    $response = $client->group()->deleteSingle($queryParams);
    

    Example Response:

    {
      "code": 0,
      "account_id": 50
    }
    

    Deletes an existing Group.

    TRY IT OUT LIVE

    Request Endpoint

    DELETE https://api.ontraport.com/1/Group

    Required Headers

    Api-Key: {api_key}

    Api-Appid: {app_id}

    Request Parameters

    Request parameters should be appended to the URL as a query string.

    Parameter Type Description
    id integer The group's ID. Required.

    Landing Pages

    Object Type ID: 20

    Landing page objects contain the data for one-off web pages a prospect can land on after clicking on an online marketing call-to-action.

    We support professionally designed ONTRApage templates as well as redirects to other landing pages, "code mode" and legacy HTML pages.

    Through the API, you can retrieve one or more landing pages and retrieve the hosted URL for a specific landing page. You can also retrieve meta for a landing page object to obtain more detailed information about its attributes and retrieve information about a collection of landing pages.

    The landing page object

    {
        "id": "1",
        "uri_id": null,
        "resource": "[{\"templateId\":84,\"status\":true,\"blocks\":[{\"alias\":\"Banner\",\"blockId\":\"20\",\"blockTypeId\":3,\"id\":\"527f664f-a6a4-8e9d-634e-26c041d2bee5\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/20_event_banner\\/\",\"scripts\":\" \\/*block scripts*\\/\",\"theme\":{\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"header-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"h1\\\">COMING SOON<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Header\"}},{\"id\":\"subHeader-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"  opt-palette-editor__text-area h2   h2 h2\\\">Yes you're on the right page, but its not quite ready.<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Sub-Header\"}},{\"id\":\"header-group\",\"type\":\"group\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"alias\":\"header group\",\"visibility\":\"visible\"}},{\"id\":\"logo-1\",\"type\":\"image\",\"for\":null,\"tag\":\"IMG\",\"attrs\":{\"src\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.47135abcc7e84179f73c77f9e8f8af1b.PNG\",\"options\":false,\"visibility\":\"visible\",\"alias\":\"Logo\"}},{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\"}},{\"id\":\"tagline-1\",\"type\":\"html\",\"for\":null,\"tag\":\"H3\",\"attrs\":{\"html\":\" JOIN OUR LIVE WEBINAR \",\"visibility\":\"hidden\",\"options\":false,\"help\":false,\"alias\":\"Tagline\"}},{\"id\":\"date-1\",\"type\":\"html\",\"for\":null,\"tag\":\"H1\",\"attrs\":{\"html\":\" DECEMBER 25, 2015 \\/\\/ 1:00PM PST \",\"visibility\":\"hidden\",\"options\":false,\"help\":false,\"alias\":\"Date\"}},{\"id\":\"button-1\",\"type\":\"button\",\"for\":null,\"tag\":\"A\",\"attrs\":{\"visibility\":\"hidden\",\"alias\":\"Button\",\"html\":\"\\n               SIGN ME UP\\n            \",\"href\":\"javascript:\\/\\/\",\"target\":\"_self\",\"file_name\":null,\"page_select\":null,\"url_type\":null,\"src\":null,\"link_background\":\"\",\"hover_bg\":\"\",\"hover_text\":\"\"}}],\"visibility\":true,\"permissionLevel\":\"free\"},{\"alias\":\"Countdown timer\",\"blockId\":\"119\",\"blockTypeId\":22,\"id\":\"b681e5f2-2c31-a251-f0f6-fa5bb76469d8\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/119_count_down_timer\\/\",\"scripts\":\"\\/*block scripts*\\/\\n\\n\",\"theme\":{\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"header-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\" opt-palette-editor__text-area h3   h3 h3\\\">PAGE WILL BE READY IN&nbsp;:<\\/span>\\n        \",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Header\"}},{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\"}}],\"visibility\":true,\"permissionLevel\":\"premium\"},{\"alias\":\"Smart form\",\"blockId\":\"130\",\"blockTypeId\":10,\"id\":\"bd440856-4d06-bedf-1302-eb5f220c29e9\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/130_horizontal_text_and_form\\/\",\"scripts\":\" \\/*block scripts*\\/\",\"theme\":{\"spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-bottom\":\"100px\"}}}},\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\",\"fixed-width-default\":false}},{\"id\":\"bodyText-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\" opt-palette-editor__text-area  body-text body-text\\\">Enter you name & Email and we will let you know when its ready.<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Body Text\"}}],\"visibility\":true,\"direction\":1,\"settings\":{\"opt_in_settings\":\"single\",\"conditionsCustomUrl\":\"\",\"conditionsRedirectRadioButtons\":\"default\",\"form_contacts_thank_you_page_redir\":\"0\",\"singleCustomUrl\":\"\",\"thankYouRedirectRadioButtons\":\"default\",\"singleLandPageSelect\":\"\",\"conditionsLandPageSelect\":\"\",\"conditionsPopOntraformSelect\":\"\",\"confirmation_email\":\"\",\"tags\":[],\"sequences\":[],\"rules_default\":[],\"rules_transaction_fail\":[],\"notif\":\"\",\"cookie_overide\":\"0\",\"cgi\":\"0\",\"owner\":false,\"tyPopOntraformSelect\":\"\"},\"permissionLevel\":\"free\"}],\"settings\":{\"domain\":null,\"visits\":null,\"conversions\":null,\"design_type\":null,\"object_type_id\":null,\"listFields\":null,\"listFieldSettings\":null,\"count\":null,\"lpsent\":null,\"lpconvert\":null,\"id\":null,\"uri_id\":null,\"rotation\":null,\"last_save\":null,\"last_auto\":null,\"autosave\":null,\"visits_0\":null,\"visits_1\":null,\"visits_2\":null,\"visits_3\":null,\"platform\":null,\"ssl_enabled\":null,\"blocks\":null,\"block_type_id\":null,\"a_sent\":null,\"a_convert\":null,\"b_sent\":null,\"b_convert\":null,\"c_sent\":null,\"c_convert\":null,\"d_sent\":null,\"d_convert\":null,\"conditionsCustomUrl\":\"\",\"singleCustomUrl\":\"\",\"notif\":\"\",\"owner\":\"\",\"ontraformInstanceTimedOrUserScroll\":{\"opfActiveCheckbox\":\"0\",\"opfSettings\":{\"popPositionValue\":\"mc\",\"onScrollTo\":\"0\",\"onScrollToValue\":\"45\",\"onVisitDuration\":\"0\",\"onVisitDurationValue\":\"2\",\"filloutRestrictions\":\"0\",\"frequencyRestrictions\":\"1\",\"frequencyRestrictionsMaxTriggers\":2,\"frequencyRestrictionsTimeframe\":1}},\"ontraformInstanceExitIntent\":{\"opfActiveCheckbox\":\"0\",\"opfSettings\":{\"popPositionValue\":\"mc\",\"filloutRestrictions\":\"0\",\"frequencyRestrictions\":\"1\",\"frequencyRestrictionsMaxTriggers\":2,\"frequencyRestrictionsTimeframe\":1}},\"page_title\":\"\",\"meta_description\":\"\",\"header_custom_script\":\"\",\"footer_custom_script\":\"\",\"favicon_uploader\":\"\\/\\/app.ontraport.com\\/favicon.ico\",\"sort_items\":\"newest\",\"search_items\":{\"search\":\"\"}},\"theme\":{\"theme_font\":{\"children\":{\"h1, ~h1~h1\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"96px\",\"line-height\":\"98px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"h2, ~h2~h2\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"34px\",\"line-height\":\"36px\",\"font-weight\":\"100\",\"font-style\":\"italic\"}},\"h3, ~h3~h3\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"22px\",\"line-height\":\"24px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"~label~label\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~button~button\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"22px\",\"line-height\":\"24px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~large-body-text~large-body-text\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"20px\",\"line-height\":\"22px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"~body-text~body-text\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"blockquote, ~blockquote\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"400\",\"font-style\":\"italic\"}}}},\"theme_colors\":{\"primary-color\":\"#17a4d1\",\"complimentary-color\":\"#328ed3\",\"dark-color\":\"#91cd47\",\"light-color\":\"#e9f4da\",\"white-color\":\"#ffffff\"},\"theme_background\":{\"id\":\"template-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.1f36335d542d468765dd98e598ffbf9f.PNG\",\"options\":[\"backgrounds\"],\"alias\":\"background\",\"src\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.1f36335d542d468765dd98e598ffbf9f.PNG\"}},\"theme_spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-top\":\"20px\",\"padding-bottom\":\"20px\"}}}}},\"templateData\":{\"account_id\":\"0\",\"remote_item_id\":\"0\",\"status\":\"approved\",\"share_type\":\"marketplace\",\"share_subtype\":\"free\",\"purchase_conditions\":\"\",\"featured\":\"1\",\"name\":\"Launchpad\",\"price\":\"0.00\",\"type\":\"Landing Page\",\"date\":\"1441818555\",\"date_approved\":\"0\",\"approved_by\":\"0\",\"dlm\":\"1445879184\",\"description\":\"Start the countdown with Launchpad. This template is a single, above the fold page that highlights a countdown timer, an icon image, a few lines of copy and a contact form.\",\"thumbnail\":\"https:\\/\\/app.ontraport.com\\/js\\/ontraport\\/opt_assets\\/templates\\/template_thumbs\\/84_thumbnail.png\",\"resource\":{\"templateId\":84,\"status\":true,\"blocks\":[{\"alias\":\"Banner\",\"blockId\":\"20\",\"blockTypeId\":3,\"id\":\"527f664f-a6a4-8e9d-634e-26c041d2bee5\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/20_event_banner\\/\",\"scripts\":\" \\/*block scripts*\\/\",\"theme\":{\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"header-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"h1\\\">COMING SOON<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Header\"}},{\"id\":\"subHeader-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"  opt-palette-editor__text-area h2   h2 h2\\\">Yes you're on the right page, but its not quite ready.<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Sub-Header\"}},{\"id\":\"header-group\",\"type\":\"group\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"alias\":\"header group\",\"visibility\":\"visible\"}},{\"id\":\"logo-1\",\"type\":\"image\",\"for\":null,\"tag\":\"IMG\",\"attrs\":{\"src\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.47135abcc7e84179f73c77f9e8f8af1b.PNG\",\"options\":false,\"visibility\":\"visible\",\"alias\":\"Logo\"}},{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\"}},{\"id\":\"tagline-1\",\"type\":\"html\",\"for\":null,\"tag\":\"H3\",\"attrs\":{\"html\":\" JOIN OUR LIVE WEBINAR \",\"visibility\":\"hidden\",\"options\":false,\"help\":false,\"alias\":\"Tagline\"}},{\"id\":\"date-1\",\"type\":\"html\",\"for\":null,\"tag\":\"H1\",\"attrs\":{\"html\":\" DECEMBER 25, 2015 \\/\\/ 1:00PM PST \",\"visibility\":\"hidden\",\"options\":false,\"help\":false,\"alias\":\"Date\"}},{\"id\":\"button-1\",\"type\":\"button\",\"for\":null,\"tag\":\"A\",\"attrs\":{\"visibility\":\"hidden\",\"alias\":\"Button\",\"html\":\"\\n               SIGN ME UP\\n            \",\"href\":\"javascript:\\/\\/\",\"target\":\"_self\",\"file_name\":null,\"page_select\":null,\"url_type\":null,\"src\":null,\"link_background\":\"\",\"hover_bg\":\"\",\"hover_text\":\"\"}}],\"visibility\":true},{\"alias\":\"Countdown timer\",\"blockId\":\"119\",\"blockTypeId\":22,\"id\":\"b681e5f2-2c31-a251-f0f6-fa5bb76469d8\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/119_count_down_timer\\/\",\"scripts\":\"\\/*block scripts*\\/\\n\\n$(function(){\\n    var $blockStyle119 = $( \\\".block-style-119\\\" );\\n\\n    \\/* Script applies a font size and line height that are 20px larger than the specified sizes. *\\/\\n    $blockStyle119.each(function( index, element ) {\\n        var $style = $( \\\"<style\\/>\\\" ).addClass( \\\"block-style-119-font-style\\\"),\\n            $element = $( element ),\\n            $countdownItem = $element.find( \\\".block-style-119__count-down-item\\\" ).first(),\\n            _itemFontSize = $countdownItem.css(\\\"fontSize\\\").replace(\\\"px\\\", \\\"\\\"),\\n            _itemLineHeight = $countdownItem.css(\\\"lineHeight\\\").replace(\\\"px\\\", \\\"\\\");\\n\\n        _itemFontSize = +_itemFontSize + 20;\\n\\n        _itemLineHeight = +_itemLineHeight + 20;\\n\\n        $element.find( \\\"style.block-style-119-font-style\\\").remove();\\n\\n        $element.prepend( $style.html( \\\".h1.block-style-119__count-down-item { font-size: \\\" + _itemFontSize + \\\"px; line-height: \\\" + _itemLineHeight + \\\"px; }\\\" ) );\\n\\n    });\\n});\\n\\n\",\"theme\":{\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"header-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\" opt-palette-editor__text-area h3   h3 h3\\\">PAGE WILL BE READY IN&nbsp;:<\\/span>\\n        \",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Header\"}},{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\"}}],\"visibility\":true},{\"alias\":\"Smart form\",\"blockId\":\"130\",\"blockTypeId\":10,\"id\":\"bd440856-4d06-bedf-1302-eb5f220c29e9\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/130_horizontal_text_and_form\\/\",\"scripts\":\" \\/*block scripts*\\/\",\"theme\":{\"spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-bottom\":\"100px\"}}}},\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\",\"fixed-width-default\":false}},{\"id\":\"bodyText-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\" opt-palette-editor__text-area  body-text body-text\\\">Enter you name & Email and we will let you know when its ready.<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Body Text\"}}],\"visibility\":true,\"direction\":1,\"settings\":{\"opt_in_settings\":\"single\",\"conditionsCustomUrl\":\"\",\"conditionsRedirectRadioButtons\":\"default\",\"form_contacts_thank_you_page_redir\":\"0\",\"singleCustomUrl\":\"\",\"thankYouRedirectRadioButtons\":\"default\",\"singleLandPageSelect\":\"\",\"conditionsLandPageSelect\":\"\",\"conditionsPopOntraformSelect\":\"\",\"confirmation_email\":\"\",\"tags\":[],\"sequences\":[],\"rules_default\":[],\"rules_transaction_fail\":[],\"notif\":\"\",\"cookie_overide\":\"0\",\"cgi\":\"0\",\"owner\":false,\"tyPopOntraformSelect\":\"\"}}],\"settings\":{\"domain\":null,\"visits\":null,\"conversions\":null,\"design_type\":null,\"listFields\":null,\"listFieldSettings\":null,\"count\":null,\"lpsent\":null,\"lpconvert\":null,\"id\":null,\"uri_id\":null,\"rotation\":null,\"last_save\":null,\"last_auto\":null,\"autosave\":null,\"visits_0\":null,\"visits_1\":null,\"visits_2\":null,\"visits_3\":null,\"platform\":null,\"ssl_enabled\":null,\"type\":\"landing_page\",\"blocks\":null,\"block_type_id\":null,\"a_sent\":null,\"a_convert\":null,\"b_sent\":null,\"b_convert\":null,\"c_sent\":null,\"c_convert\":null,\"d_sent\":null,\"d_convert\":null,\"object_type_id\":null,\"conditionsCustomUrl\":\"\",\"singleCustomUrl\":\"\",\"page_title\":\"\",\"meta_description\":\"\",\"header_custom_script\":\"\",\"footer_custom_script\":\"\",\"favicon_uploader\":\"\\/\\/app.ontraport.com\\/favicon.ico\",\"notif\":\"\",\"owner\":\"\",\"opt_canvas\":[],\"opt_palette\":[]},\"theme\":{\"theme_font\":{\"children\":{\"h1, ~h1~h1\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"96px\",\"line-height\":\"98px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"h2, ~h2~h2\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"34px\",\"line-height\":\"36px\",\"font-weight\":\"100\",\"font-style\":\"italic\"}},\"h3, ~h3~h3\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"22px\",\"line-height\":\"24px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"~label~label\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~button~button\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"22px\",\"line-height\":\"24px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~large-body-text~large-body-text\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"20px\",\"line-height\":\"22px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"~body-text~body-text\":{\"attributes\":{\"font-family\":\"'Roboto', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"blockquote, ~blockquote\":{\"attributes\":{\"font-family\":\"'Dosis', sans-serif\",\"font-size\":\"16px\",\"line-height\":\"18px\",\"font-weight\":\"400\",\"font-style\":\"italic\"}}}},\"theme_colors\":{\"primary-color\":\"#17a4d1\",\"complimentary-color\":\"#328ed3\",\"dark-color\":\"#91cd47\",\"light-color\":\"#e9f4da\",\"white-color\":\"#ffffff\"},\"theme_background\":{\"id\":\"template-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.1f36335d542d468765dd98e598ffbf9f.PNG\",\"options\":[\"backgrounds\"],\"alias\":\"background\",\"src\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.1f36335d542d468765dd98e598ffbf9f.PNG\"}},\"theme_spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-top\":\"20px\",\"padding-bottom\":\"20px\"}}}}}},\"industries\":null,\"types\":null,\"tags\":null,\"opt_template_categories\":\" featured free\",\"id\":\"84\",\"displayObjectNotFoundErrors\":true},\"version\":\"v2\",\"mergedData\":\"<!DOCTYPE html><html><head> <!-- This page was built using ONTRApages. Create and host your pages free at ONTRApages.com or learn more about the most powerful business and marketing automation platform designed for entrepreneurs at Ontraport.com --> <meta charset=\\\"utf-8\\\"> <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\"> <link rel=\\\"stylesheet\\\" href=\\\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/skeleton\\/css\\/normalize.css\\\"> <link rel=\\\"stylesheet\\\" href=\\\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/skeleton\\/css\\/skeleton.css\\\"> <link rel=\\\"stylesheet\\\" href=\\\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/skeleton\\/css\\/skeleton.ontraport.css\\\"> <link rel=\\\"stylesheet\\\" href=\\\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/skeleton\\/css\\/fonts.css\\\"> <link rel=\\\"stylesheet\\\" href=\\\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/css\\/wysihtml5-textalign.css\\\"> <!--OPT-CUSTOM-HEADER-SCRIPT--><style class=\\\"theme-style\\\">h1, .h1.h1 { font-family: 'Dosis', sans-serif; font-size: 96px; line-height: 98px; font-weight: 100; text-decoration: inherit;}h2, .h2.h2 { font-family: 'Roboto', sans-serif; font-size: 34px; line-height: 36px; font-weight: 100; font-style: italic; text-decoration: inherit;}h3, .h3.h3 { font-family: 'Roboto', sans-serif; font-size: 22px; line-height: 24px; font-weight: 400; text-decoration: inherit;}.label.label { font-family: 'Dosis', sans-serif; font-size: 16px; line-height: 18px; font-weight: 600; text-decoration: inherit;}.button.button { font-family: 'Dosis', sans-serif; font-size: 22px; line-height: 24px; font-weight: 600; text-decoration: inherit;}.large-body-text.large-body-text { font-family: 'Roboto', sans-serif; font-size: 20px; line-height: 22px; font-weight: 400; text-decoration: inherit;}.body-text.body-text { font-family: 'Roboto', sans-serif; font-size: 16px; line-height: 18px; font-weight: 100; text-decoration: inherit;}blockquote, .blockquote { font-family: 'Dosis', sans-serif; font-size: 16px; line-height: 18px; font-weight: 400; font-style: italic; text-decoration: inherit;}.bb.bb.bb { color: #91cd47;}.v.v.v { color: #ffffff;}.ak.ak.ak { background-color: #ffffff;}.i.i.i { background-color: #91cd47;}.at.at.at, .at.at.at a { color: #ffffff; background-color: #17a4d1;}.q.q.q, .q.q.q a { color: #17a4d1; background-color: #ffffff;}.aw.aw.aw { background-color: #e9f4da;}.as.as.as { border-color: #91cd47;}.al.al { color: #91cd47;}.al.al.al:hover { color: #17a4d1;}.ba.ba.ba { color: #17a4d1;}.ba.ba.ba:hover { color: #91cd47;}hr.bc.bc.bc, span.bc.bc.bc, h1.bc.bc.bc, h2.bc.bc.bc, h3.bc.bc.bc, p.bc.bc.bc, .an.an.an { color: #17a4d1;}hr.bc.bc.bc, table.bc.bc.bc, div.bc.bc.bc, a.bc.bc.bc, .x.x.x { background-color: #17a4d1;}hr.bc.bc.bc, img.bc.bc.bc, a.bc.bc.bc, div.bc.bc.bc, .aj.aj.aj { border-color: #17a4d1;}hr.am.am.am, span.am.am.am, h1.am.am.am, h2.am.am.am, h3.am.am.am, p.am.am.am, .u.u.u { color: #328ed3;}hr.am.am.am, table.am.am.am, div.am.am.am, a.am.am.am, .h.h.h { background-color: #328ed3;}hr.am.am.am, img.am.am.am, a.am.am.am, div.am.am.am, .o.o.o { border-color: #328ed3;}hr.bf.bf.bf, span.bf.bf.bf, h1.bf.bf.bf, h2.bf.bf.bf, h3.bf.bf.bf, p.bf.bf.bf, .ax.ax.ax { color: #91cd47;}hr.bf.bf.bf, table.bf.bf.bf, div.bf.bf.bf, a.bf.bf.bf, .ah.ah.ah { background-color: #91cd47;}hr.bf.bf.bf, img.bf.bf.bf, a.bf.bf.bf, div.bf.bf.bf, .aq.aq.aq { border-color: #91cd47;}hr.be.be.be, span.be.be.be, h1.be.be.be, h2.be.be.be, h3.be.be.be, p.be.be.be, .ar.ar.ar { color: #e9f4da;}hr.be.be.be, table.be.be.be, div.be.be.be, a.be.be.be, .ad.ad.ad { background-color: #e9f4da;}hr.be.be.be, img.be.be.be, a.be.be.be, div.be.be.be, .ao.ao.ao { border-color: #e9f4da;}hr.bd.bd.bd, span.bd.bd.bd, h1.bd.bd.bd, h2.bd.bd.bd, h3.bd.bd.bd, p.bd.bd.bd, .au.au.au { color: #ffffff;}hr.bd.bd.bd, table.bd.bd.bd, div.bd.bd.bd, a.bd.bd.bd, .ab.ab.ab { background-color: #ffffff;}hr.bd.bd.bd, img.bd.bd.bd, a.bd.bd.bd, div.bd.bd.bd, .ap.ap.ap { border-color: #ffffff;}a { color: #17a4d1; text-decoration: none;}a:hover { text-decoration: underline;}.spacing { padding-top: 20px; padding-bottom: 20px;}<\\/style><style class=\\\"block-theme-css\\\">.b .bb.bb.bb { color: #ffffff;}.b .v.v.v { color: #17a4d1;}.b .ak.ak.ak { background-color: #17a4d1;}.b .i.i.i { background-color: #ffffff;}.b .at.at.at,.b .at.at.at a { color: #17a4d1; background-color: #ffffff;}.b .q.q.q,.b .q.q.q a { color: #ffffff; background-color: #17a4d1;}.b .aw.aw.aw { background-color: #ffffff;}.b .as.as.as { border-color: #ffffff;}.b .al.al.al { color: #ffffff;}.b .al.al.al:hover { color: #91cd47;}.b .ba.ba.ba { color: #ffffff;}.b .ba.ba.ba:hover { color: #91cd47;}.b hr.bc.bc.bc,.b span.bc.bc.bc,.b h1.bc.bc.bc,.b h2.bc.bc.bc,.b h3.bc.bc.bc,.b p.bc.bc.bc,.b .an.an.an { color: #e9f4da;}.b hr.bc.bc.bc,.b table.bc.bc.bc,.b div.bc.bc.bc,.b a.bc.bc.bc,.b .x.x.x { background-color: #e9f4da;}.b hr.bc.bc.bc,.b img.bc.bc.bc,.b a.bc.bc.bc,.b div.bc.bc.bc,.b .aj.aj.aj { border-color: #e9f4da;}.b hr.am.am.am,.b span.am.am.am,.b h1.am.am.am,.b h2.am.am.am,.b h3.am.am.am,.b p.am.am.am,.b .u.u.u { color: #328ed3;}.b hr.am.am.am,.b table.am.am.am,.b div.am.am.am,.b a.am.am.am,.b .h.h.h { background-color: #328ed3;}.b hr.am.am.am,.b img.am.am.am,.b a.am.am.am,.b div.am.am.am,.b .o.o.o { border-color: #328ed3;}.b hr.bf.bf.bf,.b span.bf.bf.bf,.b h1.bf.bf.bf,.b h2.bf.bf.bf,.b h3.bf.bf.bf,.b p.bf.bf.bf,.b .ax.ax.ax { color: #ffffff;}.b hr.bf.bf.bf,.b table.bf.bf.bf,.b div.bf.bf.bf,.b a.bf.bf.bf,.b .ah.ah.ah { background-color: #ffffff;}.b hr.bf.bf.bf,.b img.bf.bf.bf,.b a.bf.bf.bf,.b div.bf.bf.bf,.b .aq.aq.aq { border-color: #ffffff;}.b hr.be.be.be,.b span.be.be.be,.b h1.be.be.be,.b h2.be.be.be,.b h3.be.be.be,.b p.be.be.be,.b .ar.ar.ar { color: #e9f4da;}.b hr.be.be.be,.b table.be.be.be,.b div.be.be.be,.b a.be.be.be,.b .ad.ad.ad { background-color: #e9f4da;}.b hr.be.be.be,.b img.be.be.be,.b a.be.be.be,.b div.be.be.be,.b .ao.ao.ao { border-color: #e9f4da;}.b hr.bd.bd.bd,.b span.bd.bd.bd,.b h1.bd.bd.bd,.b h2.bd.bd.bd,.b h3.bd.bd.bd,.b p.bd.bd.bd,.b .au.au.au { color: #17a4d1;}.b hr.bd.bd.bd,.b table.bd.bd.bd,.b div.bd.bd.bd,.b a.bd.bd.bd,.b .ab.ab.ab { background-color: #17a4d1;}.b hr.bd.bd.bd,.b img.bd.bd.bd,.b a.bd.bd.bd,.b div.bd.bd.bd,.b .ap.ap.ap { border-color: #17a4d1;}.b a { color: #17a4d1; text-decoration: none;}.b a:hover { text-decoration: underline;}.c .bb.bb.bb { color: #ffffff;}.c .v.v.v { color: #17a4d1;}.c .ak.ak.ak { background-color: #17a4d1;}.c .i.i.i { background-color: #ffffff;}.c .at.at.at,.c .at.at.at a { color: #17a4d1; background-color: #ffffff;}.c .q.q.q,.c .q.q.q a { color: #ffffff; background-color: #17a4d1;}.c .aw.aw.aw { background-color: #ffffff;}.c .as.as.as { border-color: #ffffff;}.c .al.al.al { color: #ffffff;}.c .al.al.al:hover { color: #91cd47;}.c .ba.ba.ba { color: #ffffff;}.c .ba.ba.ba:hover { color: #91cd47;}.c hr.bc.bc.bc,.c span.bc.bc.bc,.c h1.bc.bc.bc,.c h2.bc.bc.bc,.c h3.bc.bc.bc,.c p.bc.bc.bc,.c .an.an.an { color: #e9f4da;}.c hr.bc.bc.bc,.c table.bc.bc.bc,.c div.bc.bc.bc,.c a.bc.bc.bc,.c .x.x.x { background-color: #e9f4da;}.c hr.bc.bc.bc,.c img.bc.bc.bc,.c a.bc.bc.bc,.c div.bc.bc.bc,.c .aj.aj.aj { border-color: #e9f4da;}.c hr.am.am.am,.c span.am.am.am,.c h1.am.am.am,.c h2.am.am.am,.c h3.am.am.am,.c p.am.am.am,.c .u.u.u { color: #328ed3;}.c hr.am.am.am,.c table.am.am.am,.c div.am.am.am,.c a.am.am.am,.c .h.h.h { background-color: #328ed3;}.c hr.am.am.am,.c img.am.am.am,.c a.am.am.am,.c div.am.am.am,.c .o.o.o { border-color: #328ed3;}.c hr.bf.bf.bf,.c span.bf.bf.bf,.c h1.bf.bf.bf,.c h2.bf.bf.bf,.c h3.bf.bf.bf,.c p.bf.bf.bf,.c .ax.ax.ax { color: #ffffff;}.c hr.bf.bf.bf,.c table.bf.bf.bf,.c div.bf.bf.bf,.c a.bf.bf.bf,.c .ah.ah.ah { background-color: #ffffff;}.c hr.bf.bf.bf,.c img.bf.bf.bf,.c a.bf.bf.bf,.c div.bf.bf.bf,.c .aq.aq.aq { border-color: #ffffff;}.c hr.be.be.be,.c span.be.be.be,.c h1.be.be.be,.c h2.be.be.be,.c h3.be.be.be,.c p.be.be.be,.c .ar.ar.ar { color: #e9f4da;}.c hr.be.be.be,.c table.be.be.be,.c div.be.be.be,.c a.be.be.be,.c .ad.ad.ad { background-color: #e9f4da;}.c hr.be.be.be,.c img.be.be.be,.c a.be.be.be,.c div.be.be.be,.c .ao.ao.ao { border-color: #e9f4da;}.c hr.bd.bd.bd,.c span.bd.bd.bd,.c h1.bd.bd.bd,.c h2.bd.bd.bd,.c h3.bd.bd.bd,.c p.bd.bd.bd,.c .au.au.au { color: #17a4d1;}.c hr.bd.bd.bd,.c table.bd.bd.bd,.c div.bd.bd.bd,.c a.bd.bd.bd,.c .ab.ab.ab { background-color: #17a4d1;}.c hr.bd.bd.bd,.c img.bd.bd.bd,.c a.bd.bd.bd,.c div.bd.bd.bd,.c .ap.ap.ap { border-color: #17a4d1;}.c a { color: #17a4d1; text-decoration: none;}.c a:hover { text-decoration: underline;}.a .spacing { padding-bottom: 100px;}.a .bb.bb.bb { color: #ffffff;}.a .v.v.v { color: #17a4d1;}.a .ak.ak.ak { background-color: #17a4d1;}.a .i.i.i { background-color: #ffffff;}.a .at.at.at,.a .at.at.at a { color: #17a4d1; background-color: #ffffff;}.a .q.q.q,.a .q.q.q a { color: #ffffff; background-color: #17a4d1;}.a .aw.aw.aw { background-color: #ffffff;}.a .as.as.as { border-color: #ffffff;}.a .al.al.al { color: #ffffff;}.a .al.al.al:hover { color: #91cd47;}.a .ba.ba.ba { color: #ffffff;}.a .ba.ba.ba:hover { color: #91cd47;}.a hr.bc.bc.bc,.a span.bc.bc.bc,.a h1.bc.bc.bc,.a h2.bc.bc.bc,.a h3.bc.bc.bc,.a p.bc.bc.bc,.a .an.an.an { color: #e9f4da;}.a hr.bc.bc.bc,.a table.bc.bc.bc,.a div.bc.bc.bc,.a a.bc.bc.bc,.a .x.x.x { background-color: #e9f4da;}.a hr.bc.bc.bc,.a img.bc.bc.bc,.a a.bc.bc.bc,.a div.bc.bc.bc,.a .aj.aj.aj { border-color: #e9f4da;}.a hr.am.am.am,.a span.am.am.am,.a h1.am.am.am,.a h2.am.am.am,.a h3.am.am.am,.a p.am.am.am,.a .u.u.u { color: #328ed3;}.a hr.am.am.am,.a table.am.am.am,.a div.am.am.am,.a a.am.am.am,.a .h.h.h { background-color: #328ed3;}.a hr.am.am.am,.a img.am.am.am,.a a.am.am.am,.a div.am.am.am,.a .o.o.o { border-color: #328ed3;}.a hr.bf.bf.bf,.a span.bf.bf.bf,.a h1.bf.bf.bf,.a h2.bf.bf.bf,.a h3.bf.bf.bf,.a p.bf.bf.bf,.a .ax.ax.ax { color: #ffffff;}.a hr.bf.bf.bf,.a table.bf.bf.bf,.a div.bf.bf.bf,.a a.bf.bf.bf,.a .ah.ah.ah { background-color: #ffffff;}.a hr.bf.bf.bf,.a img.bf.bf.bf,.a a.bf.bf.bf,.a div.bf.bf.bf,.a .aq.aq.aq { border-color: #ffffff;}.a hr.be.be.be,.a span.be.be.be,.a h1.be.be.be,.a h2.be.be.be,.a h3.be.be.be,.a p.be.be.be,.a .ar.ar.ar { color: #e9f4da;}.a hr.be.be.be,.a table.be.be.be,.a div.be.be.be,.a a.be.be.be,.a .ad.ad.ad { background-color: #e9f4da;}.a hr.be.be.be,.a img.be.be.be,.a a.be.be.be,.a div.be.be.be,.a .ao.ao.ao { border-color: #e9f4da;}.a hr.bd.bd.bd,.a span.bd.bd.bd,.a h1.bd.bd.bd,.a h2.bd.bd.bd,.a h3.bd.bd.bd,.a p.bd.bd.bd,.a .au.au.au { color: #17a4d1;}.a hr.bd.bd.bd,.a table.bd.bd.bd,.a div.bd.bd.bd,.a a.bd.bd.bd,.a .ab.ab.ab { background-color: #17a4d1;}.a hr.bd.bd.bd,.a img.bd.bd.bd,.a a.bd.bd.bd,.a div.bd.bd.bd,.a .ap.ap.ap { border-color: #17a4d1;}.a a { color: #17a4d1; text-decoration: none;}.a a:hover { text-decoration: underline;}<\\/style><link rel=\\\"shortcut icon\\\" type=\\\"image\\/x-icon\\\" href=\\\"\\/\\/app.ontraport.com\\/favicon.ico\\\"><link rel=\\\"dns-prefetch\\\" href=\\\"https:\\/\\/optassets.ontraport.com\\\"><link rel=\\\"dns-prefetch\\\" href=\\\"\\/\\/ajax.googleapis.com\\\"><link rel=\\\"dns-prefetch\\\" href=\\\"\\/\\/app.ontraport.com\\\"><link rel=\\\"dns-prefetch\\\" href=\\\"\\/\\/optassets.ontraport.com\\\"><\\/head><body> <div class=\\\"opt-container\\\" opt-id=\\\"template-background\\\" opt-type=\\\"background\\\" style=\\\"background-size: cover; background-image: url(&quot;https:\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.1f36335d542d468765dd98e598ffbf9f.PNG&quot;);\\\" opt-options=\\\"[&quot;backgrounds&quot;]\\\" opt-alias=\\\"background\\\"><div><div class=\\\"row b\\\" opt-id=\\\"527f664f-a6a4-8e9d-634e-26c041d2bee5\\\" opt-type=\\\"block\\\" opt-block-type-id=\\\"3\\\" opt-block-style-id=\\\"20\\\"><div class=\\\"block-style\\\"><style class=\\\"block-css\\\">\\/*block styles*\\/ .az { text-align: center; width: 100%; background-position: center center;} .af { max-width: 100%;} .ac,.s,.z,.p { margin-bottom: 20px;} .l { padding: 40px 0;} .r { margin-bottom: 40px; margin-top:0;}.j { margin-bottom: 0;} .r,.j { border: 0; height: 1px;} .w { display: block;} .ae { margin-top: 30px; padding-top: 15px; padding-bottom: 15px; min-width: 150px;}<\\/style> <div class=\\\"block-wrapper az ak spacing\\\" style=\\\"background-color: transparent; background-image: none;\\\"> <div class=\\\"container body-text\\\"> <div aria-description=\\\"Event Banner\\\"> <img src=\\\"https:\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.47135abcc7e84179f73c77f9e8f8af1b.PNG\\\" class=\\\"af\\\"> <div class=\\\"l\\\"> <hr class=\\\"ah r\\\"> <div class=\\\"ac bb\\\"><span class=\\\"h1\\\">COMING SOON<\\/span><\\/div> <div class=\\\"s bb\\\"><span class=\\\" opt-palette-editor__text-area h2 h2 h2\\\">Yes you're on the right page, but its not quite ready.<\\/span><\\/div> <hr class=\\\"ah j\\\"> <\\/div> <\\/div> <\\/div><\\/div> <\\/div><\\/div><div class=\\\"row c\\\" opt-id=\\\"b681e5f2-2c31-a251-f0f6-fa5bb76469d8\\\" opt-type=\\\"block\\\" opt-block-type-id=\\\"22\\\" opt-block-style-id=\\\"119\\\"><div class=\\\"block-style\\\"><style class=\\\"block-css\\\">\\/*block styles*\\/ .aa { max-width: 100%; margin-bottom: 10px;} .d { display: block;} .f { list-style: none; max-width: 85%; margin-left: auto; margin-right: auto; word-wrap: break-word;} .f li { display: inline-block; margin-right: 30px; min-width: 125px;} .g { margin-bottom: 0;}<\\/style> <div class=\\\"block-wrapper ak block-style-119 spacing\\\" style=\\\"background-color: transparent; background-image: none;\\\"> <div class=\\\"container opt-center\\\"> <div class=\\\"aa bb\\\"><span class=\\\" opt-palette-editor__text-area h3 h3 h3\\\">PAGE WILL BE READY IN&nbsp;:<\\/span> <\\/div> <ontraport-countdown month=\\\"5\\\" redirect_href=\\\"#\\\" class=\\\"d countdown\\\" day=\\\"12\\\" then=\\\"1494572400000\\\"> <ul class=\\\"f\\\"> <li><p class=\\\"ce-days bb h1 g\\\">29<\\/p> <span class=\\\"bb h3\\\">DAYS<\\/span><\\/li> <li><p class=\\\"ce-hours bb h1 g\\\">14<\\/p> <span class=\\\"bb h3\\\">HOURS<\\/span><\\/li> <li><p class=\\\"ce-minutes bb h1 g\\\">16<\\/p> <span class=\\\"bb h3\\\">MINUTES<\\/span><\\/li> <li><p class=\\\"ce-seconds bb h1 g\\\">34<\\/p> <span class=\\\"bb h3\\\">SECONDS<\\/span><\\/li> <\\/ul> <\\/ontraport-countdown> <\\/div><\\/div> <\\/div><\\/div><div class=\\\"row a\\\" opt-id=\\\"bd440856-4d06-bedf-1302-eb5f220c29e9\\\" opt-type=\\\"block\\\" opt-block-type-id=\\\"10\\\" opt-block-style-id=\\\"130\\\"><div class=\\\"block-style\\\"><style class=\\\"block-css\\\">.k { display: none;} .ay { display: inline;} .t { margin-right: 5px; position: relative; top: -1px;} .ai { margin-bottom: 25px;} .ag { margin-bottom: 0;} .m { display: inline-block; margin-right: 1%; width: 35%; vertical-align: top;} .n { display: inline;} .e { display: inline-block;} .y input[type=\\\"email\\\"], .y input[type=\\\"number\\\"], .y input[type=\\\"search\\\"], .y input[type=\\\"text\\\"], .y input[type=\\\"tel\\\"], .y input[type=\\\"url\\\"], .y input[type=\\\"password\\\"], .y input[type=\\\"date\\\"], .y textarea,.y select { width: 100%; display: inline-block;} .av label { word-wrap: break-word;} .y input[type=\\\"submit\\\"].button-style { padding: 0 20px; border-radius: 3px; text-decoration: none; letter-spacing: inherit; text-transform: none; border: 0; height: 38px; line-height: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; vertical-align: middle; -webkit-transition: opacity .4s ease-in-out; transition: opacity .4s ease-in-out;}.y input[type=\\\"submit\\\"].button-style:hover { opacity: .9;} @media (max-width: 1200px) { .block-style-130__columns.block-style-130__columns { text-align: center; width: 100%; } .m { width: 24%; }} @media (max-width: 549px) { .m { width: 100%; } }.opt-page-size-mobile .m { width: 100%;} <\\/style> <div class=\\\"block-wrapper block-style-130 ak spacing\\\" style=\\\"background-color: transparent; background-image: none;\\\"> <div class=\\\"container\\\"> <div class=\\\"y\\\"> <div class=\\\"row\\\"> <div class=\\\"six columns block-style-130__columns\\\"> <div class=\\\"ai bb\\\"><span class=\\\" opt-palette-editor__text-area body-text body-text\\\">Enter you name &amp; Email and we will let you know when its ready.<\\/span><\\/div> <\\/div> <div class=\\\"six columns block-style-130__columns\\\"> <form role=\\\"form\\\" accept-charset=\\\"UTF-8\\\" method=\\\"post\\\" action=\\\"[system_form_processor_bd440856-4d06-bedf-1302-eb5f220c29e9]\\\" class=\\\"ag opt-center\\\"> <div class=\\\"n\\\"> <div class=\\\"m\\\"> <label class=\\\"bb label k\\\" for=\\\"firstname\\\" opt-for=\\\"firstname-input\\\">First Name<\\/label> <input class=\\\"aw\\\" type=\\\"text\\\" name=\\\"firstname\\\" id=\\\"firstname\\\" placeholder=\\\"First Name\\\"> <\\/div> <div class=\\\"m\\\"> <label class=\\\"bb label k\\\" for=\\\"email\\\" opt-for=\\\"email-input\\\">Email<\\/label> <input class=\\\"aw\\\" type=\\\"email\\\" name=\\\"email\\\" id=\\\"email\\\" placeholder=\\\"Email\\\" required=\\\"required\\\"> <\\/div> <\\/div> <div class=\\\"e\\\"> <input type=\\\"submit\\\" value=\\\"Submit\\\" class=\\\"button button-style at\\\"> <\\/div> <span style=\\\"display: none;\\\">[system_form_fields_bd440856-4d06-bedf-1302-eb5f220c29e9]<\\/span> <\\/form> <\\/div> <\\/div> <\\/div> <\\/div> <\\/div> <\\/div><\\/div><\\/div> <!--OPT-AD-BLOCK-HERE--> <\\/div> <script src=\\\"\\/\\/ajax.googleapis.com\\/ajax\\/libs\\/jquery\\/1.7.1\\/jquery.min.js\\\"><\\/script> <script class=\\\"opt-page-script\\\" type=\\\"text\\/javascript\\\" src=\\\"https:\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/jQueryPageBackgroundPro\\/js\\/libs\\/underscore.js\\\"><\\/script> <span style=\\\"display: none;\\\" class=\\\"opt-system-scripts\\\">[system_scripts]<\\/span> <span style=\\\"display: none;\\\" class=\\\"opt-form-scripts\\\">[system_form_scripts]<\\/span> <script type=\\\"text\\/javascript\\\" class=\\\"opt-page-script opt-form-scripts\\\" src=\\\"https:\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/jQueryCloneVal\\/jquery-cloneVal.js\\\"><\\/script> <script src=\\\"\\/\\/app.ontraport.com\\/js\\/globalize\\/globalize.js\\\"><\\/script> <script type=\\\"text\\/javascript\\\" class=\\\"opt-page-script opt-document-register-element-driver\\\" src=\\\"https:\\/\\/optassets.ontraport.com\\/opt_assets\\/templates\\/custom-elements\\/document-register-element\\/build\\/document-register-element.js\\\"><\\/script> <script type=\\\"text\\/javascript\\\" class=\\\"opt-page-script opt-countdown-script\\\" src=\\\"https:\\/\\/optassets.ontraport.com\\/opt_assets\\/templates\\/custom-elements\\/countdown\\/countdown.js\\\"><\\/script> <span style=\\\"display: none;\\\">[bot_catcher]<\\/span> <!--OPT-CUSTOM-FOOTER-SCRIPT--><script> <\\/script><\\/body><\\/html>\",\"formBlockIds\":[\"bd440856-4d06-bedf-1302-eb5f220c29e9\"]},{\"templateId\":false,\"status\":false,\"blocks\":[],\"settings\":{\"favicon_uploader\":\"\\/\\/app.ontraport.com\\/favicon.png\"},\"theme\":{\"theme_font\":{\"children\":{\"h1, ~h1~h1\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"50px\",\"line-height\":\"50px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"h2, ~h2~h2\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"30px\",\"line-height\":\"32px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"h3, ~h3~h3\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"20px\",\"line-height\":\"20px\",\"font-weight\":\"900\",\"font-style\":\"normal\"}},\"~label~label\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"16px\",\"line-height\":\"16px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"~button~button\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"14px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~large-body-text~large-body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"18px\",\"line-height\":\"24px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"~body-text~body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"blockquote, ~blockquote\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"100\",\"font-style\":\"italic\"}}}},\"theme_colors\":{\"primary-color\":\"#1e88e5\",\"complimentary-color\":\"#41baff\",\"dark-color\":\"#333333\",\"light-color\":\"#f3efea\",\"white-color\":\"#ffffff\"},\"theme_background\":{\"id\":\"template-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"#ffffff\",\"options\":[\"backgrounds\"],\"alias\":\"background\"}},\"theme_spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-top\":\"20px\",\"padding-bottom\":\"20px\"}}}},\"theme_dimensions\":{\"widthType\":\"option\",\"width\":\"100%\",\"height\":null},\"border\":{\"color\":\"#000000\",\"size\":\"0px\"}},\"mergedData\":\"\",\"formBlockIds\":[]},{\"templateId\":false,\"status\":false,\"blocks\":[],\"settings\":{\"favicon_uploader\":\"\\/\\/app.ontraport.com\\/favicon.png\"},\"theme\":{\"theme_font\":{\"children\":{\"h1, ~h1~h1\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"50px\",\"line-height\":\"50px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"h2, ~h2~h2\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"30px\",\"line-height\":\"32px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"h3, ~h3~h3\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"20px\",\"line-height\":\"20px\",\"font-weight\":\"900\",\"font-style\":\"normal\"}},\"~label~label\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"16px\",\"line-height\":\"16px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"~button~button\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"14px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~large-body-text~large-body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"18px\",\"line-height\":\"24px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"~body-text~body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"blockquote, ~blockquote\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"100\",\"font-style\":\"italic\"}}}},\"theme_colors\":{\"primary-color\":\"#1e88e5\",\"complimentary-color\":\"#41baff\",\"dark-color\":\"#333333\",\"light-color\":\"#f3efea\",\"white-color\":\"#ffffff\"},\"theme_background\":{\"id\":\"template-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"#ffffff\",\"options\":[\"backgrounds\"],\"alias\":\"background\"}},\"theme_spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-top\":\"20px\",\"padding-bottom\":\"20px\"}}}},\"theme_dimensions\":{\"widthType\":\"option\",\"width\":\"100%\",\"height\":null},\"border\":{\"color\":\"#000000\",\"size\":\"0px\"}},\"mergedData\":\"\",\"formBlockIds\":[]},{\"templateId\":false,\"status\":false,\"blocks\":[],\"settings\":{\"favicon_uploader\":\"\\/\\/app.ontraport.com\\/favicon.png\"},\"theme\":{\"theme_font\":{\"children\":{\"h1, ~h1~h1\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"50px\",\"line-height\":\"50px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"h2, ~h2~h2\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"30px\",\"line-height\":\"32px\",\"font-weight\":\"400\",\"font-style\":\"normal\"}},\"h3, ~h3~h3\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"20px\",\"line-height\":\"20px\",\"font-weight\":\"900\",\"font-style\":\"normal\"}},\"~label~label\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"16px\",\"line-height\":\"16px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"~button~button\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"14px\",\"font-weight\":\"600\",\"font-style\":\"normal\"}},\"~large-body-text~large-body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"18px\",\"line-height\":\"24px\",\"font-weight\":\"100\",\"font-style\":\"normal\"}},\"~body-text~body-text\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"300\",\"font-style\":\"normal\"}},\"blockquote, ~blockquote\":{\"attributes\":{\"font-family\":\"Arial, sans-serif\",\"font-size\":\"14px\",\"line-height\":\"22px\",\"font-weight\":\"100\",\"font-style\":\"italic\"}}}},\"theme_colors\":{\"primary-color\":\"#1e88e5\",\"complimentary-color\":\"#41baff\",\"dark-color\":\"#333333\",\"light-color\":\"#f3efea\",\"white-color\":\"#ffffff\"},\"theme_background\":{\"id\":\"template-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"#ffffff\",\"options\":[\"backgrounds\"],\"alias\":\"background\"}},\"theme_spacing\":{\"children\":{\"~spacing\":{\"attributes\":{\"padding-top\":\"20px\",\"padding-bottom\":\"20px\"}}}},\"theme_dimensions\":{\"widthType\":\"option\",\"width\":\"100%\",\"height\":null},\"border\":{\"color\":\"#000000\",\"size\":\"0px\"}},\"mergedData\":\"\",\"formBlockIds\":[]}]",
        "design_type": "3",
        "name": "Welcome",
        "seo_settings": "[{},{},{},{}]",
        "rotation": "0",
        "last_save": "0",
        "last_auto": "0",
        "autosave": "",
        "visits_0": "0",
        "visits_1": "0",
        "visits_2": "0",
        "visits_3": "0",
        "platform": "0",
        "unique_visits_0": "0",
        "unique_visits_1": "0",
        "unique_visits_2": "0",
        "unique_visits_3": "0",
        "convert_0": "0",
        "convert_1": "0",
        "convert_2": "0",
        "convert_3": "0",
        "unique_convert_0": "0",
        "unique_convert_1": "0",
        "unique_convert_2": "0",
        "unique_convert_3": "0",
        "domain": null,
        "ssl_enabled": "0",
        "date": "1510704945",
        "dlm": "1510704945"
      }
    

    Landing page attributes

    Attribute Type Description
    id integer The landing page's ID.
    uri_id integer The hosted URL's ID.
    resource blob JSON encoded data containing the entire structure of the landing page.
    design_type integer The landing page's design type. Integer codes are mapped as follows:
    0 => HTML
    1 => Code Mode
    2 => Redirect
    3 => ONTRApages
    name string The landing page's name.
    seo_settings string The landing page's settings for search engine optimization. A JSON array with four indices that correspond to split test A, B, C, and D to store the page's title, meta description, and whether or not to disable search engines from indexing the landing page.
    rotation integer If using split testing, the ID of the next split test in line for rotation.
    last_save timestamp The time and date the landing page was last manually saved.
    last_auto timestamp The time and date the landing page was last automatically saved.
    autosave longtext The content of the last autosaved data.
    visits_0 integer The count of visits for split test A.
    visits_1 integer The count of visits for split test B.
    visits_2 integer The count of visits for split test C.
    visits_3 integer The count of visits for split test D.
    unique_visits_0 integer The count of unique user visits per session for split test A.
    unique_visits_1 integer The count of unique user visits per session for split test B.
    unique_visits_2 integer The count of unique user visits per session for split test C.
    unique_visits_3 integer The count of unique user visits per session for split test D.
    convert_0 integer The number of contacts that opted in from a selected landing page or submitted a form in split test A
    convert_1 integer The number of contacts that opted in from a selected landing page or submitted a form in split test B
    convert_2 integer The number of contacts that opted in from a selected landing page or submitted a form in split test C
    convert_3 integer The number of contacts that opted in from a selected landing page or submitted a form in split test D
    unique_convert_0 integer The percentage of contacts that opted in during a unique session divided by the number of unique visits for split test A.
    unique_convert_1 integer The percentage of contacts that opted in during a unique session divided by the number of unique visits for split test B.
    unique_convert_2 integer The percentage of contacts that opted in during a unique session divided by the number of unique visits for split test C.
    unique_convert_3 integer The percentage of contacts that opted in during a unique session divided by the number of unique visits for split test D.
    domain string The URL where the landing page is hosted.
    ssl_enabled integer A flag designating whether or not ssl certification is enabled. Values can be 0 or 1.
    date timestamp The date and time the landing page was created measured in seconds from the Unix Epoch. Note that this field will not contain data for any forms created prior to November 7, 2017.
    dlm timestamp The data and time the landing page was last modified measured in seconds from the Unix Epoch.

    Retrieve a specific landing page

    curl -X GET 'https://api.ontraport.com/1/LandingPage?id=1' \
        --header 'Api-Key: Key5678' \
        --header 'Api-Appid: 2_AppID_12345678'
    
    <?php
    use OntraportAPI\Ontraport;
    
    $client = new Ontraport("2_AppID_12345678","Key5678");
    $requestParams = array(
        "id" => 1
    );
    $response = $client->landingpage()->retrieveSingle($requestParams);
    

    Example Response:

    {
      "code": 0,
      "data": {
        "id": "1",
        "uri_id": null,
        "resource": "[{\"templateId\":84,\"status\":true,\"blocks\":[{\"alias\":\"Banner\",\"blockId\":\"20\",\"blockTypeId\":3,\"id\":\"527f664f-a6a4-8e9d-634e-26c041d2bee5\",\"path\":\"\\/js\\/ontraport\\/opt_assets\\/blocks\\/landing_page\\/20_event_banner\\/\",\"scripts\":\" \\/*block scripts*\\/\",\"theme\":{\"color_variation\":\"option-4\"},\"userDefinedData\":[{\"id\":\"header-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"h1\\\">COMING SOON<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Header\"}},{\"id\":\"subHeader-1\",\"type\":\"html\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"html\":\"<span class=\\\"  opt-palette-editor__text-area h2   h2 h2\\\">Yes you're on the right page, but its not quite ready.<\\/span>\",\"visibility\":\"visible\",\"options\":false,\"help\":false,\"alias\":\"Sub-Header\"}},{\"id\":\"header-group\",\"type\":\"group\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"alias\":\"header group\",\"visibility\":\"visible\"}},{\"id\":\"logo-1\",\"type\":\"image\",\"for\":null,\"tag\":\"IMG\",\"attrs\":{\"src\":\"\\/\\/optassets.ontraport.com\\/opt_assets\\/blocks\\/common\\/stockPhoto\\/84\\/29694.1.47135abcc7e84179f73c77f9e8f8af1b.PNG\",\"options\":false,\"visibility\":\"visible\",\"alias\":\"Logo\"}},{\"id\":\"block-background\",\"type\":\"background\",\"for\":null,\"tag\":\"DIV\",\"attrs\":{\"bg\":\"transparent\",\"options\":false,\"alias\":\"block background\",\"src\":\"\\/js\\/ontraport\\/components\\/opt_palette_editor\\/image\\/views\\/noimage.png\"}},{\"