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_13?auth_id=3o48OQj9eA&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=3o48OQj9eA
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_13?auth_id=3o48OQj9eA&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: df7ea61b-daf0-4ca2-b6fa-93e73176865f
X-Runtime: 0.022882
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "Rg80gR7Jj0",
        "subdomain": "account_13",
        "name": "Account 13",
        "phone": null,
        "created_at": "2020-01-24T20:12:37.731-08:00"
      },
      {
        "id": "QR91x0vbge",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2020-01-24T20:12:37.744-08: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=PDz9nZ19e3&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=PDz9nZ19e3
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=PDz9nZ19e3&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: 1da67c28-3709-44b3-982d-3f39cdfabefe
X-Runtime: 0.044757
Content-Length: 295

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "AnJQzVK8y1",
        "subdomain": "account_12",
        "name": "Account 12",
        "phone": null,
        "created_at": "2020-01-24T20:12:37.648-08:00"
      },
      {
        "id": "nMJLNLRbvZ",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2020-01-24T20:12:37.662-08: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": "3OLb47a84Y",
  "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": "v5D9RwMJVA",
  "via_phone_numbers": "5105551234,4155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: a2f00a47-d76f-4f9e-9aed-940d2960ece4
X-Runtime: 0.143468
Content-Length: 367

Body

[binary data]

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/enL8aAl87N%2CPxB9NQVbYO?auth_id=Pe6be6e9Xw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=Pe6be6e9Xw
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: a77e7df0-58eb-482b-bfc6-59b6ece786d8
X-Runtime: 0.025779
Content-Length: 445

Body

[binary data]

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/xDjJBnRJoO/publish

Headers

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

Body

{
  "auth_id": "1K2b2m48WR",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "schedule_for": 1581798278.2286668,
  "asap": true
}

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: e548749e-1e0c-4882-8a20-999f8ee1ca94
X-Runtime: 0.054519
Content-Length: 236

Body

[binary data]

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

Headers

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

Body

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

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 825c0ad2-6c72-48f4-8811-02aae8820337
X-Runtime: 0.161117
Content-Length: 329

Body

[binary data]

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": "GeAbZBabDM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"GeAbZBabDM","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: 58da06f1-6fd5-4752-8f3d-537f25e684b0
X-Runtime: 0.044469
Content-Length: 324

Body

{
  "status": 200,
  "data": {
    "call_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9bm90cmVhbCBzY29wZTpjbGllbnQ6aW5jb21pbmc_Y2xpZW50TmFtZT03TWI2a0VqOUVSIiwiaXNzIjoidHdpbGlvX2FjY291bnRfc2lkIiwibmJmIjoxNTc5OTI1NTYxLCJleHAiOjE1ODAwMTE5NjF9.RX8EcTCG8iQ4LzpSk8wW6aQRhqO4bB8YYm09ZSjiIcE"
  }
}

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

Headers

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

Query Parameters

auth_id=YOobKkrb7E
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=YOobKkrb7E&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: 15217733-02e3-4e24-8cf8-c186bc91a495
X-Runtime: 0.048786
Content-Length: 205

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "id": "KRg80okJj0",
        "hotkey": null,
        "raw_text": "[Campaign 1] first message",
        "key": "one",
        "follow_up_message": "[Campaign 1] second message",
        "follow_up_delay": 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=v7Mb6XjJER&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=v7Mb6XjJER
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=v7Mb6XjJER&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: 7a6253d5-0e92-45fb-8e4d-e504c464d364
X-Runtime: 0.016104
Content-Length: 355

Body

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

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"z1N8xWNJ37","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: a7596505-91e8-453b-be11-926b6895541f
X-Runtime: 0.144164
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": "BDr8GmR9Pl",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    "+15551234568",
    "+15105551234"
  ]
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"BDr8GmR9Pl","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: 1ba9d2e5-f02b-47d6-9c74-83eb926eb67e
X-Runtime: 0.111176
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": "EDR8zWPbA2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"EDR8zWPbA2","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: da52e7c5-4140-4778-91a2-b6ae91885725
X-Runtime: 0.064117
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/DR8zLN39A2%2CDr8G13m9Pl?auth_id=1K2b2G79WR&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=1K2b2G79WR
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/DR8zLN39A2%2CDr8G13m9Pl?auth_id=1K2b2G79WR&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: 2d924ad6-a249-4583-9f4a-52433af8701f
X-Runtime: 0.051281
Content-Length: 589

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "Dr8G13m9Pl",
        "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": 1579924959.36966,
        "tags": [
          "important"
        ],
        "opted_out": false
      },
      {
        "id": "DR8zLN39A2",
        "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": 1579925559.37603,
        "tags": [

        ],
        "opted_out": false
      }
    ]
  },
  "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=Pe6beVM9Xw&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1579925499.6382458&created_at%5Bto%5D=1579925619.638301&page=1

Headers

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

Query Parameters

auth_id=Pe6beVM9Xw
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR 'San Fran'
created_at={"from"=>"1579925499.6382458", "to"=>"1579925619.638301"}
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=Pe6beVM9Xw&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1579925499.6382458&created_at%5Bto%5D=1579925619.638301&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: a1311c0d-cc2a-4b0b-9f67-d3cd51820853
X-Runtime: 0.029090
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "e6beEG7bXw",
        "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": 1579925559.61554,
        "tags": [

        ],
        "opted_out": false
      }
    ]
  },
  "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

Request

Route

POST /v1/contacts

Headers

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

Body

{
  "auth_id": "3OLb43r84Y",
  "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"
    }
  ]
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"3OLb43r84Y","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"}]}' -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: 1e2e26d8-53c9-497c-8f2a-69b0bb11e2b3
X-Runtime: 0.103881
Content-Length: 378

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "QL9WRrMbWq",
      "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": 1579925559.87516,
      "tags": [
        "blue",
        "green",
        "red"
      ],
      "opted_out": false,
      "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/DjJBveZJoO/events

Headers

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

Body

{
  "auth_id": "0N6bwWxbDM",
  "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/DjJBveZJoO/events" -d '{"auth_id":"0N6bwWxbDM","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: 3f49f2cc-69fd-4ace-bcf6-7f4ff549b217
X-Runtime: 0.085231
Content-Length: 302

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "xB9NOnWJYO",
      "account_id": "Rg80gz4Jj0",
      "ticket_id": "QR91xPVbge",
      "contact_id": "DjJBveZJoO",
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "element_id": "mQL9W79Wqz",
      "element_type": "CustomEvent",
      "sent_at": 1579925553.13251
    }
  }
}

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": "qQR91Gv8ge",
  "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":"qQR91Gv8ge","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: f3b8263f-a369-4dd2-a5a9-213ec059f93f
X-Runtime: 0.735574
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "nL8aE7p87N",
      "account_id": "nMJLNG3bvZ",
      "ticket_id": "Rg80g4BJj0",
      "contact_id": "zjJ7LvE85y",
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "element_id": "EZA9P5Jrwg",
      "element_type": "CustomEvent",
      "sent_at": 1579925552.33049
    }
  }
}

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

Headers

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

Body

{
  "auth_id": "M3Nbrp7Jr6",
  "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/N6bwQKPJDM/events" -d '{"auth_id":"M3Nbrp7Jr6","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: c88aa6e2-ef08-499d-b8f8-5af9bd55ef5a
X-Runtime: 0.142297
Content-Length: 305

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "LP9MqD09qY",
      "account_id": "MvbX72O8Rm",
      "ticket_id": "N6bwQKPJDM",
      "contact_id": "jRbk1eMJ1P",
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "element_id": "AEgb5r9ejL",
      "element_type": "CustomEvent",
      "sent_at": 1579925553.47337
    }
  }
}

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/3Nbrzvobr6/events?auth_id=k5V9VRE9lr&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=k5V9VRE9lr
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/3Nbrzvobr6/events?auth_id=k5V9VRE9lr&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: 247a1d89-adbc-444e-83ae-395897e2ccd7
X-Runtime: 0.035762
Content-Length: 2101

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "d6JmxEP97m",
        "ticket_id": "3Nbrzvobr6",
        "user_id": "AnJQ16wJy1",
        "status": "Closed",
        "element_id": "xDjJBR1JoO",
        "element_type": "StatusChange",
        "sent_at": 1579925553.82302
      },
      {
        "account_id": "d6JmxEP97m",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": null,
        "duration": 119,
        "segments": 2,
        "element_id": "43y83OD8VN",
        "element_type": "Call",
        "sent_at": 1579925553.8169
      },
      {
        "uuid": "dd4fcef2-b18c-42f7-b512-a892e24848f0",
        "account_id": "d6JmxEP97m",
        "ticket_id": "3Nbrzvobr6",
        "contact_id": "nL8aEg387N",
        "sender_id": "AnJQ16wJy1",
        "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": 1579925553.80984,
        "sent_at": 1579925553.81149,
        "element_id": "QR91DMVbge",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "faadb583-be66-465e-8fdc-4abced12ce58",
        "account_id": "d6JmxEP97m",
        "ticket_id": "3Nbrzvobr6",
        "contact_id": "nL8aEg387N",
        "sender_id": "AnJQ16wJy1",
        "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": 1579925553.80425,
        "sent_at": 1579925553.8057,
        "element_id": "Rg80KNBJj0",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "d6JmxEP97m",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": null,
        "duration": 10,
        "segments": 1,
        "element_id": "xoWbqGWJqn",
        "element_type": "Call",
        "sent_at": 1579925553.80045
      },
      {
        "account_id": "d6JmxEP97m",
        "ticket_id": "3Nbrzvobr6",
        "user_id": "AnJQ16wJy1",
        "status": "Open",
        "element_id": "ezjJ7d185y",
        "element_type": "StatusChange",
        "sent_at": 1579925553.79461
      },
      {
        "account_id": "d6JmxEP97m",
        "ticket_id": "3Nbrzvobr6",
        "user_id": "AnJQ16wJy1",
        "owner_id": "AnJQ16wJy1",
        "element_id": "3o48OlxbeA",
        "element_type": "OwnerChange",
        "sent_at": 1579925553.78682
      }
    ]
  }
}

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=3YnbgZ08ae&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1579925496.4652102&created_at%5Bto%5D=1579925616.465312&document=private

Headers

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

Query Parameters

auth_id=3YnbgZ08ae
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1579925496.4652102", "to"=>"1579925616.465312"}
document=private

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=3YnbgZ08ae&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1579925496.4652102&created_at%5Bto%5D=1579925616.465312&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: 68d9530c-c77d-4857-965d-2d6e85efa653
X-Runtime: 0.038580
Content-Length: 570

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "32351f00-3654-4ce6-845a-65cec6102293",
        "account_id": "xB9NX1O8YO",
        "ticket_id": "OobK1vwJ7E",
        "contact_id": "vnJAYWDJAD",
        "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": 1579925556.38577,
        "sent_at": 1579925556.38736,
        "element_id": "xk9ELG7bRK",
        "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=RkAJvWW80o&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1579919555.898339&created_at%5Bto%5D=1579925615.898401

Headers

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

Query Parameters

auth_id=RkAJvWW80o
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1579919555.898339", "to"=>"1579925615.898401"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=RkAJvWW80o&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1579919555.898339&created_at%5Bto%5D=1579925615.898401" -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: 788d1f48-c412-4e2a-965d-e39ad06f7e3e
X-Runtime: 0.072063
Content-Length: 570

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "48fb3d34-7da5-4ec7-bb63-6dde80e49ec9",
        "account_id": "nL8ajqjb7N",
        "ticket_id": "Dz9nXEm8e3",
        "contact_id": "5V9Vmwmblr",
        "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": 1579925555.71015,
        "sent_at": 1579925555.71156,
        "element_id": "3NbrBNobr6",
        "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": "1LxJDrqbn2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "from": "+15105551234",
  "mark_addressed": "true",
  "tags": "Some Tag, Another Tag",
  "status_callback": "http://my.domain.com"
}

cURL

curl "https://www.avochato.com/v1/messages" -d '{"auth_id":"1LxJDrqbn2","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","from":"+15105551234","mark_addressed":"true","tags":"Some Tag, Another Tag","status_callback":"http://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: d4a75afc-a9d8-4531-839f-89b5377552cc
X-Runtime: 0.167089
Content-Length: 543

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "cd30e5b2-dfef-4026-9f0b-3938b597c351",
      "account_id": "LP9MM0W9qY",
      "ticket_id": "DR8zpGk9A2",
      "contact_id": "Ynbgd2R9ae",
      "sender_id": "xk9Earp9RK",
      "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": "http://my.domain.com",
      "created_at": 1579925557.12864,
      "sent_at": 1579925557.12646,
      "element_id": "webYq5AbaE",
      "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/ePJlv5Obar%2Cd6Jm6yl87m/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/ePJlv5Obar%2Cd6Jm6yl87m/tags" -d '{"auth_id":"43y83Gn8VN","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: 0146ece9-e923-4f66-a932-e9f4bc60ffd5
X-Runtime: 0.046888
Content-Length: 94

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"xoWbqZB9qn","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: cd2ba402-1326-4e25-bed3-ece2810db642
X-Runtime: 0.064050
Content-Length: 81

Body

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

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/DjJBv5ZJoO%2CzjJ7LRE85y/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/DjJBv5ZJoO%2CzjJ7LRE85y/tags" -d '{"auth_id":"wEG8jZN8Ql","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: d785eed5-67af-4f68-b949-e33551fde27a
X-Runtime: 0.044239
Content-Length: 96

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"xlYJpZLbmw","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: 3cb7b68e-36bf-45ab-96b5-f9512207987a
X-Runtime: 0.042724
Content-Length: 83

Body

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

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

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/oWbq7QWJqn" -d '{"auth_id":"ZMvbXlObRm","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: ab04eef9-0fbd-4100-8ed8-f1c1256d9f4b
X-Runtime: 0.127951
Content-Length: 234

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "oWbq7QWJqn",
        "uuid": "e45743d3-0fe0-4bec-9565-7fe99b95838b",
        "contact": "nMJLv77bvZ",
        "user_id": "3y833xG8VN",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925562.879127
      }
    ]
  }
}

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

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/webomRGJXm" -d '{"auth_id":"v5D9R1xbVA","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: b7fea099-b6a0-46ca-8259-0f87477235e6
X-Runtime: 0.093286
Content-Length: 227

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "webomRGJXm",
        "uuid": "1e271217-c058-4eca-91d9-2202dd917338",
        "contact": "LP9MqBw9qY",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925562.4553459
      }
    ]
  }
}

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/5D9RBdW9VA%2ClYJp6Mmbmw

Headers

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

Body

{
  "auth_id": "VePJlZ5bar",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_25@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/5D9RBdW9VA%2ClYJp6Mmbmw" -d '{"auth_id":"VePJlZ5bar","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_25@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: f507bc57-298e-43a2-b4f5-d7ea8d688afd
X-Runtime: 0.389357
Content-Length: 437

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "lYJp6Mmbmw",
        "uuid": "d86685df-80df-4ad8-b622-0817c0773808",
        "contact": "d6Jm67z87m",
        "user_id": "MvbXqOj9Rm",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925563.8210151
      },
      {
        "id": "5D9RBdW9VA",
        "uuid": "9702dde5-dc5a-4351-89d6-b86fcb543d56",
        "contact": "ePJlvmYbar",
        "user_id": "MvbXqOj9Rm",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925563.830985
      }
    ]
  }
}

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/EG8jnlY8Ql%2C3y83WxD8VN

Headers

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

Body

{
  "auth_id": "wd6JmZP87m",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "lYJp3M59mw"
}

cURL

curl "https://www.avochato.com/v1/tickets/EG8jnlY8Ql%2C3y83WxD8VN" -d '{"auth_id":"wd6JmZP87m","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"lYJp3M59mw"}' -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: f9c4b1b1-0fbf-4d4a-a347-8968d5103767
X-Runtime: 0.160821
Content-Length: 437

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "3y83WxD8VN",
        "uuid": "eaba16b5-9ec9-40e8-8ce2-f7ac9ecc94ce",
        "contact": "Rg80yALbj0",
        "user_id": "lYJp3M59mw",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925563.320296
      },
      {
        "id": "EG8jnlY8Ql",
        "uuid": "ea493db7-2038-462a-a70b-5281d0638698",
        "contact": "MvbXqBz9Rm",
        "user_id": "lYJp3M59mw",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925563.3265438
      }
    ]
  }
}

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

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/zjJ7We1J5y" -d '{"auth_id":"xDjJBO68oO","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: f5d529a6-e61a-44a2-9106-5d691b18df69
X-Runtime: 0.095164
Content-Length: 236

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "zjJ7We1J5y",
        "uuid": "6f0eb260-f0c0-43ce-977a-38c836a77b24",
        "contact": "nL8aEDl87N",
        "user_id": "ePJlvBNbar",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1579925565.255487
      }
    ]
  }
}

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/d6Jmxkp97m%2CMvbX7O48Rm

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/d6Jmxkp97m%2CMvbX7O48Rm" -d '{"auth_id":"ezjJ7mOb5y","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: 2cc44e63-a3c6-41f7-9480-d47a900a470d
X-Runtime: 0.228830
Content-Length: 432

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "MvbX7O48Rm",
        "uuid": "71b4b6e4-92e5-4bcc-a3ab-3606818cc241",
        "contact": "zjJ7LOL85y",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925564.6257448
      },
      {
        "id": "d6Jmxkp97m",
        "uuid": "1be11463-a7e3-419f-a4d8-8cf27a162d70",
        "contact": "DjJBv7RJoO",
        "user_id": "d6Jm6ke87m",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925564.635991
      }
    ]
  }
}

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/kAJvMOR90o%2CwebY0WA8aE?auth_id=NEnJdrpbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=NEnJdrpbRm
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/kAJvMOR90o%2CwebY0WA8aE?auth_id=NEnJdrpbRm&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: 493800af-d106-4717-a3ed-7f275065dd4b
X-Runtime: 0.019613
Content-Length: 438

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "kAJvMOR90o",
        "uuid": "03c779f7-35a3-433a-8ddb-b979b4e0640b",
        "contact": "QR91yd49ge",
        "user_id": "QR91yPE9ge",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925554.897204
      },
      {
        "id": "webY0WA8aE",
        "uuid": "72ad7626-76b7-49f3-a41a-f48214cae10c",
        "contact": "Rg80ywLbj0",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925554.8907762
      }
    ]
  },
  "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=AwebY7mJaE&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=AwebY7mJaE
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=AwebY7mJaE&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: bcd808b2-ab80-46b8-aeaf-32880d54df42
X-Runtime: 0.050837
Content-Length: 437

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "LxJD5wd8n2",
        "uuid": "dbc6f46f-34ed-4523-9f4e-6ce7b92b0802",
        "contact": "3NbrYjz8r6",
        "user_id": "N6bwrK18DM",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925555.228572
      },
      {
        "id": "YnbgEQ5Jae",
        "uuid": "05fdf7c5-2dd1-45d4-9a5d-d139d61e74ef",
        "contact": "N6bwrBZ8DM",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1579925555.220722
      }
    ]
  },
  "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=qxk9EVEJRK&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=qxk9EVEJRK&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: 1ee8f812-c67f-477a-bd5f-bba79b9d6d47
X-Runtime: 0.078127
Content-Length: 243

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xk9Ezr7JRK",
        "uuid": "21d0c0e9-38fb-4f4c-ae03-d61b60e178c8",
        "contact": "LP9Mqmw9qY",
        "user_id": "nMJLvgEbvZ",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925553.963295
      }
    ]
  },
  "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/EnJd0aLJRm

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/EnJd0aLJRm" -d '{"auth_id":"kvnJA0n9AD","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: 29ae9ce8-2f77-4901-853d-e0ece0faa0a8
X-Runtime: 0.023666
Content-Length: 235

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "EnJd0aLJRm",
        "uuid": "39ff1e90-05e2-4419-959d-d0fa593797c5",
        "contact": "nMJLvX7bvZ",
        "user_id": "Rg80y4Pbj0",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1579925554.5012422
      }
    ]
  }
}