NAV
shell

Introduction

Welcome to Jellyreach API documenation!

In this documentation, you can find everything you need to start sending your data to Jellyreach.

In case you need any help, feel free to reach us at [email protected]

Authentication

curl --request GET \
  --url https://api.jellyreach.com/v1/contacts \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json'

To authenticate against Jellyreach API, you need to use your API key in each request.

To access your API key you need to visit API keys within your account.

All requests must be made over HTTPS and header must contains the following parameters:

Header Value
Accept application/json
Authorization YOUR_API_KEY
Content-Type application/json

Errors

Jellyreach uses conventional HTTP response codes to indicate success or failure of an API request.

Codes in the 2xx range mean success, codes in the 4xx mean there was an error in the data passed to Jellyreach' API (such as missing parameters) and codes in the 5xx range indicate an error with Jellyreach internal servers.

Error Codes

Code Description
200 - OK The request was successful
400 - Bad Request Bad request
401 - Unauthorized Your credentials are invalid
404 - Not Found The resource doesn’t exist
50X - Internal Server Error An error occurred with our API

Contacts

Get Contacts

curl --request GET \
  --url https://api.jellyreach.com/v1/contacts \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

{
  "current_page": 1,
  "data": [
    {
      "attributes": {
        "contact_id": "600fee7ad50ade7cd25303a2",
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "city": "London"
      },
      "channels": {
        "email": {
          "subscribed": false
        },
        "sms": {
          "subscribed": true
        },
        "viber": {
          "subscribed": false
        }
      },
      "created_at": "2021-01-26 10:27:06",
      "updated_at": "2021-01-26 10:27:22"
    }
  ],
  "first_page_url": "http:\/\/api.jellyreach.com\/api\/v1\/contacts?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "http:\/\/api.jellyreach.com\/api\/v1\/contacts?page=1",
  "next_page_url": null,
  "path": "http:\/\/api.jellyreach.com\/api\/v1\/contacts",
  "per_page": 25,
  "prev_page_url": null,
  "to": 3,
  "total": 3,
  "exact": true
}

Get all contacts.

HTTP Request

GET https://api.jellyreach.com/v1/contacts

Create Contact

curl --request POST \
  --url https://api.jellyreach.com/v1/contacts \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '[email protected]' \
  -d 'first_name=John' \
  -d 'last_name=Doe' \
  -d 'gender=Male' \
  -d 'city=London' \
  -d 'country=UK' \
  -d 'birthday=1990-01-01'

The above command returns JSON structured like this:

{"message": "Contact has been successfully created."}

Create a new contact.

HTTP Request

POST https://api.jellyreach.com/v1/contacts

Parameters

Attribute Required Input Type Description
contact_id Yes String Contact ID in your internal system.
email No String Unique email
first_name No String First name
last_name No String Last name
phone No String Phone
gender No String Gender
birthday No Date (YYYY-MM-DD) Birthday
city No String City
country No String Country

Some of your attributes might be required if you have changed it in the attributes settings.

If you have created custom attributes, you need to send them as well (if required).

Update Contact

curl --request POST \
  --url https://api.jellyreach.com/v1/contacts/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d 'city=New York City'

The above command returns JSON structured like this:

{"message": "Contact has been successfully updated."}

Update an existing contact.

HTTP Request

POST https://api.jellyreach.com/v1/contacts/{id}

Parameters

Attribute Input Type Description
city String Contact's new city.

Send only attributes you wish to update. In this example, we're updating only city attribute.

However, we can send more attributes if we wished.

Subscribe Contact

curl --request POST \
  --url https://api.jellyreach.com/v1/contacts/{id}/subscribe \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' 

The above command returns JSON structured like this:

{"message": "Contact has been successfully subscribed to sms."}

Unsubscribe an existing contact.

HTTP Request

POST https://api.jellyreach.com/v1/contacts/{id}/subscribe

Parameters

Attribute Required Input Type Description
channel Yes String Channel you want to subscribe a contact for.

Unsubscribe Contact

curl --request POST \
  --url https://api.jellyreach.com/v1/contacts/{id}/unsubscribe \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' 

The above command returns JSON structured like this:

{"message": "Contact has been successfully unsubscribed to sms."}

Unsubscribe an existing contact.

HTTP Request

POST https://api.jellyreach.com/v1/contacts/{id}/unsubscribe

Parameters

Attribute Required Input Type Description
channel Yes String Channel you want to unsubscribe a contact for.

Create Event

curl --request POST \
  --url https://api.jellyreach.com/v1/contacts/{id}/events \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d 'event=add_to_cart'
  -d 'event_data={}'
  -d 'created_at=2021-01-01 10:20:30'

The above command returns JSON structured like this:

{"message": "Event has been queued. It will be processed as soon as possible."}

Create event to an existing contact.

HTTP Request

POST https://api.jellyreach.com/v1/contacts/{id}/events

Parameters

Attribute Required Input Type Description
event Yes String Event key.
event_data Yes JSON Event data.
created_at Yes Datetime Date and time.

You can add custom events if you need to track additional data.

View Contact

curl --request GET \
  --url https://api.jellyreach.com/v1/contacts/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

{
  "id": "5ff50f11c41fb60426487be2",
  "attributes": {
    "contact_id": "1",
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "",
    "gender": "Male",
    "city": "",
    "country": "",
    "birthday": "1990-01-01"
  },
  "channels": {
    "email": {
      "subscribed": true
    },
    "sms": {
      "subscribed": true
    },
    "viber": {
      "subscribed": true
    }
  },
  "created_at": "2021-01-06 01:14:57",
  "updated_at": "2021-01-28 15:53:49"
}

Get an existing contact.

HTTP Request

DELETE https://api.jellyreach.com/v1/contacts/{id}

Delete Contact

curl --request DELETE \
  --url https://api.jellyreach.com/v1/contacts/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json'

The above command returns JSON structured like this:

{"message": "Contact has been successfully deleted."}

Delete an existing contact.

HTTP Request

DELETE https://api.jellyreach.com/v1/contacts/{id}