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

Fetch one or more Accounts by their unique subdomain

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_20?auth_id=wEG8j0e9Ql&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=wEG8j0e9Ql
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_20?auth_id=wEG8j0e9Ql&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: 4a03bb45-16b5-4aeb-9e90-ea8441c450c0
X-Runtime: 0.020315
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "enL8aLdJ7N",
        "subdomain": "account_20",
        "name": "Account 20",
        "phone": null,
        "created_at": "2021-07-22T15:36:28.196-07:00"
      },
      {
        "id": "PxB9NP08YO",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2021-07-22T15:36:28.223-07:00"
      }
    ]
  },
  "page": 1
}

List Accounts

List each of the Accounts this API Key can access

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=43y83lVbVN&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=43y83lVbVN
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=43y83lVbVN&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: 124b4b5e-2d9c-40cd-b051-73f532a66343
X-Runtime: 0.058065
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "xDjJBgL8oO",
        "subdomain": "account_19",
        "name": "Account 19",
        "phone": null,
        "created_at": "2021-07-22T15:36:28.093-07:00"
      },
      {
        "id": "2jRbkyjJ1P",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2021-07-22T15:36:28.121-07:00"
      }
    ]
  },
  "page": 1
}

Broadcasts

A Broadcast is a message that is delivered to one or more contacts. In order to send a broadcast via the API, you must
1) Create a broadcast
2) Add contacts to the broadcast audience
3)Publish your broadcast (either ASAP or in the future).

The recipients will each receive your broadcast’s message on their device in a 1-on-1 conversation with your Avochato number.
You can use variables like $first_name to customize the content of the message.
Broadcasts with large audiences or long message content will take longer to deliver to the entire audience. Broadcasts cannot be sent to groups.

Create Broadcast

Create a new broadcast

Endpoint

POST /v1/broadcasts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
message required String, the Message you want to broadcast (1600 character limit)
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 String, name of this broadcast
via_tags Comma-separated list of contact tags to add to this broadcast
via_contact_ids Comma-separated list of contact ids to add to this broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to this broadcast
via_field[field] String, either name ,phone ,phone_formatted ,email ,company ,street ,city ,state ,country ,zip ,priority ,opted_out ,salesforce_object_id ,salesforce_object_type, 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": "BDr8GlYbPl",
  "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": "ezjJ7NP95y",
  "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":"BDr8GlYbPl","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":"ezjJ7NP95y","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: bdce8208-89a6-450a-9ca9-3fddf5040046
X-Runtime: 0.125197
Content-Length: 365

Body

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

Fetch Broadcasts

Fetch one or more 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/xoWbqpY8qn%2C43y832xJVN?auth_id=z1N8xapb37&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=z1N8xapb37
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/xoWbqpY8qn%2C43y832xJVN?auth_id=z1N8xapb37&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: 9867859e-d207-49b7-99cd-e025f66f715c
X-Runtime: 0.027975
Content-Length: 441

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "xoWbqpY8qn",
        "name": null,
        "message": "5",
        "media_url": null,
        "status": "initialized",
        "contacts_count": 1,
        "user": {
          "email": "person_6@example.com",
          "id": "xoWbq609qn",
          "name": "Person 6"
        },
        "status_callback": null
      },
      {
        "id": "43y832xJVN",
        "name": null,
        "message": "6",
        "media_url": null,
        "status": "queued",
        "contacts_count": 0,
        "user": {
          "email": "person_6@example.com",
          "id": "xoWbq609qn",
          "name": "Person 6"
        },
        "status_callback": null
      }
    ]
  }
}

Publish Broadcast

Publish your broadcast

Endpoint

POST /v1/broadcasts/:id/publish

Parameters

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

Request

Route

POST /v1/broadcasts/Pweboa1JXm/publish

Headers

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

Body

{
  "auth_id": "v7Mb6qQ8ER",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "scheduled_for": 1626957385.135988,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/Pweboa1JXm/publish" -d '{"auth_id":"v7Mb6qQ8ER","auth_secret":"YYYYYYYYYYYYYYYYYYYY","scheduled_for":1626957385.135988,"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: 192e254b-ff72-4467-bcee-49a71b24f73d
X-Runtime: 0.085137
Content-Length: 239

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "Pweboa1JXm",
      "name": null,
      "message": "3",
      "media_url": null,
      "status": "initialized",
      "contacts_count": 1,
      "user": {
        "email": "person_5@example.com",
        "id": "GeAbZmA8DM",
        "name": "Person 5"
      },
      "status_callback": null
    }
  }
}

Update Broadcast

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 String, the Message you want to broadcast (1600 character limit)
media_url Url of media to send in MMS (500kb limit)
name String, name of this broadcast
via_tags Comma-separated list of contact tags to add to this broadcast
via_contact_ids Comma-separated list of contact ids to add to this broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to this broadcast
via_field[field] String, [:name, :phone, :phone_formatted, :email, :company, :street, :city, :state, :country, :zip, :priority, :opted_out, :salesforce_object_id, :salesforce_object_type], 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/AEgb56r9ej

Headers

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

Body

{
  "auth_id": "YOobKoob7E",
  "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": "0nMJLPpJvZ",
  "via_phone_numbers": "+15105551234,+14155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

cURL

curl "https://www.avochato.com/v1/broadcasts/AEgb56r9ej" -d '{"auth_id":"YOobKoob7E","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":"0nMJLPpJvZ","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: 848df8ac-6fcf-4523-8f28-6b6b36c620d1
X-Runtime: 0.171658
Content-Length: 327

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "AEgb56r9ej",
      "name": "My Other Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty2.jpg",
      "status": "initialized",
      "contacts_count": 1,
      "user": {
        "email": "person_4@example.com",
        "id": "Pweboz58Xm",
        "name": "Person 4"
      },
      "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": "xDjJBWX8oO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"xDjJBWX8oO","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: 18d0795a-744b-4cc8-b210-1b2528a770b9
X-Runtime: 0.050549
Content-Length: 324

Body

{
  "status": 200,
  "data": {
    "call_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9bm90cmVhbCBzY29wZTpjbGllbnQ6aW5jb21pbmc_Y2xpZW50TmFtZT1WZVBKbHlkOGFyIiwiaXNzIjoidHdpbGlvX2FjY291bnRfc2lkIiwibmJmIjoxNjI2OTkzMzg5LCJleHAiOjE2MjcwNzk3ODl9.iHlP0smfWNMnzA9AnkwP1t07TdzhnW8DTyjsyzcIs50"
  }
}

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=EZA9PxP9rw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=EZA9PxP9rw
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=EZA9PxP9rw&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: c6cc4f41-162c-4b0e-ad88-bba29bbd403d
X-Runtime: 0.016075
Content-Length: 245

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "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
      }
    ]
  },
  "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=3OLb47a84Y&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=3OLb47a84Y
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=3OLb47a84Y&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: 0c70d193-4e7f-4653-9501-afe476d28339
X-Runtime: 0.017402
Content-Length: 435

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "id": "v7Mb6WN9ER",
        "key": "two",
        "raw_text": "[Campaign 2] first message",
        "follow_up_message": "[Campaign 2] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "v7Mb6WN9ER",
        "hotkey": null
      },
      {
        "id": "YOobKadJ7E",
        "key": "one",
        "raw_text": "[Campaign 1] first message",
        "follow_up_message": "[Campaign 1] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "YOobKadJ7E",
        "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": "EDR8zAZJA2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"EDR8zAZJA2","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: 57eb2c77-d73d-49fc-84ad-1f4111646a82
X-Runtime: 0.149047
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": "1K2b2m48WR",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    "+15551234568",
    "+15105551234"
  ]
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"1K2b2m48WR","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: cb0cd44d-fdcf-4104-9335-c6ff915cb7cd
X-Runtime: 0.081794
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": "Pe6be6e9Xw",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"Pe6be6e9Xw","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: b4cc0c03-0946-488c-be26-199820913fa5
X-Runtime: 0.051114
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/AEgb5le8ej%2CmQL9Wz6bWq?auth_id=2jRbk6481P&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=2jRbk6481P
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/AEgb5le8ej%2CmQL9Wz6bWq?auth_id=2jRbk6481P&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: c21d626f-73e7-44e3-bc8b-c8daaf9c9dd3
X-Runtime: 0.067892
Content-Length: 896

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "mQL9Wz6bWq",
        "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": 1626992789.45971,
        "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,
        "visible": true
      },
      {
        "id": "AEgb5le8ej",
        "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": 1626993389.4835,
        "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,
        "visible": true
      }
    ]
  },
  "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=BLP9My19qY&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1626993330.1022289&created_at%5Bto%5D=1626993450.102255&page=1

Headers

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

Query Parameters

auth_id=BLP9My19qY
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR 'San Fran'
created_at={"from"=>"1626993330.1022289", "to"=>"1626993450.102255"}
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=BLP9My19qY&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1626993330.1022289&created_at%5Bto%5D=1626993450.102255&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: d5ded135-8552-4b59-8c34-8b1d92dcfe66
X-Runtime: 0.054930
Content-Length: 469

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "v5D9RYGbVA",
        "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": 1626993390.08664,
        "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,
        "visible": true
      }
    ]
  },
  "page": 1
}

Update Multiple Contacts

Create or update multiple Contacts based on their phone numbers. Given a list of contacts, Avochato will attempt to update or create a record for each unique 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 Name 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. Avochato will prevent any outbound message to an opted out contact.
contacts[n][double_opted_in] Boolean, 0 or 1. Update the Double Opt-in status of the contact.
contacts[n][muted] Boolean, 0 or 1. Mute or unmute the Contact to suppress calls and notifications from them.
contacts[n][blocked] Boolean, 0 or 1. Block or unblock the Contact to prevent all calls and texts to and from them.
contacts[n][priority] Integer, 0 through 5. Sets a priority level for the contact, 5 is the greatest.
contacts[n][visible] Boolean, 0 or 1. Visibility status of the Contact. Set to 0 to remove the contact.
contacts[n][custom_variable_name] Custom field 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 contact. Assigns all conversations to the user when set.
contacts[n][salesforce_object_id] Salesforce object id
contacts[n][salesforce_object_type] Salesforce object type
allow_empty_fields Boolean, 0 or 1. Permit overwriting custom fields with empty or null value (defaults to 0)

Request

Route

POST /v1/contacts

Headers

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

Body

{
  "auth_id": "enL8ayN87N",
  "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",
      "salesforce_object_id": "0030030000000014cAAA",
      "salesforce_object_type": "Contact"
    }
  ]
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"enL8ayN87N","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","salesforce_object_id":"0030030000000014cAAA","salesforce_object_type":"Contact"}]}' -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: 403257b0-c13c-41c4-91c4-18dc206ce6b5
X-Runtime: 0.171432
Content-Length: 563

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "GeAbZY08DM",
      "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": 1626993389.71797,
      "tags": [
        "blue",
        "green",
        "red"
      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": null,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": "3YnbgDg9ae",
      "visible": true,
      "custom_variable_name": "value to set custom variable"
    }
  }
}

Update Single Contact

Create or update a single 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
phone required Phone number of Contact
name Name of the Contact
email Email for the Contact
other_phone Other phone for the Contact
company Company Name for the Contact
street Street for the Contact
city City for the Contact
state State for the Contact
zip Zip Code for the Contact
country Country for the Contact
opted_out Opted-out status of the Contact. Avochato will prevent any outbound message to an opted out contact.
double_opted_in Boolean, 0 or 1. Update the Double Opt-in status of the contact.
muted Boolean, 0 or 1. Mute or unmute the Contact to suppress calls and notifications from them.
blocked Boolean, 0 or 1. Block or unblock the Contact to prevent all calls and texts to and from them.
priority Integer, 0 through 5. Sets a priority level for the contact, 5 is the greatest.
visible Boolean, 0 or 1. Visibility status of the Contact. Set to 0 to remove the contact.
custom_variable_name Custom variable to set for the Contact
tags CSV of tags to apply to the Contact
user_id User ID or Email of a User that is responsible for this contact. Assigns all conversations to the user when set.
salesforce_object_id Salesforce object id
salesforce_object_type Salesforce object type
allow_empty_fields Boolean, 0 or 1. Permit overwriting custom fields with empty or null value (defaults to 0)

Request

Route

POST /v1/contacts

Headers

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

Body

{
  "auth_id": "PxB9NyabYO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "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",
  "salesforce_object_id": "0030030000000014cAAA",
  "salesforce_object_type": "Contact"
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"PxB9NyabYO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","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","salesforce_object_id":"0030030000000014cAAA","salesforce_object_type":"Contact"}' -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: c0e1fb2d-2044-4c1c-977e-acb1e4789490
X-Runtime: 0.100695
Content-Length: 535

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "wEG8jxO9Ql",
      "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": 1626993389.96506,
      "tags": [

      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": null,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": null,
      "visible": true,
      "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/VePJlKd9ar/events

Headers

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

Body

{
  "auth_id": "KRg80xQ8j0",
  "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/VePJlKd9ar/events" -d '{"auth_id":"KRg80xQ8j0","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: 31fc6b50-e954-4d3b-b0f7-ef399d501ddc
X-Runtime: 0.054218
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "v7Mb64OJER",
      "account_id": "WAnJQRY8y1",
      "ticket_id": "wd6Jm3Lb7m",
      "contact_id": "VePJlKd9ar",
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "event_id": "ZMvbXAZ9Rm",
      "element_id": "AwebYoJaEr",
      "element_type": "CustomEvent",
      "sent_at": 1626993391.25784
    }
  }
}

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": "0nMJLw69vZ",
  "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":"0nMJLw69vZ","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: 9fa37ef6-94ad-4ad9-8dbd-62da32b7b7c5
X-Runtime: 0.058048
Content-Length: 339

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "YOobKBN87E",
      "account_id": "BLP9MPZbqY",
      "ticket_id": "ZMvbXdZbRm",
      "contact_id": "wd6JmW4b7m",
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "event_id": "zPG9ypqbaO",
      "element_id": "NEnJdQ8RmO",
      "element_type": "CustomEvent",
      "sent_at": 1626993391.01123
    }
  }
}

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/v5D9RnM9VA/events

Headers

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

Body

{
  "auth_id": "WAnJQK5by1",
  "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/v5D9RnM9VA/events" -d '{"auth_id":"WAnJQK5by1","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: b0eb1faf-b330-4ae5-b09c-85423f4f10e9
X-Runtime: 0.097831
Content-Length: 328

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "3o48OMw9eA",
      "account_id": "PxB9NPB8YO",
      "ticket_id": "v5D9RnM9VA",
      "contact_id": "ZMvbXYD9Rm",
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "event_id": "BDr8GxVbPl",
      "element_id": "kvnJAeJADM",
      "element_type": "CustomEvent",
      "sent_at": 1626993390.7388
    }
  }
}

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/VePJl3a9ar/events?auth_id=qQR91Xgbge&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=qQR91Xgbge
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/VePJl3a9ar/events?auth_id=qQR91Xgbge&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: fc67f9cf-c835-41e6-81e7-b73a617e4fa3
X-Runtime: 0.033877
Content-Length: 2305

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "0nMJLP3JvZ",
        "ticket_id": "VePJl3a9ar",
        "user_id": "z1N8xQAb37",
        "status": "Closed",
        "event_id": "PxB9NVx9YO",
        "element_id": "1LxJDvKbn2",
        "element_type": "StatusChange",
        "sent_at": 1626993391.47723
      },
      {
        "account_id": "0nMJLP3JvZ",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 119,
        "segments": 2,
        "event_id": "enL8a1O87N",
        "element_id": "enL8aAl87N",
        "element_type": "Call",
        "sent_at": 1626993391.47308
      },
      {
        "uuid": "fb0059f1-1046-4022-8f1f-c3a78558f975",
        "account_id": "0nMJLP3JvZ",
        "ticket_id": "VePJl3a9ar",
        "contact_id": "ezjJ7BP95y",
        "sender_id": "z1N8xQAb37",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "origin": null,
        "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": 1626993391.42499,
        "sent_at": 1626993391.4427,
        "event_id": "2jRbkve81P",
        "element_id": "PxB9NX28YO",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "334354b7-c757-449b-ab4a-f7bcb3817dde",
        "account_id": "0nMJLP3JvZ",
        "ticket_id": "VePJl3a9ar",
        "contact_id": "ezjJ7BP95y",
        "sender_id": "z1N8xQAb37",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "origin": null,
        "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": 1626993391.37642,
        "sent_at": 1626993391.39517,
        "event_id": "xDjJBzlJoO",
        "element_id": "enL8ajab7N",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "0nMJLP3JvZ",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 10,
        "segments": 1,
        "event_id": "ezjJ77XJ5y",
        "element_id": "2jRbkR681P",
        "element_type": "Call",
        "sent_at": 1626993391.37335
      },
      {
        "account_id": "0nMJLP3JvZ",
        "ticket_id": "VePJl3a9ar",
        "user_id": "z1N8xQAb37",
        "status": "Open",
        "event_id": "VePJlzabar",
        "element_id": "3Ynbgne8ae",
        "element_type": "StatusChange",
        "sent_at": 1626993391.36859
      },
      {
        "account_id": "0nMJLP3JvZ",
        "ticket_id": "VePJl3a9ar",
        "user_id": "z1N8xQAb37",
        "owner_id": "z1N8xQAb37",
        "event_id": "wd6JmnL87m",
        "element_id": "RkAJvDlb0o",
        "element_type": "OwnerChange",
        "sent_at": 1626993391.36421
      }
    ]
  },
  "page": 1
}

Messages

Search Messages

Search for matching Messages in an account based on a query.

Endpoint

GET /v1/messages

Parameters

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

Request

Route

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

Headers

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

Query Parameters

auth_id=NEnJdPxJRm
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1626987392.646008", "to"=>"1626993452.646037"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=NEnJdPxJRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1626987392.646008&created_at%5Bto%5D=1626993452.646037" -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: 59caa57f-fff6-4b32-b9da-c3d8981720e9
X-Runtime: 0.136780
Content-Length: 608

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "0a2d9c17-6dbe-4abb-8a00-4ee450c066ea",
        "account_id": "qxk9E4jbRK",
        "ticket_id": "KRg80oyJj0",
        "contact_id": "qQR91pKbge",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "origin": null,
        "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": 1626993392.59701,
        "sent_at": 1626993392.61638,
        "event_id": "k5V9VQMblr",
        "element_id": "WAnJQzv8y1",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Search Messages by timestamp

Search for matching Messages based on a query

Endpoint

GET /v1/messages

Parameters

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

Request

Route

GET /v1/messages?auth_id=AwebYRa9aE&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1626993332.985997&created_at%5Bto%5D=1626993452.986024&document=false

Headers

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

Query Parameters

auth_id=AwebYRa9aE
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1626993332.985997", "to"=>"1626993452.986024"}
document=false

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=AwebYRa9aE&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1626993332.985997&created_at%5Bto%5D=1626993452.986024&document=false" -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: 36c75986-045c-4444-9a24-4ad4c75f9bf6
X-Runtime: 0.039342
Content-Length: 608

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "8d845d50-d6f7-4c1a-9dd6-82bd653f7c49",
        "account_id": "kvnJA419AD",
        "ticket_id": "wd6JmrA87m",
        "contact_id": "M3NbrKj9r6",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "origin": null,
        "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": 1626993392.94137,
        "sent_at": 1626993392.95894,
        "event_id": "kvnJAEoJAD",
        "element_id": "KRg80gBJj0",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Send Message

Send a Message to any Contact based on their phone

Endpoint

POST /v1/messages

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number to send the message to string
message required Text to send to the recipient string
from (E.164 format) Phone Number to use to send this message. Must be a valid Avochato number that belongs to this inbox. string
mark_addressed Mark this conversation as "addressed" (default: false) boolean
media_url Media attachment to send via MMS (500kb limit) url
tags Comma-separated list of tags to apply to this contact string
status_callback Send a callback via http POST to this domain when the delivery status is updated url

Request

Route

POST /v1/messages

Headers

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

Body

{
  "auth_id": "RkAJvw680o",
  "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":"RkAJvw680o","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: 8332a638-0fbd-4a59-aa5e-ff9636050327
X-Runtime: 0.176844
Content-Length: 583

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "1599169c-2236-463d-bcf8-5472aca3c770",
      "account_id": "NEnJdp0JRm",
      "ticket_id": "2jRbkxx91P",
      "contact_id": "NEnJd108Rm",
      "sender_id": "xoWbql08qn",
      "sender_type": "User",
      "to": "+14155553333",
      "from": null,
      "direction": "out",
      "origin": "api",
      "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": 1626993393.36993,
      "sent_at": 1626993393.36828,
      "event_id": "3Ynbgvy8ae",
      "element_id": "M3Nbrzobr6",
      "element_type": "SmsMessage"
    }
  }
}

Send a Scheduled Message

Schedule a Message to deliver to a Contact at a specific date and time in the future

Endpoint

POST /v1/messages

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number to send the message to string
message required Text to send to the recipient string
scheduled_for required Unix Timestamp, Schedule this message to send at a date in the future unix_timestamp
from (E.164 format) Phone Number to use to send this message. Must be a valid Avochato number that belongs to this inbox. string
mark_addressed Mark this conversation as "addressed" (default: false) boolean
media_url Media attachment to send via MMS (500kb limit) url
tags Comma-separated list of tags to apply to this contact string
status_callback Send a callback via http POST to this domain when the delivery status is updated url

Request

Route

POST /v1/messages

Headers

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

Body

{
  "auth_id": "3YnbgMnJae",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "scheduled_for": 1626993993.663146,
  "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":"3YnbgMnJae","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","scheduled_for":1626993993.663146,"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: ae3aa074-45fb-4af7-9aca-8d0068268355
X-Runtime: 0.116174
Content-Length: 451

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "AwebYYebaE",
      "ticket_id": "BLP9MngJqY",
      "contact_id": "3YnbgO6bae",
      "sender": "person_49",
      "message": "test message",
      "media_url": null,
      "aborted": false,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1626993993.0,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": "User",
      "abort_reason": null,
      "event_id": "YOobKeXJ7E",
      "element_id": "wd6Jmzz87m",
      "element_type": "PendingMessage",
      "sent_at": 1626993393.76913
    }
  }
}

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/AwebYYebaE%2CNEnJdp0JRm/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/AwebYYebaE%2CNEnJdp0JRm/tags" -d '{"auth_id":"PweboGWbXm","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: 89b64b9b-0977-40a3-81b3-4e907e4166bc
X-Runtime: 0.022545
Content-Length: 94

Body

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

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": "GeAbZWy9DM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-new-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"GeAbZWy9DM","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: 93be1158-1d88-477c-8daa-7810fd5c56ee
X-Runtime: 0.035818
Content-Length: 81

Body

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

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/kvnJA419AD%2Cqxk9E4jbRK/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/kvnJA419AD%2Cqxk9E4jbRK/tags" -d '{"auth_id":"zPG9yNWJaO","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: a71468e6-e7b3-4596-ab46-747f4452b842
X-Runtime: 0.092739
Content-Length: 96

Body

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

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": "xoWbqxV8qn",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-old-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"xoWbqxV8qn","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: d0a4542a-4582-4377-b61a-a2b940d903fc
X-Runtime: 0.023246
Content-Length: 83

Body

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

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/0nMJLxNJvZ

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/0nMJLxNJvZ" -d '{"auth_id":"qxk9EXkbRK","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: 6caf6dbb-b2b2-436e-92d7-cc2915b8c792
X-Runtime: 0.062930
Content-Length: 370

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "0nMJLxNJvZ",
        "uuid": "1bd979ad-79f4-43e1-a138-118766018ac4",
        "contact": "KRg80249j0",
        "user_id": "AEgb5Zo9ej",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993392.265921,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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/xDjJBdlboO

Headers

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

Body

{
  "auth_id": "0N6bwOvbDM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "unassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/xDjJBdlboO" -d '{"auth_id":"0N6bwOvbDM","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: 3d01e58a-cc64-4648-8fc6-904e25eebf83
X-Runtime: 0.053353
Content-Length: 363

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xDjJBdlboO",
        "uuid": "b8c1d62e-2b68-457f-831c-415b94983293",
        "contact": "2jRbkKXb1P",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993391.5995362,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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/BLP9MnrJqY%2CPxB9NexbYO

Headers

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

Body

{
  "auth_id": "k5V9VWeJlr",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_31@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/BLP9MnrJqY%2CPxB9NexbYO" -d '{"auth_id":"k5V9VWeJlr","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_31@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: 2d8c5792-07e9-4575-8183-a3e0fd42a19d
X-Runtime: 0.106359
Content-Length: 709

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "PxB9NexbYO",
        "uuid": "899a4063-182b-4c76-bbae-fa38eabf8b34",
        "contact": "BLP9M4ZbqY",
        "user_id": "EZA9PQdJrw",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993392.0086122,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "BLP9MnrJqY",
        "uuid": "91d42c60-b409-4964-aa10-752f635ab0ec",
        "contact": "WAnJQoYby1",
        "user_id": "EZA9PQdJrw",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993392.037874,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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/enL8avOb7N%2C2jRbk3eb1P

Headers

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

Body

{
  "auth_id": "M3NbrX1Jr6",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "Pe6beDx8Xw"
}

cURL

curl "https://www.avochato.com/v1/tickets/enL8avOb7N%2C2jRbk3eb1P" -d '{"auth_id":"M3NbrX1Jr6","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"Pe6beDx8Xw"}' -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: 7d727ec2-9740-4f4c-8cf6-1f2c4b765005
X-Runtime: 0.144699
Content-Length: 709

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "2jRbk3eb1P",
        "uuid": "279d4250-55b8-420d-a3c6-104528000418",
        "contact": "enL8axwJ7N",
        "user_id": "Pe6beDx8Xw",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993391.746185,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "enL8avOb7N",
        "uuid": "cd2a809b-aed6-4991-95b5-9d460f52cb0e",
        "contact": "PxB9N4B8YO",
        "user_id": "Pe6beDx8Xw",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993391.7701828,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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/z1N8xxj837

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/z1N8xxj837" -d '{"auth_id":"AEgb5BL9ej","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: 2f53d135-750b-4c8b-8b7d-6cae4023a67c
X-Runtime: 0.055279
Content-Length: 371

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "z1N8xxj837",
        "uuid": "54b1c9c0-842c-4db8-a221-4bb91bc8329c",
        "contact": "k5V9VPX8lr",
        "user_id": "ezjJ7G7J5y",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1626993387.16551,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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/YOobKeXJ7E%2C3o48OeQ9eA

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/YOobKeXJ7E%2C3o48OeQ9eA" -d '{"auth_id":"mQL9WWz9Wq","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: 59071712-a031-48c8-ad81-345b5039cd34
X-Runtime: 0.171464
Content-Length: 700

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "3o48OeQ9eA",
        "uuid": "e61866da-db7e-4dec-989d-3cf8ef147799",
        "contact": "qQR91mK9ge",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993386.850461,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "YOobKeXJ7E",
        "uuid": "87890898-8cdc-4150-b727-e9d520efe36a",
        "contact": "0N6bwRl8DM",
        "user_id": "VePJlD6Jar",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993386.885,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

Tickets

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

Fetch Previous Tickets

You can fetch information about previous tickets by source ticket id

Endpoint

GET /v1/tickets/:id/previous

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL parameter) Source Ticket id string

Request

Route

GET /v1/tickets/xlYJpXGJmw/previous?auth_id=ezjJ7yZb5y&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=ezjJ7yZb5y
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/tickets/xlYJpXGJmw/previous?auth_id=ezjJ7yZb5y&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: 85586cad-9b9a-4155-9dd1-d68ce687add4
X-Runtime: 0.025189
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "wEG8jR58Ql",
        "uuid": "7f1b287d-16c1-4b5e-b15c-3d1d150b81bc",
        "channel": "sms",
        "contact": "EZA9Pgkbrw",
        "created_at": 1626993389.23564,
        "closed_at": 1626989789.23252,
        "user": {
          "id": "kvnJAwBbAD",
          "name": "Person 17"
        },
        "device_type": null,
        "option_data": null,
        "tags": [

        ],
        "account_subdomain": "account_26"
      }
    ]
  }
}

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/zPG9yGq8aO%2CmQL9WQp8Wq?auth_id=wd6JmAjJ7m&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=wd6JmAjJ7m
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/zPG9yGq8aO%2CmQL9WQp8Wq?auth_id=wd6JmAjJ7m&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: 55c8ffbc-393e-4422-9f60-4a0cacbc9236
X-Runtime: 0.018492
Content-Length: 709

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "zPG9yGq8aO",
        "uuid": "1f0d4a26-afcf-457a-9e9f-1418a6586153",
        "contact": "EDR8zm6JA2",
        "user_id": "k5V9VkyJlr",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993388.922506,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "mQL9WQp8Wq",
        "uuid": "27ed1211-5bee-4c03-8d5c-0839bdd4e534",
        "contact": "BDr8G5d9Pl",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993388.870322,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  },
  "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=v5D9RzV9VA&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=v5D9RzV9VA
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=v5D9RzV9VA&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: 7b2d0b9e-2c72-4692-a377-61bbe3d4351d
X-Runtime: 0.057232
Content-Length: 710

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "1K2b22jbWR",
        "uuid": "f8c00f77-c408-4e67-bc50-981212e6c581",
        "contact": "YOobK4R97E",
        "user_id": "0N6bwM2JDM",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993388.4766169,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "BDr8GYV9Pl",
        "uuid": "2ac12bc9-e373-4dba-89d0-9f4af4cc51e9",
        "contact": "3o48O2eJeA",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1626993388.417886,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  },
  "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=ZMvbXWK8Rm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=ZMvbXWK8Rm&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: 202dbe45-92da-44a2-bfdb-f59d02aadc06
X-Runtime: 0.040124
Content-Length: 380

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "EZA9Pzn8rw",
        "uuid": "7e399a1c-7323-40f8-b4dd-c1e2fff9b2eb",
        "contact": "z1N8xRm937",
        "user_id": "M3Nbr759r6",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993388.7216709,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  },
  "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/xoWbqmLbqn

Headers

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

Body

{
  "auth_id": "VePJlwo9ar",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "unaddressed": false
}

cURL

curl "https://www.avochato.com/v1/tickets/xoWbqmLbqn" -d '{"auth_id":"VePJlwo9ar","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: 32ed82a8-73c3-4f70-ab57-d63522092974
X-Runtime: 0.019476
Content-Length: 370

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xoWbqmLbqn",
        "uuid": "f54aa544-786d-47f1-a2c5-74a525b30567",
        "contact": "Pe6bePw8Xw",
        "user_id": "qxk9EvwJRK",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1626993389.091178,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ]
  }
}

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=xlYJpA08mw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=xlYJpA08mw
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/users?auth_id=xlYJpA08mw&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: ae3b3fe6-f1c0-49b2-b831-7b21d3ddeed5
X-Runtime: 0.052918
Content-Length: 251

Body

{
  "status": 200,
  "data": {
    "users": [
      {
        "email": "person_12@example.com",
        "id": "0nMJLk49vZ",
        "name": "Person 12"
      },
      {
        "email": "bob.mctest@test.com",
        "id": "KRg80pk8j0",
        "name": "Bob McTest"
      },
      {
        "email": "other.bob@test.com",
        "id": "qQR913G8ge",
        "name": "Other Bob"
      }
    ]
  },
  "page": 1
}