Avochato API


Welcome!

If anything isn’t working as documented, please message Avochato Support @ 415-214-8977.

To use the Avochato API, you will need a pair of Auth ID and Secret tokens. Tokens are account-specific and are bound to your specific User, so a pair of tokens must be generated per account. To generate a new set of tokens, please log into www.avochato.com and go to Settings > Api Access.

To get started, here are some common places you may want to check out:

  • Contacts, which represent a unique external phone number that is interacting with your Avochato number
  • Tickets, which represent a conversation between an Account and a Contact
  • Messages, which represent the messages sent and received by your Avochato number
  • Broadcasts, which let you create and schedule messages to an audience of Contacts

Accounts

Fetch Accounts

Using your auth id + secret you can fetch Accounts by subdomains

Endpoint

GET /v1/accounts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Account subdomains to fetch
page Page to request

Request

Route

GET /v1/accounts/test-account%2Caccount_38?auth_id=1K2b2nXbWR&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=1K2b2nXbWR
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_38?auth_id=1K2b2nXbWR&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 3a908a17-d345-475f-a9af-97289a3111aa
X-Runtime: 0.109180
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "43y830GbVN",
        "subdomain": "account_38",
        "name": "Account 38",
        "phone": null,
        "created_at": "2020-10-01T14:22:26.007-07:00"
      },
      {
        "id": "wEG8jerJQl",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2020-10-01T14:22:26.043-07:00"
      }
    ]
  },
  "page": 1
}

List Accounts

Using your auth id + secret you can list all your Accounts

Endpoint

GET /v1/accounts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page to request

Request

Route

GET /v1/accounts?auth_id=Pe6begxJXw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=Pe6begxJXw
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=Pe6begxJXw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: e79cbeb3-9900-406a-8f67-cbe35cd4db60
X-Runtime: 0.026998
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "xlYJpe58mw",
        "subdomain": "account_39",
        "name": "Account 39",
        "phone": null,
        "created_at": "2020-10-01T14:22:26.192-07:00"
      },
      {
        "id": "v5D9RO2JVA",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2020-10-01T14:22:26.217-07:00"
      }
    ]
  },
  "page": 1
}

Broadcasts

Create Broadcast

Using your auth id + secret you can setup a broadcast

Endpoint

POST /v1/broadcasts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
message required Text to send in Broadcasts
media_url Url of media to send in MMS (500kb limit)
status_callback Url to send status updates for each message sent by this broadcast
name Name of the broadcast to set
via_tags Comma-separated list of contact tags to add to broadcast
via_contact_ids Comma-separated list of contact ids to add to broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to broadcast
via_field[field] String, either name ,phone ,phone_formatted ,email ,company ,street ,city ,state ,country ,zip ,priority ,opted_out, OR Custom Variable name
via_field[value] String, match all contacts with a given field which matches this value exactly

Request

Route

POST /v1/broadcasts

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "3o48OLwbeA",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "message": "new test message",
  "media_url": "https://somesite.com/pretty.jpg",
  "status_callback": "https://somesite.com/some_callback_route",
  "name": "My New Broadcast",
  "via_tags": "tag1,tag2",
  "via_contact_ids": "3o48OKr8eA",
  "via_phone_numbers": "5105551234,4155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

cURL

curl "https://www.avochato.com/v1/broadcasts" -d '{"auth_id":"3o48OLwbeA","auth_secret":"YYYYYYYYYYYYYYYYYYYY","message":"new test message","media_url":"https://somesite.com/pretty.jpg","status_callback":"https://somesite.com/some_callback_route","name":"My New Broadcast","via_tags":"tag1,tag2","via_contact_ids":"3o48OKr8eA","via_phone_numbers":"5105551234,4155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 2dbe4400-7741-4df6-8c3f-247687cc2ac8
X-Runtime: 0.193261
Content-Length: 367

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "BDr8GnkJPl",
      "name": "My New Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty.jpg",
      "status": "initialized",
      "contacts_count": 0,
      "user": {
        "email": "person_20@example.com",
        "id": "qxk9EG68RK",
        "name": "Person 22"
      },
      "status_callback": "https://somesite.com/some_callback_route",
      "pending_contacts_count": null
    }
  }
}

Fetch Broadcasts

Using your auth id + secret you can fetch broadcasts based on their ids

Endpoint

GET /v1/broadcasts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Broadcast ids to fetch
page Page number to request

Request

Route

GET /v1/broadcasts/3o48OvgJeA%2CYOobKadJ7E?auth_id=PDz9nnA9e3&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=PDz9nnA9e3
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/3o48OvgJeA%2CYOobKadJ7E?auth_id=PDz9nnA9e3&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 974fdeac-4eda-42b2-96f2-bfcae64c8803
X-Runtime: 0.039192
Content-Length: 445

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "3o48OvgJeA",
        "name": null,
        "message": "5",
        "media_url": null,
        "status": "initialized",
        "contacts_count": 1,
        "user": {
          "email": "person_19@example.com",
          "id": "k5V9V5Mblr",
          "name": "Person 21"
        },
        "status_callback": null
      },
      {
        "id": "YOobKadJ7E",
        "name": null,
        "message": "6",
        "media_url": null,
        "status": "queued",
        "contacts_count": 0,
        "user": {
          "email": "person_19@example.com",
          "id": "k5V9V5Mblr",
          "name": "Person 21"
        },
        "status_callback": null
      }
    ]
  }
}

Publish Broadcast

Using your auth id + secret you can publish your broadcast

Endpoint

POST /v1/broadcasts/:id/publish

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
schedule_for Unix timestamp, Ensure delivery at this time
asap Boolean, Ignore schedule_for and schedule ASAP

Request

Route

POST /v1/broadcasts/RkAJvDlb0o/publish

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "3YnbgRg8ae",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "schedule_for": 1601551340.5955808,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/RkAJvDlb0o/publish" -d '{"auth_id":"3YnbgRg8ae","auth_secret":"YYYYYYYYYYYYYYYYYYYY","schedule_for":1601551340.5955808,"asap":true}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: dc162266-58ec-4d40-8890-03ed0b527cc1
X-Runtime: 0.236544
Content-Length: 236

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "RkAJvDlb0o",
      "name": null,
      "message": "1",
      "media_url": null,
      "status": "queued",
      "contacts_count": 1,
      "user": {
        "email": "person_17@example.com",
        "id": "0N6bw1OJDM",
        "name": "Person 19"
      },
      "status_callback": null
    }
  }
}

Update Broadcast

Using your auth id + secret you can add more contacts or update your broadcast

Endpoint

POST /v1/broadcasts/:id

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
message Text to send in Broadcasts
media_url Url of media to send in MMS (500kb limit)
name Name of the Broadcast to set
via_tags Comma-separated list of contact tags to add to broadcast
via_contact_ids Comma-separated list of contact ids to add to broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to broadcast
via_field[field] String, [:name, :phone, :phone_formatted, :email, :company, :street, :city, :state, :country, :zip, :priority, :opted_out], OR Custom Variable name
via_field[value] String, match all contacts with a given field which matches this value exactly

Request

Route

POST /v1/broadcasts/1LxJDvKbn2

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "1LxJDpgJn2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "message": "new test message",
  "media_url": "https://somesite.com/pretty2.jpg",
  "name": "My Other Broadcast",
  "via_tags": "tag2,tag3",
  "via_contact_ids": "RkAJvjqJ0o",
  "via_phone_numbers": "+15105551234,+14155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

cURL

curl "https://www.avochato.com/v1/broadcasts/1LxJDvKbn2" -d '{"auth_id":"1LxJDpgJn2","auth_secret":"YYYYYYYYYYYYYYYYYYYY","message":"new test message","media_url":"https://somesite.com/pretty2.jpg","name":"My Other Broadcast","via_tags":"tag2,tag3","via_contact_ids":"RkAJvjqJ0o","via_phone_numbers":"+15105551234,+14155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: afdfd811-3c05-4f32-9dd7-1bbdfdedcf55
X-Runtime: 0.156124
Content-Length: 329

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "1LxJDvKbn2",
      "name": "My Other Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty2.jpg",
      "status": "initialized",
      "contacts_count": 1,
      "user": {
        "email": "person_18@example.com",
        "id": "M3NbrNDbr6",
        "name": "Person 20"
      },
      "status_callback": null,
      "pending_contacts_count": 3
    }
  }
}

CallTokens

Create Call Token

Using your auth id + secret you can create a token to make a call

Endpoint

POST /v1/calls

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field

Request

Route

POST /v1/calls

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "PxB9NexbYO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"PxB9NexbYO","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: d6100fab-054a-4b8b-b84d-4a3c2b791917
X-Runtime: 0.081851
Content-Length: 324

Body

{
  "status": 200,
  "data": {
    "call_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9bm90cmVhbCBzY29wZTpjbGllbnQ6aW5jb21pbmc_Y2xpZW50TmFtZT0yalJiazA1OTFQIiwiaXNzIjoidHdpbGlvX2FjY291bnRfc2lkIiwibmJmIjoxNjAxNTg3MzI3LCJleHAiOjE2MDE2NzM3Mjd9.rNz6_33NicjPBsBGjTkXOsNMhqRh0LYA72kPm1SmBmE"
  }
}

Campaigns

Fetch Campaigns

Using your auth id + secret you can fetch campaign macros by ids

Endpoint

GET /v1/campaigns/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of campaign keys to fetch
page Page to request

Request

Route

GET /v1/campaigns/one?auth_id=qQR91ZGJge&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=qQR91ZGJge
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=qQR91ZGJge&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 3ffedd00-8476-4172-84da-09b0527c6e91
X-Runtime: 0.025052
Content-Length: 245

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "id": "EDR8zM4JA2",
        "key": "one",
        "raw_text": "[Campaign 1] first message",
        "follow_up_message": "[Campaign 1] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "EDR8zM4JA2",
        "hotkey": null
      }
    ]
  },
  "page": 1
}

List Campaigns

Using your auth id + secret you can get all defined campaigns

Endpoint

GET /v1/campaigns

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field

Request

Route

GET /v1/campaigns?auth_id=KRg80okJj0&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=KRg80okJj0
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=KRg80okJj0&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: df2c1298-f812-4ced-959c-3ab6e04e111c
X-Runtime: 0.084192
Content-Length: 435

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "id": "BDr8GnkJPl",
        "key": "two",
        "raw_text": "[Campaign 2] first message",
        "follow_up_message": "[Campaign 2] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "BDr8GnkJPl",
        "hotkey": null
      },
      {
        "id": "z1N8xD2837",
        "key": "one",
        "raw_text": "[Campaign 1] first message",
        "follow_up_message": "[Campaign 1] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "z1N8xD2837",
        "hotkey": null
      }
    ]
  }
}

Remove all contacts from campaign

Using your auth id + secret you can remove all contacts from a campaign

Endpoint

POST /v1/campaigns/:id/cancel

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Campaign keyword
phone Phone number of the contact to cancel
contacts List of contacts to cancel

Request

Route

POST /v1/campaigns/one/cancel

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "0N6bwx29DM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"0N6bwx29DM","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: ba407a4b-4226-47e0-b90c-3989e5415f2b
X-Runtime: 0.220751
Content-Length: 59

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing 2 entries."
  }
}

Remove multiple contacts from campaign

Using your auth id + secret you can remove contacts from a campaign by their phone numbers

Endpoint

POST /v1/campaigns/:id/cancel

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Campaign keyword
phone Phone number of the contact to cancel
contacts List of contacts to cancel

Request

Route

POST /v1/campaigns/one/cancel

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "k5V9Vayblr",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    "+15551234568",
    "+15105551234"
  ]
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"k5V9Vayblr","auth_secret":"YYYYYYYYYYYYYYYYYYYY","contacts":["+15551234568","+15105551234"]}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: ceb15874-f2e3-4406-80a8-b24fb617c379
X-Runtime: 0.160790
Content-Length: 59

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing 2 entries."
  }
}

Remove single contact from campaign

Using your auth id + secret you can remove contacts from a campaign by their phone numbers

Endpoint

POST /v1/campaigns/:id/cancel

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Campaign keyword
phone Phone number of the contact to cancel
contacts List of contacts to cancel

Request

Route

POST /v1/campaigns/one/cancel

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "M3Nbry58r6",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"M3Nbry58r6","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15105551234"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 2e031b3f-db26-4a51-b3a8-5a425b0bd7ca
X-Runtime: 0.122823
Content-Length: 24

Body

{
  "status": 200,
  "data": {
  }
}

Contacts

Fetch Contacts

Using your auth id + secret you can fetch Contacts by ids

Endpoint

GET /v1/contacts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to fetch
page Page to request

Request

Route

GET /v1/contacts/zPG9yjZJaO%2CAEgb5Evbej?auth_id=VePJlG69ar&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=VePJlG69ar
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/zPG9yjZJaO%2CAEgb5Evbej?auth_id=VePJlG69ar&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 56d48d79-2e34-4747-98ea-c673118c9cb4
X-Runtime: 0.032629
Content-Length: 867

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "AEgb5Evbej",
        "name": "Bob McTest",
        "phone": "+15551234567",
        "email": "bob@mctest.com",
        "street": null,
        "city": "Los Angeles",
        "state": "CA",
        "zip": "99999",
        "notes": null,
        "company": "McTest Inc",
        "other_phone": null,
        "created_at": 1601586732.70762,
        "tags": [
          "important"
        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null
      },
      {
        "id": "zPG9yjZJaO",
        "name": "Other Contact",
        "phone": "+15551234568",
        "email": "bob@contact.com",
        "street": null,
        "city": "San Francisco",
        "state": "CA",
        "zip": "88888",
        "notes": null,
        "company": "Contact Inc",
        "other_phone": null,
        "created_at": 1601587332.71718,
        "tags": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null
      }
    ]
  },
  "page": 1
}

Search Contacts

Using your auth id + secret you can search for matching Contacts based on a query

Endpoint

GET /v1/contacts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String to search Contacts with (default: iterate through all Contacts)
created_at[from] Select Contacts created after this unixtime
created_at[to] Select Contacts created before this unixtime (default: now)
page Page to request

Request

Route

GET /v1/contacts?auth_id=ZMvbXML9Rm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1601587271.731352&created_at%5Bto%5D=1601587391.731457&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=ZMvbXML9Rm
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR 'San Fran'
created_at={"from"=>"1601587271.731352", "to"=>"1601587391.731457"}
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=ZMvbXML9Rm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1601587271.731352&created_at%5Bto%5D=1601587391.731457&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: d06d2367-9737-4020-b7c7-b1687e6cd537
X-Runtime: 0.138132
Content-Length: 454

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "Pe6beLN8Xw",
        "name": "Other Contact",
        "phone": "+15551234568",
        "email": "bob@contact.com",
        "street": null,
        "city": "San Francisco",
        "state": "CA",
        "zip": "88888",
        "notes": null,
        "company": "Contact Inc",
        "other_phone": null,
        "created_at": 1601587331.68427,
        "tags": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null
      }
    ]
  },
  "page": 1
}

Update Contact

Using your auth id + secret you can create or update a Contact based on their phone number

Endpoint

POST /v1/contacts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
contacts required List of Contacts
contacts[n][phone] required Phone number of Contact
contacts[n][name] Name of the Contact
contacts[n][email] Email for the Contact
contacts[n][other_phone] Other phone for the Contact
contacts[n][company] Company for the Contact
contacts[n][street] Street for the Contact
contacts[n][city] City for the Contact
contacts[n][state] State for the Contact
contacts[n][zip] Zip Code for the Contact
contacts[n][country] Country for the Contact
contacts[n][opted_out] Opted-out status of the Contact
contacts[n][visible] Visibility status of the Contact
contacts[n][custom_variable_name] Custom variable to set for the Contact
contacts[n][tags] CSV of tags to apply to the Contact
contacts[n][user_id] User ID or Email of a User that is responsible for this contct. Assigns all conversations to the user when set.

Request

Route

POST /v1/contacts

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "wd6JmrA87m",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    {
      "phone": "+14155553333",
      "name": "Bob McTest",
      "email": "contact@example.com",
      "company": "Example Inc.",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "country": "USA",
      "opted_out": false,
      "visible": true,
      "custom_variable_name": "value to set custom variable",
      "tags": "red,green,blue",
      "user_id": "teammate@example.com"
    }
  ]
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"wd6JmrA87m","auth_secret":"YYYYYYYYYYYYYYYYYYYY","contacts":[{"phone":"+14155553333","name":"Bob McTest","email":"contact@example.com","company":"Example Inc.","street":"123 Main St.","city":"SF","state":"CA","zip":"99999","country":"USA","opted_out":false,"visible":true,"custom_variable_name":"value to set custom variable","tags":"red,green,blue","user_id":"teammate@example.com"}]}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 9806376d-c9ff-4843-b8eb-90d179734381
X-Runtime: 0.325553
Content-Length: 525

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "mQL9W6rbWq",
      "name": "Bob McTest",
      "phone": "+14155553333",
      "email": "contact@example.com",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "notes": null,
      "company": "Example Inc.",
      "other_phone": null,
      "created_at": 1601587332.19459,
      "tags": [
        "blue",
        "green",
        "red"
      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": null,
      "salesforce_object_type": null,
      "salesforce_object_id": null,
      "priority": 0,
      "user_id": "Pwebor48Xm",
      "custom_variable_name": "value to set custom variable"
    }
  }
}

Events

Add Event (Contact id)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the Contact id

Endpoint

POST /v1/contacts/:id/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Contact id to add an event to
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/contacts/v7Mb6AB8ER/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "BLP9MnrJqY",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "type": "sale",
  "context": "Wanted a new watch ($99.99) with no warranty",
  "revenue": 99.99
}

cURL

curl "https://www.avochato.com/v1/contacts/v7Mb6AB8ER/events" -d '{"auth_id":"BLP9MnrJqY","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted a new watch ($99.99) with no warranty","revenue":99.99}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 530ac522-8235-4293-9980-aa09d44ef63c
X-Runtime: 2.478350
Content-Length: 301

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "Pe6beBR9Xw",
      "account_id": "enL8amp87N",
      "ticket_id": "3YnbgO6bae",
      "contact_id": "v7Mb6AB8ER",
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "element_id": "43y83xbVNM",
      "element_type": "CustomEvent",
      "sent_at": 1601587327.6385
    }
  }
}

Add Event (Phone)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the phone number

Endpoint

POST /v1/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "0nMJLxNJvZ",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "type": "sale",
  "context": "Bought an avocado ($2) and was interested in a subscription",
  "revenue": 2.0
}

cURL

curl "https://www.avochato.com/v1/events" -d '{"auth_id":"0nMJLxNJvZ","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","type":"sale","context":"Bought an avocado ($2) and was interested in a subscription","revenue":2.0}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 600ae48b-ba92-45bc-a279-9aa87629d435
X-Runtime: 0.126173
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "EZA9PVn8rw",
      "account_id": "BLP9Mj0JqY",
      "ticket_id": "PDz9ngjJe3",
      "contact_id": "BDr8GqZ9Pl",
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "element_id": "wEG8j28QlW",
      "element_type": "CustomEvent",
      "sent_at": 1601587330.82343
    }
  }
}

Add Event (Ticket id)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the Ticket id

Endpoint

POST /v1/tickets/:id/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Ticket id to add event to
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/tickets/3o48Oqe9eA/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "KRg80oyJj0",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "type": "sale",
  "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
  "revenue": 15.5
}

cURL

curl "https://www.avochato.com/v1/tickets/3o48Oqe9eA/events" -d '{"auth_id":"KRg80oyJj0","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted one hat ($10) and upsold warranty ($5.50)","revenue":15.5}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 4e5f994d-5759-46c5-9b83-b64fcef5642e
X-Runtime: 0.139003
Content-Length: 305

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "mQL9WDpJWq",
      "account_id": "WAnJQjw8y1",
      "ticket_id": "3o48Oqe9eA",
      "contact_id": "EDR8z5nJA2",
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "element_id": "xlYJpq8mwM",
      "element_type": "CustomEvent",
      "sent_at": 1601587331.34886
    }
  }
}

Fetch Events

Using your auth id + secret you can fetch Events in a Ticket based on Ticket ids

Endpoint

GET /v1/tickets/:ids/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Ticket ids to fetch the event stream
page Page to request

Request

Route

GET /v1/tickets/1LxJDAE8n2/events?auth_id=WAnJQmLJy1&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=WAnJQmLJy1
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/1LxJDAE8n2/events?auth_id=WAnJQmLJy1&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: bb5c644f-5257-4cf3-90de-13f2f0140b4c
X-Runtime: 0.049846
Content-Length: 2103

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "PxB9NjW9YO",
        "ticket_id": "1LxJDAE8n2",
        "user_id": "3OLb4YR94Y",
        "status": "Closed",
        "element_id": "ezjJ7L185y",
        "element_type": "StatusChange",
        "sent_at": 1601587330.58419
      },
      {
        "account_id": "PxB9NjW9YO",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": null,
        "duration": 119,
        "segments": 2,
        "element_id": "BLP9MMj9qY",
        "element_type": "Call",
        "sent_at": 1601587330.57556
      },
      {
        "uuid": "84d8dec3-3ccc-43e7-8df6-1f390ddb1bdf",
        "account_id": "PxB9NjW9YO",
        "ticket_id": "1LxJDAE8n2",
        "contact_id": "z1N8x50b37",
        "sender_id": "3OLb4YR94Y",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "message": "Sorry in a meeting but can call afterwards",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "queued",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1601587330.55827,
        "sent_at": 1601587330.56396,
        "element_id": "xDjJBod8oO",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "62d0d751-028d-4bb3-8d6c-403d19fb59d4",
        "account_id": "PxB9NjW9YO",
        "ticket_id": "1LxJDAE8n2",
        "contact_id": "z1N8x50b37",
        "sender_id": "3OLb4YR94Y",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "message": "Hey there Bob let me know when we can talk!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "queued",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1601587330.54332,
        "sent_at": 1601587330.54935,
        "element_id": "ezjJ7o7J5y",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "PxB9NjW9YO",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": null,
        "duration": 10,
        "segments": 1,
        "element_id": "PxB9NX28YO",
        "element_type": "Call",
        "sent_at": 1601587330.53309
      },
      {
        "account_id": "PxB9NjW9YO",
        "ticket_id": "1LxJDAE8n2",
        "user_id": "3OLb4YR94Y",
        "status": "Open",
        "element_id": "VePJlvKbar",
        "element_type": "StatusChange",
        "sent_at": 1601587330.51485
      },
      {
        "account_id": "PxB9NjW9YO",
        "ticket_id": "1LxJDAE8n2",
        "user_id": "3OLb4YR94Y",
        "owner_id": "3OLb4YR94Y",
        "element_id": "Pwebo6G8Xm",
        "element_type": "OwnerChange",
        "sent_at": 1601587330.49821
      }
    ]
  }
}

Messages

Filter Messages via timestamp

Using your auth id + secret you can search for matching Messages based on a query

Endpoint

GET /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String, Query to search Messages (default: iterate through all messages)
page Integer, Page to request
direction String, Direction of the message ("in" for received messages, "out" for sent messages)
status String, Message delivery status (ie: queued, delivered, undelivered, failed)
from String, Phone number message was sent from
to String, Phone number message was sent to
created_at[from] Unix timestamp, Select messages created after this date
created_at[to] Unix timestamp, Select messages created before this date (default: now)

Request

Route

GET /v1/messages?auth_id=2jRbk3eb1P&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1601587265.0354629&created_at%5Bto%5D=1601587385.035509&document=private

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=2jRbk3eb1P
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1601587265.0354629", "to"=>"1601587385.035509"}
document=private

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=2jRbk3eb1P&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1601587265.0354629&created_at%5Bto%5D=1601587385.035509&document=private" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: d7a90637-cb03-4abd-b00a-da32759b5307
X-Runtime: 0.043444
Content-Length: 569

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "58c2ff9b-a07d-4fb8-aea1-51891db096d8",
        "account_id": "ezjJ7Y0b5y",
        "ticket_id": "qxk9EAj9RK",
        "contact_id": "3Ynbg14Jae",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "message": "I kept hearing that you had great service 😀!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "delivered",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1601587324.90603,
        "sent_at": 1601587324.9092,
        "element_id": "WAnJQmLJy1",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Search Messages

Using your auth id + secret you can search for matching Messages based on a query

Endpoint

GET /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String, Query to search Messages (default: iterate through all messages)
page Integer, Page to request
direction String, Direction of the message ("in" for received messages, "out" for sent messages)
status String, Message delivery status (ie: queued, delivered, undelivered, failed)
from String, Phone number message was sent from
to String, Phone number message was sent to
created_at[from] Unix timestamp, Select messages created after this date
created_at[to] Unix timestamp, Select messages created before this date (default: now)

Request

Route

GET /v1/messages?auth_id=xDjJBdlboO&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1601581323.388507&created_at%5Bto%5D=1601587383.388551

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=xDjJBdlboO
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1601581323.388507", "to"=>"1601587383.388551"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=xDjJBdlboO&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1601581323.388507&created_at%5Bto%5D=1601587383.388551" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 673e9148-3d74-4d91-8008-c6cb36e5bace
X-Runtime: 0.439897
Content-Length: 570

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "efbfa8e6-e6ca-47b3-a19f-07e13ad7b86b",
        "account_id": "VePJl1N8ar",
        "ticket_id": "M3NbrKj9r6",
        "contact_id": "AwebY6G9aE",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "message": "I kept hearing that you had great service 😀!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "delivered",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1601587322.70477,
        "sent_at": 1601587322.70825,
        "element_id": "PxB9NexbYO",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Send Message

Using your auth id + secret you can send a Message to any Contact based on their phone

Endpoint

POST /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number to send
message required Text to send in SMS
from String, Phone number in the account to try to send from
mark_addressed Boolean, Mark the message conversation as addressed (default: false)
media_url String, Url of media to send in MMS (500kb limit)
tags String, Comma-separated list of tags to apply to this contact
status_callback String, Domain to send callback http POST requests when the status is updated

Request

Route

POST /v1/messages

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "enL8avOb7N",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "from": "+15105551234",
  "mark_addressed": "true",
  "tags": "Some Tag, Another Tag",
  "status_callback": "https://my.domain.com"
}

cURL

curl "https://www.avochato.com/v1/messages" -d '{"auth_id":"enL8avOb7N","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","from":"+15105551234","mark_addressed":"true","tags":"Some Tag, Another Tag","status_callback":"https://my.domain.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: abdd8aa5-a9dc-4988-85e7-69494433bb8a
X-Runtime: 0.573246
Content-Length: 544

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "821d5926-ed8e-40db-b3d1-b4b2a0d51c47",
      "account_id": "xDjJBLMboO",
      "ticket_id": "RkAJvZ3J0o",
      "contact_id": "YOobK6587E",
      "sender_id": "EDR8zKebA2",
      "sender_type": "User",
      "to": "+14155553333",
      "from": null,
      "direction": "out",
      "message": "test message",
      "contents": [

      ],
      "segments": 1,
      "carrier": "twilio",
      "external_id": null,
      "status": "queued",
      "error_code": 0,
      "reason": null,
      "status_callback": "https://my.domain.com",
      "created_at": 1601587326.38446,
      "sent_at": 1601587326.37851,
      "element_id": "ZMvbXML9Rm",
      "element_type": "SmsMessage"
    }
  }
}

Tags

Add Tag (Contact id)

You can add a new tag to Contacts

Endpoint

POST /v1/contacts/:ids/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to tag
tag required Tag to add to Contacts

Request

Route

POST /v1/contacts/43y83eO9VN%2CxoWbqVM9qn/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "xDjJBod8oO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "tag": "my-new-tag"
}

cURL

curl "https://www.avochato.com/v1/contacts/43y83eO9VN%2CxoWbqVM9qn/tags" -d '{"auth_id":"xDjJBod8oO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-new-tag"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 02e408e3-fb39-4d15-a071-0031fc0bfe9f
X-Runtime: 0.077470
Content-Length: 94

Body

{
  "status": 200,
  "data": {
    "action": "tagged",
    "tag": "my-new-tag",
    "ids": [
      "43y83eO9VN",
      "xoWbqVM9qn"
    ]
  }
}

Add Tag (Phone)

You can add a new tag to a Contact based on phone number

Endpoint

POST /v1/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
tag required Tag to add to Contacts

Request

Route

POST /v1/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "enL8aMY87N",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-new-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"enL8aMY87N","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-new-tag"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 87a4d0dd-09dd-4e82-971f-75bd78c513ed
X-Runtime: 0.059535
Content-Length: 81

Body

{
  "status": 200,
  "data": {
    "action": "tagged",
    "tag": "my-new-tag",
    "ids": [
      "v5D9R2w9VA"
    ]
  }
}

Remove Tag (Contact id)

You can remove an old tag from Contacts

Endpoint

DELETE /v1/contacts/:ids/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to untag
tag required Tag to remove from Contacts

Request

Route

DELETE /v1/contacts/GeAbZznbDM%2CPwebowabXm/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "ezjJ7o7J5y",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "tag": "my-old-tag"
}

cURL

curl "https://www.avochato.com/v1/contacts/GeAbZznbDM%2CPwebowabXm/tags" -d '{"auth_id":"ezjJ7o7J5y","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-old-tag"}' -X DELETE \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 32dff101-0e2d-45cb-8ca1-ffae31fd4728
X-Runtime: 0.097395
Content-Length: 96

Body

{
  "status": 200,
  "data": {
    "action": "untagged",
    "tag": "my-old-tag",
    "ids": [
      "GeAbZznbDM",
      "PwebowabXm"
    ]
  }
}

Remove Tag (Phone)

You can remove an old tag from a Contact based on phone number

Endpoint

DELETE /v1/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
tag required Tag to remove from Contacts

Request

Route

DELETE /v1/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "2jRbkxx91P",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-old-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"2jRbkxx91P","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-old-tag"}' -X DELETE \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 9089ff1e-1ae7-4b40-8414-50fe24383370
X-Runtime: 0.026544
Content-Length: 83

Body

{
  "status": 200,
  "data": {
    "action": "untagged",
    "tag": "my-old-tag",
    "ids": [
      "wEG8jM0JQl"
    ]
  }
}

Ticket Assignment

Ticket Assignment represents which user on your team owns a conversation. The owner assigned to a conversation will receive notifications of incoming calls and texts from that contact.

Auto Assign

You can automatically reassign one or more Tickets to any user in the Auto Assignment Roster by id. If there are no active users in your Auto Assignment Roster, ownership will remain unchanged. See Settings > Auto Assignment

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id required autoassign string

Request

Route

PUT /v1/tickets/ZMvbXXDbRm

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "YOobKRN87E",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "autoassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/ZMvbXXDbRm" -d '{"auth_id":"YOobKRN87E","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"autoassign"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 4f2eaf85-6b61-4a95-9702-4fc45525b784
X-Runtime: 0.163683
Content-Length: 234

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ZMvbXXDbRm",
        "uuid": "eba58c0d-cdeb-49ae-b3c9-32500ebe6cbd",
        "contact": "BDr8GeZ9Pl",
        "user_id": "NEnJd5D8Rm",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587342.975283
      }
    ]
  }
}

Unassign

You can unassign one or more Tickets by id.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id required unassign string

Request

Route

PUT /v1/tickets/VePJlgd9ar

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "v7Mb6xOJER",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "unassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/VePJlgd9ar" -d '{"auth_id":"v7Mb6xOJER","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"unassign"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: b54158a8-a12e-4da8-ac59-d7243753def1
X-Runtime: 0.221780
Content-Length: 226

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "VePJlgd9ar",
        "uuid": "df682e0a-adda-4a44-a810-e5e2a63f049d",
        "contact": "1K2b2eO8WR",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587343.645393
      }
    ]
  }
}

Update Assignment with user_email

You can assign a User to be the owner of one or more Tickets by email.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_email User email of the new owner string

Request

Route

PUT /v1/tickets/enL8aQw87N%2C2jRbkgXb1P

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "BDr8GvaJPl",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_28@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/enL8aQw87N%2C2jRbkgXb1P" -d '{"auth_id":"BDr8GvaJPl","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_28@example.com"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: e7abaf48-168a-4637-80bd-729d15f417dd
X-Runtime: 0.242623
Content-Length: 436

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "2jRbkgXb1P",
        "uuid": "e5df7174-7b2b-4b6a-8df7-94b86f70c5cf",
        "contact": "EZA9POBbrw",
        "user_id": "3o48O5Q9eA",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587345.167918
      },
      {
        "id": "enL8aQw87N",
        "uuid": "8ab5433a-6e3b-44b3-b512-944545a7116c",
        "contact": "mQL9Wqr8Wq",
        "user_id": "3o48O5Q9eA",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587345.186193
      }
    ]
  }
}

Update Assignment with user_id

You can assign a User to be the owner of one or more Tickets by id.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id User ID of the new owner string

Request

Route

PUT /v1/tickets/xDjJBAm9oO%2CezjJ71Pb5y

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "z1N8xyAb37",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "1LxJDx4Jn2"
}

cURL

curl "https://www.avochato.com/v1/tickets/xDjJBAm9oO%2CezjJ71Pb5y" -d '{"auth_id":"z1N8xyAb37","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"1LxJDx4Jn2"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 03296612-48a3-4de0-bab5-37f8efa632a1
X-Runtime: 0.238699
Content-Length: 437

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ezjJ71Pb5y",
        "uuid": "d59e9522-785b-47f1-8f98-25a92d4dbd18",
        "contact": "Pe6be7NJXw",
        "user_id": "1LxJDx4Jn2",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587344.4593081
      },
      {
        "id": "xDjJBAm9oO",
        "uuid": "c538372d-3a7c-4ae0-b8e9-6dc38a51408a",
        "contact": "3OLb4eG94Y",
        "user_id": "1LxJDx4Jn2",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587344.468853
      }
    ]
  }
}

Ticket Status

Ticket Status represents the state of a conversation, and can be used to organize your inbox. Tickets marked as Closed are archived and do not appear in the inbox by default.

Close a Ticket

Mark one or more Tickets as Closed. Note: this will also automatically mark the ticket as ‘Addressed’

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
status Use the 'Closed' Status to close a ticket string

Request

Route

PUT /v1/tickets/43y83MA9VN

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "qxk9Eow8RK",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "status": "Closed"
}

cURL

curl "https://www.avochato.com/v1/tickets/43y83MA9VN" -d '{"auth_id":"qxk9Eow8RK","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Closed"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: c64d783a-831d-48b3-9e0c-5408be4a7c04
X-Runtime: 0.147563
Content-Length: 236

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "43y83MA9VN",
        "uuid": "58840295-7d09-44f3-a27a-9b9a36ee80f3",
        "contact": "qxk9E509RK",
        "user_id": "BLP9M5r9qY",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1601587338.510344
      }
    ]
  }
}

Update Status

You can update the status of one or more Tickets

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
status The current Ticket Status. Options include "New", Open", "Pending", "Closed" string

Request

Route

PUT /v1/tickets/xlYJpgo9mw%2CwEG8jgObQl

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "kvnJAoBbAD",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "status": "Pending"
}

cURL

curl "https://www.avochato.com/v1/tickets/xlYJpgo9mw%2CwEG8jgObQl" -d '{"auth_id":"kvnJAoBbAD","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Pending"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 726ddecb-321e-4820-bd9f-269e99562317
X-Runtime: 0.198558
Content-Length: 433

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "wEG8jgObQl",
        "uuid": "cc55581b-7926-4b3c-838e-fa8965cb0b41",
        "contact": "kvnJAjM8AD",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587339.1032052
      },
      {
        "id": "xlYJpgo9mw",
        "uuid": "5e084a21-1060-4aa7-ae68-563b84e5a92d",
        "contact": "NEnJdloJRm",
        "user_id": "WAnJQ5LJy1",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587339.1163661
      }
    ]
  }
}

Tickets

Tickets represent a unique conversation with a Contact in an Avochato Account.

Fetch Tickets

You can fetch Tickets by ids

Endpoint

GET /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
page Page to request

Request

Route

GET /v1/tickets/1K2b2NobWR%2CEDR8zO6bA2?auth_id=WAnJQmRJy1&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=WAnJQmRJy1
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/1K2b2NobWR%2CEDR8zO6bA2?auth_id=WAnJQmRJy1&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 745a03b3-ed87-4ce7-9323-ce9f24541304
X-Runtime: 0.023442
Content-Length: 438

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "1K2b2NobWR",
        "uuid": "e5a941df-04c8-4ae7-a58a-8e7e5c9fa4db",
        "contact": "enL8aRxb7N",
        "user_id": "wd6Jm1LJ7m",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587334.9082859
      },
      {
        "id": "EDR8zO6bA2",
        "uuid": "ab649168-62e5-4809-8f2e-f22c637ce937",
        "contact": "2jRbkQyJ1P",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587334.897728
      }
    ]
  },
  "page": 1
}

List all Tickets

You can retrieve a paginated list of all Tickets within an account

Endpoint

GET /v1/tickets

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page to request

Request

Route

GET /v1/tickets?auth_id=PxB9NzD9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=PxB9NzD9YO
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=PxB9NzD9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 2afc25ea-87f4-4188-9915-e1e7b9d1bef7
X-Runtime: 0.094959
Content-Length: 439

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "v7Mb604JER",
        "uuid": "5f26b32a-336c-452e-a634-c871c58a7555",
        "contact": "VePJlLDJar",
        "user_id": "v5D9RAMbVA",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587333.9095051
      },
      {
        "id": "YOobKDR97E",
        "uuid": "a1e6e898-6039-44c1-81f9-1d46ff530550",
        "contact": "wd6Jm0r97m",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1601587333.9004931
      }
    ]
  },
  "page": 1
}

Search Tickets

You can search for matching Tickets based on a query

Endpoint

GET /v1/tickets

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String to search Tickets with (default: iterate through all tickets)
page Page to request

Request

Route

GET /v1/tickets?auth_id=BLP9MngJqY&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=BLP9MngJqY
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=status:Open
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=BLP9MngJqY&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: cf6ccddd-2ba0-469a-a9f7-ebdba602aada
X-Runtime: 0.033516
Content-Length: 243

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "BDr8GAd9Pl",
        "uuid": "f92fd0bd-0028-44bd-92cb-01bdc03bfb91",
        "contact": "xDjJB2VJoO",
        "user_id": "ZMvbXnZJRm",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587334.440638
      }
    ]
  },
  "page": 1
}

Update Unaddressed

You can mark a ticket as Addressed or Unaddressed automatically

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
unaddressed Flag whether the current ticket remains unaddressed. True or False boolean

Request

Route

PUT /v1/tickets/3OLb4Q394Y

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "0nMJLx4JvZ",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "unaddressed": false
}

cURL

curl "https://www.avochato.com/v1/tickets/3OLb4Q394Y" -d '{"auth_id":"0nMJLx4JvZ","auth_secret":"YYYYYYYYYYYYYYYYYYYY","unaddressed":false}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: b26675d0-a5be-4f68-8bde-1966e7a5fd81
X-Runtime: 0.027718
Content-Length: 234

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "3OLb4Q394Y",
        "uuid": "c77cb30b-39f1-4b33-9eb2-485de1ffeb19",
        "contact": "BLP9M2NJqY",
        "user_id": "VePJl0aJar",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1601587335.355826
      }
    ]
  }
}

Users

Users represent a unique user an Avochato Account.

List all Users

You can retrieve a paginated list of all Users within an account

Endpoint

GET /v1/users

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page of users to request

Request

Route

GET /v1/users?auth_id=3OLb4nOJ4Y&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=3OLb4nOJ4Y
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/users?auth_id=3OLb4nOJ4Y&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: f7579aae-d4be-4973-b87c-b993c4ee1668
X-Runtime: 0.079077
Content-Length: 251

Body

{
  "status": 200,
  "data": {
    "users": [
      {
        "email": "person_31@example.com",
        "id": "BDr8G2VJPl",
        "name": "Person 34"
      },
      {
        "email": "bob.mctest@test.com",
        "id": "EDR8zVe8A2",
        "name": "Bob McTest"
      },
      {
        "email": "other.bob@test.com",
        "id": "1K2b2Qj8WR",
        "name": "Other Bob"
      }
    ]
  },
  "page": 1
}