Contact - Creating Contact

The POST method is used to create new contacts inside Groundhogg.

In order to successfully create a contact, you need to send a JSON body with a specific structure as well as with the authentication header.

PARAM TYPE REQUIRED EXAMPLE
email string Yes admin@example.com
first_name string no john
last_name string no doe
user_id int no 1
owner_id int no 1
optin_status int no 0 (unconfirmed)
meta array no { “custom” : “data” }

You can add additional information to contact bypassing the meta parameter with an associative array of key-value pairs.

Below are some reserved meta_keys which you can use to map data to fields in the contact record.

PARAM TYPE REQUIRED EXAMPLE
primary_phone string no 555-555-5555
primary_phone_extension string no 1234
street_address_1 string no 25 Lesmill Rd.
street_address_2 string no Unit D
city string no Toronto
postal_zip string no M3B 2T3
country string no CA

Adding any non-reserved key-value pair will also be added to the meta and will appear in the custom meta section of the contact record.

An example JSON body for creating a new contact looks like the following.

{
    "contact": {
        "email": "email@example.com",
        "first_name": "Jhon",
        "last_name": "Doe",
        "user_id": "1",
        "owner_id": "1",
        "optin_status": "1",
        "meta": {
            "primary_phone": "1234567890",
            "primary_phone_extension": "5623",
            "street_address_1": "25 Lesmill Rd",
            "street_address_2": "Unit D",
            "city": "North York",
            "postal_zip": "M3B 2T3",
            "region": "Ontario",
            "country": "CA",
            "notes": "",
            "lead_source": "",
            "source_page": "",
            "custom_meta": "this is meta"
        }
    }
}

 This operation executed successfully without any errors you receive the following output.

{
     "contact": {
        "data": {
            "email": "email@example.com",
            "first_name": "Jhon",
            "last_name": "Doe",
            "user_id": "1",
            "owner_id": "1",
            "optin_status": "1",
            "date_created": "2019-08-02 08:28:32",
            "ID": "1025",
            "gravatar": "https:\/\/secure.gravatar.com\/avatar\/5658ffccee7f0ebfda2b226238b1eb6e?s=300&d=mm&r=g"
        },
        "meta": {
            "primary_phone": "1234567890",
            "primary_phone_extension": "5623",
            "street_address_1": "25 Lesmill Rd",
            "street_address_2": "Unit D",
            "city": "North York",
            "postal_zip": "M3B 2T3",
            "region": "Ontario",
            "country": "CA",
            "notes": "",
            "lead_source": "",
            "source_page": "",
            "custom_meta": "this is meta",
            "profile_picture": "https:\/\/secure.gravatar.com\/avatar\/5658ffccee7f0ebfda2b226238b1eb6e?s=300&d=mm&r=g"
        },
        "tags": [],
        "files": []
    },
    "status": "success",
    "message": "Contact added successfully."
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us