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

Headers

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

Query Parameters

auth_id=3OLb4Y94Ym
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_31?auth_id=3OLb4Y94Ym&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 239cc6ed-2547-4f62-a869-83f025d456cc
X-Runtime: 0.020999
Content-Length: 312

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "EZA9P5Jrwg",
        "subdomain": "account_31",
        "name": "Account 31",
        "phone": null,
        "created_at": 1702405172.504549,
        "tcr_campaign_id": null
      },
      {
        "id": "mQL9W79Wqz",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1702405172.52704,
        "tcr_campaign_id": null
      }
    ]
  },
  "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=Pe6bez9Xwy&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=Pe6bez9Xwy
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=Pe6bez9Xwy&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 48b09c3b-ea91-4402-9064-eb0f9e2c7307
X-Runtime: 0.037104
Content-Length: 314

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "Pe6bez9Xwy",
        "subdomain": "account_30",
        "name": "Account 30",
        "phone": null,
        "created_at": 1702405172.3945432,
        "tcr_campaign_id": null
      },
      {
        "id": "3OLb4Y94Ym",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1702405172.421818,
        "tcr_campaign_id": null
      }
    ]
  },
  "page": 1
}

List Current API Credentials

List info about this API Key and its account

Endpoint

GET /v1/whoami

Parameters

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

Request

Route

GET /v1/whoami?auth_id=EZA9P5Jrwg&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=EZA9P5Jrwg
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/whoami?auth_id=EZA9P5Jrwg&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 6aac06c6-2ce2-4c9f-bfff-1ab8d1895600
X-Runtime: 0.020618
Content-Length: 303

Body

{
  "status": 200,
  "data": {
    "account": {
      "id": "AEgb5r9ejL",
      "subdomain": "account_32",
      "name": "Account 32",
      "phone": null,
      "created_at": 1702405172.584092,
      "tcr_campaign_id": null
    },
    "user": {
      "email": "person_23@example.com",
      "id": "zPG9yg8aO0",
      "name": "Person 25"
    },
    "origin": "api",
    "created_at": "2023-12-12T10:19:32.591-08:00"
  }
}

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.

Audience Count

Get Broadcast audience count

Endpoint

GET /v1/broadcasts/:id/audience_count

Parameters

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

Request

Route

GET /v1/broadcasts/qQR9178geK/audience_count?auth_id=YOobKd97E4&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=YOobKd97E4
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/broadcasts/qQR9178geK/audience_count?auth_id=YOobKd97E4&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 72ebdd60-fbe0-458b-960f-7d0774716ef4
X-Runtime: 0.020289
Content-Length: 20

Body

{
  "data": {
    "count": 1
  }
}

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
assign_to_user_id User ID or Email of a User that is assigned to all broadcasted conversations

Request

Route

POST /v1/broadcasts

Headers

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

Body

{
  "auth_id": "3YnbgeJae2",
  "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": "BDr8Gk8PlQ",
  "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":"3YnbgeJae2","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":"BDr8Gk8PlQ","via_phone_numbers":"5105551234,4155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: b60a973d-28a0-48fb-b752-8ea492de6469
X-Runtime: 0.105778
Content-Length: 632

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "2jRbk681Pv",
      "name": "My New Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty.jpg",
      "estimated_segments_sms": 1,
      "estimated_segments_mms": 1,
      "status_callback": "https://somesite.com/some_callback_route",
      "status": "draft",
      "created_at": 1702405169.81952,
      "updated_at": 1702405169.81952,
      "scheduled_for": 0.0,
      "completed_at": null,
      "user": {
        "email": "person_11@example.com",
        "id": "3o48Og8eAv",
        "name": "Person 13"
      },
      "sms_errors": {
      },
      "mms_errors": {
      },
      "audience": 0,
      "contacts_count": 0,
      "attempted": 0,
      "delivered": 0,
      "undelivered": 0,
      "responded": 0,
      "replied_stop": 0,
      "pending_contacts_count": 3
    }
  }
}

Fetch Broadcast(s)

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/0nMJLk9vZ2%2CKRg80abj0q?auth_id=3o48Og8eAv&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=3o48Og8eAv
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/0nMJLk9vZ2%2CKRg80abj0q?auth_id=3o48Og8eAv&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: f974f4ee-5358-4193-8147-9b9df4010e30
X-Runtime: 0.092906
Content-Length: 1076

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "0nMJLk9vZ2",
        "name": null,
        "message": "Quos praesentium nemo ut.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1702405170.373918,
        "updated_at": 1702405170.373918,
        "scheduled_for": 1703009970.373536,
        "completed_at": null,
        "user": {
          "email": "person_14@example.com",
          "id": "z1N8x2937L",
          "name": "Person 16"
        },
        "sms_errors": {
        },
        "mms_errors": {
        },
        "audience": 1,
        "contacts_count": 1,
        "attempted": 0,
        "delivered": 0,
        "undelivered": 0,
        "responded": 0,
        "replied_stop": 0
      },
      {
        "id": "KRg80abj0q",
        "name": null,
        "message": "Dolorem et voluptatem nam.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1702405170.378179,
        "updated_at": 1702405170.378179,
        "scheduled_for": 1703009970.377999,
        "completed_at": null,
        "user": {
          "email": "person_14@example.com",
          "id": "z1N8x2937L",
          "name": "Person 16"
        },
        "sms_errors": {
        },
        "mms_errors": {
        },
        "audience": 0,
        "contacts_count": 0,
        "attempted": 0,
        "delivered": 0,
        "undelivered": 0,
        "responded": 0,
        "replied_stop": 0
      }
    ]
  },
  "page": 1
}

List Broadcasts

Fetch a paginated list of broadcasts

Endpoint

GET /v1/broadcasts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page number to request
created_at[from] Show Broadcasts created after this unix timestamp
created_at[to] Show Broadcasts created before this unix timestamp

Request

Route

GET /v1/broadcasts?auth_id=PDz9n29e3m&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=PDz9n29e3m
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts?auth_id=PDz9n29e3m&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 043fdcf8-051c-4838-b4c0-aa81669d977d
X-Runtime: 0.024749
Content-Length: 790

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "WAnJQmJy1v",
        "name": null,
        "message": "Eveniet ducimus quis unde.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1702405170.197922,
        "updated_at": 1702405170.197922,
        "scheduled_for": 1703009970.19769,
        "completed_at": null,
        "user": {
          "email": "person_13@example.com",
          "id": "v7Mb6NbERA",
          "name": "Person 15"
        }
      },
      {
        "id": "BLP9Me9qYX",
        "name": null,
        "message": "Enim amet et iste.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1702405170.196755,
        "updated_at": 1702405170.196755,
        "scheduled_for": 1703009970.196509,
        "completed_at": null,
        "user": {
          "email": "person_13@example.com",
          "id": "v7Mb6NbERA",
          "name": "Person 15"
        }
      }
    ]
  },
  "page": 1
}

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

Headers

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

Body

{
  "auth_id": "RkAJvlb0oL",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "scheduled_for": 1702369169.501769,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/wd6Jmz87m3/publish" -d '{"auth_id":"RkAJvlb0oL","auth_secret":"YYYYYYYYYYYYYYYYYYYY","scheduled_for":1702369169.501769,"asap":true}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: bc8cc72e-5da1-455e-9fa1-c083be1f6d75
X-Runtime: 0.139370
Content-Length: 554

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "wd6Jmz87m3",
      "name": null,
      "message": "Consequuntur vero rem quis.",
      "media_url": null,
      "estimated_segments_sms": 1,
      "estimated_segments_mms": 0,
      "status_callback": null,
      "status": "draft",
      "created_at": 1702405169.3837671,
      "updated_at": 1702405169.3837671,
      "scheduled_for": 1702405179.5451121,
      "completed_at": null,
      "user": {
        "email": "person_10@example.com",
        "id": "PDz9n29e3m",
        "name": "Person 12"
      },
      "sms_errors": {
      },
      "mms_errors": {
      },
      "audience": 1,
      "contacts_count": 1,
      "attempted": 0,
      "delivered": 0,
      "undelivered": 0,
      "responded": 0,
      "replied_stop": 0
    }
  }
}

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
assign_to_user_id User ID or Email of a User that is assigned to all broadcasted conversations

Request

Route

POST /v1/broadcasts/enL8alJ7Nw

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/broadcasts/enL8alJ7Nw" -d '{"auth_id":"1LxJDK9n26","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":"EDR8z49A2k","via_phone_numbers":"+15105551234,+14155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 365f63b8-3919-4761-99e4-d97d6c0e18a5
X-Runtime: 0.097841
Content-Length: 615

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "enL8alJ7Nw",
      "name": "My Other Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty2.jpg",
      "estimated_segments_sms": 1,
      "estimated_segments_mms": 1,
      "status_callback": null,
      "status": "draft",
      "created_at": 1702405169.937563,
      "updated_at": 1702405170.0725079,
      "scheduled_for": 1703009969.9362838,
      "completed_at": null,
      "user": {
        "email": "person_12@example.com",
        "id": "YOobKd97E4",
        "name": "Person 14"
      },
      "sms_errors": {
      },
      "mms_errors": {
      },
      "audience": 1,
      "contacts_count": 1,
      "attempted": 0,
      "delivered": 0,
      "undelivered": 0,
      "responded": 0,
      "replied_stop": 0,
      "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": "GeAbZ39DMK",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"GeAbZ39DMK","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 9a1cffd7-f979-4bab-8a50-3e9db25b1175
X-Runtime: 0.027366
Content-Length: 324

Body

{
  "status": 200,
  "data": {
    "call_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9bm90cmVhbCBzY29wZTpjbGllbnQ6aW5jb21pbmc_Y2xpZW50TmFtZT13RUc4ajI4UWxXIiwiaXNzIjoidHdpbGlvX2FjY291bnRfc2lkIiwibmJmIjoxNzAyNDA1MTczLCJleHAiOjE3MDI0OTE1NzN9.XrEWmhiO1BIYxljPK1BNbAXQZVuXFJenfRw77jImxEg"
  }
}

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

Headers

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

Query Parameters

auth_id=VePJlY8ar6
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=VePJlY8ar6&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 08459709-85e0-4852-b4fb-ca99dd4f8d72
X-Runtime: 0.040112
Content-Length: 245

Body

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

Headers

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

Query Parameters

auth_id=wd6Jmz87m3
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=wd6Jmz87m3&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Version: HTTP/1.0" \
	-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: f6b9c620-2702-4777-bb63-e282996a04de
X-Runtime: 0.171540
Content-Length: 435

Body

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

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"xDjJBRJoOe","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: d41b37a7-f72c-42a5-b27f-54c34b768434
X-Runtime: 0.076915
Content-Length: 65

Body

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

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": "ezjJ7L85yZ",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    "+15551234568",
    "+15105551234"
  ]
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"ezjJ7L85yZ","auth_secret":"YYYYYYYYYYYYYYYYYYYY","contacts":["+15551234568","+15105551234"]}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 3f3a7e9c-382b-49ae-9403-66171f6200ad
X-Runtime: 0.178404
Content-Length: 65

Body

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

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": "2jRbk681Pv",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"2jRbk681Pv","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15105551234"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 8aa08c56-3925-4826-98a9-c1ca863e9727
X-Runtime: 0.054203
Content-Length: 59

Body

{
  "status": 200,
  "data": {
    "campaigns": "Cancelling 1 entries."
  }
}

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/NEnJdQ8RmO%2CkvnJAeJADM?auth_id=qQR9178geK&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=qQR9178geK
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/NEnJdQ8RmO%2CkvnJAeJADM?auth_id=qQR9178geK&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 72c32a68-6148-4dbe-acfb-7d9acda71d90
X-Runtime: 0.027513
Content-Length: 1168

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "kvnJAeJADM",
        "name": "Bob McTest",
        "phone": "+15551234567",
        "email": "bob@mctest.com",
        "street": null,
        "city": "Los Angeles",
        "state": "CA",
        "zip": "99999",
        "country": "US",
        "address": "Los Angeles, CA, 99999, US",
        "notes": null,
        "company": "McTest Inc",
        "other_phone": null,
        "created_at": 1702404568.30956,
        "tags": [
          "important"
        ],
        "tag_details": [
          {
            "name": "important",
            "color": null
          }
        ],
        "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,
        "current_owner": null,
        "due_for_compliance": true
      },
      {
        "id": "NEnJdQ8RmO",
        "name": "Other Contact",
        "phone": "+15551234568",
        "email": "bob@contact.com",
        "street": null,
        "city": "San Francisco",
        "state": "CA",
        "zip": "88888",
        "country": "US",
        "address": "San Francisco, CA, 88888, US",
        "notes": null,
        "company": "Contact Inc",
        "other_phone": null,
        "created_at": 1702405168.31533,
        "tags": [

        ],
        "tag_details": [

        ],
        "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,
        "current_owner": null,
        "due_for_compliance": true
      }
    ]
  },
  "page": 1
}

Remove all contacts

Remove all contacts from this inbox.

Endpoint

DELETE /v1/contacts/remove_all

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String. If query is empty or no query parameter is provided, remove *all* contacts from the contacts list in this inbox. If a query is provided, only contacts matching the query will be removed from this inbox.

Request

Route

DELETE /v1/contacts/remove_all

Headers

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

Body

{
  "auth_id": "WAnJQmJy1v",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "query": null
}

cURL

curl "https://www.avochato.com/v1/contacts/remove_all" -d '{"auth_id":"WAnJQmJy1v","auth_secret":"YYYYYYYYYYYYYYYYYYYY","query":null}' -X DELETE \
	-H "Version: HTTP/1.0" \
	-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: b837f132-d5bc-4e0f-94dc-2b7181f62082
X-Runtime: 0.028867
Content-Length: 57

Body

{
  "status": 200,
  "data": {
    "account": "account_8",
    "query": "*"
  }
}

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=KRg80abj0q&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1702404508.188459&created_at%5Bto%5D=1702404628.1884758&page=1

Headers

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

Query Parameters

auth_id=KRg80abj0q
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR city:"San Francisco"
created_at={"from"=>"1702404508.188459", "to"=>"1702404628.1884758"}
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=KRg80abj0q&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1702404508.188459&created_at%5Bto%5D=1702404628.1884758&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 9103364c-78c0-4489-a8b9-b386ef47af2e
X-Runtime: 0.070661
Content-Length: 580

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "k5V9Vz9lrR",
        "name": "Bob McTest",
        "phone": "+15551234567",
        "email": "bob@mctest.com",
        "street": null,
        "city": "Los Angeles",
        "state": "CA",
        "zip": "99999",
        "country": "US",
        "address": "Los Angeles, CA, 99999, US",
        "notes": null,
        "company": "McTest Inc",
        "other_phone": null,
        "created_at": 1702404568.14899,
        "tags": [

        ],
        "tag_details": [

        ],
        "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,
        "current_owner": null,
        "due_for_compliance": 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][landline] Boolean, 0 or 1. Landline status of the Contact. Set to 1 to prevent SMS to this 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
contacts[n][stuck_number] Send all future outbounds using this Avochato number (E.164 format, number must belong to this account)
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": "0nMJLk9vZ2",
  "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,
      "landline": false,
      "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":"0nMJLk9vZ2","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,"landline":false,"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 "Version: HTTP/1.0" \
	-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: 7b09523c-7c8e-4bcf-bcca-1c68944b0786
X-Runtime: 0.255588
Content-Length: 782

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "M3NbrK9r6q",
      "name": "Bob McTest",
      "phone": "+14155553333",
      "email": "contact@example.com",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "country": "USA",
      "address": "123 Main St., SF, CA, 99999, USA",
      "notes": null,
      "company": "Example Inc.",
      "other_phone": null,
      "created_at": 1702405167.88529,
      "tags": [
        "blue",
        "green",
        "red"
      ],
      "tag_details": [
        {
          "name": "blue",
          "color": null
        },
        {
          "name": "green",
          "color": null
        },
        {
          "name": "red",
          "color": null
        }
      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": null,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": "0N6bwR8DML",
      "visible": true,
      "current_owner": "0N6bwR8DML",
      "due_for_compliance": 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.
landline Boolean, 0 or 1. Landline status of the Contact. Set to 1 to prevent SMS to this 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)
stuck_number Send all future outbounds using this Avochato number (E.164 format, number must belong to this account)

Request

Route

POST /v1/contacts

Headers

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

Body

{
  "auth_id": "BLP9Me9qYX",
  "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,
  "landline": false,
  "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",
  "stuck_number": ""
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"BLP9Me9qYX","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,"landline":false,"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","stuck_number":""}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: dc6fb787-1be3-4079-94ee-146b7c96bcc9
X-Runtime: 0.163615
Content-Length: 660

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "WAnJQmJy1v",
      "name": "Bob McTest",
      "phone": "+14155553333",
      "email": "contact@example.com",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "country": "USA",
      "address": "123 Main St., SF, CA, 99999, USA",
      "notes": null,
      "company": "Example Inc.",
      "other_phone": null,
      "created_at": 1702405167.51808,
      "tags": [

      ],
      "tag_details": [

      ],
      "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,
      "current_owner": null,
      "due_for_compliance": 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/VePJl7Y9ar/events

Headers

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

Body

{
  "auth_id": "Pwebo1JXmD",
  "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/VePJl7Y9ar/events" -d '{"auth_id":"Pwebo1JXmD","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted a new watch ($99.99) with no warranty","revenue":99.99}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 21e6d909-ef27-4567-bd55-ea32d8d2ca97
X-Runtime: 0.039013
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "43y83xbVNM",
      "account_id": "43y83xbVNM",
      "ticket_id": "YOobKd97E4",
      "contact_id": "VePJl7Y9ar",
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "event_id": "Pwebo1JXmD",
      "element_id": "ezjJ7L85yZ",
      "element_type": "CustomEvent",
      "sent_at": 1702405173.24039
    }
  }
}

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": "zPG9yg8aO0",
  "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":"zPG9yg8aO0","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","type":"sale","context":"Bought an avocado ($2) and was interested in a subscription","revenue":2.0}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 0a19410f-e7cc-4483-9533-aa8cf0d34932
X-Runtime: 0.030683
Content-Length: 339

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "xoWbqYbqnB",
      "account_id": "xoWbqYbqnB",
      "ticket_id": "3o48Og8eAv",
      "contact_id": "wd6Jmzz87m",
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "event_id": "EDR8z49A2k",
      "element_id": "VePJlY8ar6",
      "element_type": "CustomEvent",
      "sent_at": 1702405173.12034
    }
  }
}

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/1LxJDK9n26/events

Headers

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

Body

{
  "auth_id": "mQL9W79Wqz",
  "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/1LxJDK9n26/events" -d '{"auth_id":"mQL9W79Wqz","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted one hat ($10) and upsold warranty ($5.50)","revenue":15.5}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 5399af23-4d7c-4354-8538-33d850356e44
X-Runtime: 0.065862
Content-Length: 328

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "Pwebo1JXmD",
      "account_id": "Pwebo1JXmD",
      "ticket_id": "1LxJDK9n26",
      "contact_id": "v5D9R5bVAL",
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "event_id": "M3NbrK9r6q",
      "element_id": "wd6Jmz87m3",
      "element_type": "CustomEvent",
      "sent_at": 1702405172.8287
    }
  }
}

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

Headers

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

Query Parameters

auth_id=AEgb5r9ejL
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/PDz9n29e3m/events?auth_id=AEgb5r9ejL&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 66f81892-bfb8-47dd-8542-f586fd80eae0
X-Runtime: 0.051924
Content-Length: 2498

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "GeAbZ39DMK",
        "ticket_id": "PDz9n29e3m",
        "user_id": "GeAbZ39DMK",
        "status": "Closed",
        "event_id": "3YnbgeJae2",
        "element_id": "xDjJBRJoOe",
        "element_type": "StatusChange",
        "sent_at": 1702405172.94211
      },
      {
        "account_id": "GeAbZ39DMK",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 119,
        "segments": 2,
        "event_id": "RkAJvlb0oL",
        "element_id": "xDjJBRJoOe",
        "element_type": "Call",
        "sent_at": 1702405172.93988
      },
      {
        "uuid": "be5ce511-c9b1-4c89-a106-495d0d422dce",
        "account_id": "GeAbZ39DMK",
        "ticket_id": "PDz9n29e3m",
        "contact_id": "ZMvbX0zbRm",
        "sender_id": "GeAbZ39DMK",
        "sender_type": "User",
        "broadcast_id": null,
        "salesforce_activity_id": null,
        "salesforce_group_activity_id": null,
        "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": 1702405172.93548,
        "sent_at": 1702405172.93679,
        "event_id": "AwebYoJaEr",
        "element_id": "xDjJBRJoOe",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "ceffefe5-c2eb-4948-a649-c5106053a8c5",
        "account_id": "GeAbZ39DMK",
        "ticket_id": "PDz9n29e3m",
        "contact_id": "ZMvbX0zbRm",
        "sender_id": "GeAbZ39DMK",
        "sender_type": "User",
        "broadcast_id": null,
        "salesforce_activity_id": null,
        "salesforce_group_activity_id": null,
        "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": 1702405172.93193,
        "sent_at": 1702405172.93312,
        "event_id": "NEnJdQ8RmO",
        "element_id": "ezjJ7L85yZ",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "GeAbZ39DMK",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 10,
        "segments": 1,
        "event_id": "kvnJAeJADM",
        "element_id": "ezjJ7L85yZ",
        "element_type": "Call",
        "sent_at": 1702405172.92923
      },
      {
        "account_id": "GeAbZ39DMK",
        "ticket_id": "PDz9n29e3m",
        "user_id": "GeAbZ39DMK",
        "status": "Open",
        "event_id": "qxk9EVJRKA",
        "element_id": "ezjJ7L85yZ",
        "element_type": "StatusChange",
        "sent_at": 1702405172.92652
      },
      {
        "account_id": "GeAbZ39DMK",
        "ticket_id": "PDz9n29e3m",
        "user_id": "GeAbZ39DMK",
        "owner_id": "GeAbZ39DMK",
        "old_owner_id": null,
        "event_id": "k5V9Vz9lrR",
        "element_id": "VePJlY8ar6",
        "element_type": "OwnerChange",
        "sent_at": 1702405172.92299
      }
    ]
  },
  "page": 1
}

Messages

Cancel Scheduled Message

Cancels a scheduled message from sending. Only applies to scheduled messages which have not yet been delivered.

Endpoint

DELETE /v1/messages/:id

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required Event ID of the scheduled message string

Request

Route

DELETE /v1/messages/wd6Jmzz87m

Headers

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

Body

{
  "auth_id": "43y83xbVNM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/messages/wd6Jmzz87m" -d '{"auth_id":"43y83xbVNM","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X DELETE \
	-H "Version: HTTP/1.0" \
	-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: 2563abd0-f06d-46d7-9911-993ccedba1a9
X-Runtime: 0.029561
Content-Length: 538

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "v5D9R5bVAL",
      "ticket_id": "EDR8z49A2k",
      "contact_id": "enL8aAl87N",
      "sender": "person_42",
      "message": "Just wanted to follow up.",
      "media_url": null,
      "aborted": true,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1702408774.278676,
      "created_at": 1702404574.2784529,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": "User",
      "abort_reason": "manually cancelled",
      "status_callback": null,
      "event_id": "wd6Jmzz87m",
      "element_id": "WAnJQmJy1v",
      "element_type": "PendingMessage",
      "sent_at": 1702405174.2808
    }
  }
}

Get Message

Retrieve an individual message by its corresponding Event ID

Endpoint

GET /v1/messages/:id

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required Event ID of the message string

Request

Route

GET /v1/messages/PDz9nV29e3?auth_id=ezjJ76L95y&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=ezjJ76L95y
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/messages/PDz9nV29e3?auth_id=ezjJ76L95y&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Version: HTTP/1.0" \
	-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: fd049cce-9971-461a-ab96-781dbccb4013
X-Runtime: 0.027760
Content-Length: 682

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "189380da-7181-49cf-8088-1fc09f219878",
      "account_id": "enL8aAl87N",
      "ticket_id": "ZMvbX0zbRm",
      "contact_id": "3Ynbgne8ae",
      "sender_id": null,
      "sender_type": null,
      "broadcast_id": null,
      "salesforce_activity_id": null,
      "salesforce_group_activity_id": 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": 1702405177.35119,
      "sent_at": 1702405177.38045,
      "event_id": "PDz9nV29e3",
      "element_id": "z1N8x2937L",
      "element_type": "SmsMessage"
    }
  }
}

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
contact_id Contact ID, filter messages sent or received by this Contact string
ticket_id Ticket ID, filter messages only within this Ticket string
sender_id User ID who sent this message, filter messages sent by this User 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=wEG8j28QlW&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1702399174.723142&created_at%5Bto%5D=1702405234.723161

Headers

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

Query Parameters

auth_id=wEG8j28QlW
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1702399174.723142", "to"=>"1702405234.723161"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=wEG8j28QlW&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1702399174.723142&created_at%5Bto%5D=1702405234.723161" -X GET \
	-H "Version: HTTP/1.0" \
	-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: c543e4e5-c11c-4178-b733-0f5c3bf3a415
X-Runtime: 0.040265
Content-Length: 694

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "2dd1611d-88fd-48b7-a129-4e84d9a3d9c9",
        "account_id": "ZMvbX0zbRm",
        "ticket_id": "Pe6bez9Xwy",
        "contact_id": "BLP9MzeJqY",
        "sender_id": null,
        "sender_type": null,
        "broadcast_id": null,
        "salesforce_activity_id": null,
        "salesforce_group_activity_id": 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": 1702405174.62399,
        "sent_at": 1702405174.67126,
        "event_id": "ezjJ76L95y",
        "element_id": "M3NbrK9r6q",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Search Messages by timestamp

Search for matching Messages sent between a time range.

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
contact_id Contact ID, filter messages sent or received by this Contact string
ticket_id Ticket ID, filter messages only within this Ticket string
sender_id User ID who sent this message, filter messages sent by this User 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=xlYJpq8mwM&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1702405115.171034&created_at%5Bto%5D=1702405235.1710699&document=false

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=xlYJpq8mwM&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1702405115.171034&created_at%5Bto%5D=1702405235.1710699&document=false" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 867e8a70-49a5-4137-bd0a-33759b445884
X-Runtime: 0.048490
Content-Length: 694

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "0bbf0243-ba22-4b9d-8a55-d9582e80eeb7",
        "account_id": "wd6Jmzz87m",
        "ticket_id": "EZA9P5Jrwg",
        "contact_id": "0nMJLyk8vZ",
        "sender_id": null,
        "sender_type": null,
        "broadcast_id": null,
        "salesforce_activity_id": null,
        "salesforce_group_activity_id": 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": 1702405175.06782,
        "sent_at": 1702405175.09534,
        "event_id": "enL8aAl87N",
        "element_id": "qxk9EVJRKA",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Search Scheduled Messages

Search for matching Messages scheduled in the future in an account based on a query. Includes future campaign follow up messages, individual scheduled messages, and delayed auto-responses. Does NOT include Broadcast messages.

Endpoint

GET /v1/messages/scheduled

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 scheduled messages) string
page Page to request (default: 1) integer
from Phone number message will be sent from string
to Phone number message will be sent to string
contact_id Contact ID, filter messages scheduled to send to this Contact string
ticket_id Ticket ID, filter messages scheduled within this Ticket string
sender_id User ID who sent this message, filter messages scheduled by this User string
scheduled_for[from] Select messages scheduled to send after this date (default: now) unix_timestamp
scheduled_for[to] Select messages scheduled to send before this date (default: one year from now) unix_timestamp
created_at[from] Select scheduled messages created after this date unix_timestamp
created_at[to] Select scheduled messages created before this date (default: now) unix_timestamp

Request

Route

GET /v1/messages/scheduled?auth_id=ZMvbX0zbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1

Headers

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

Query Parameters

auth_id=ZMvbX0zbRm
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=ZMvbX0zbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 5811b377-6601-4357-a7c7-ead232ef21c0
X-Runtime: 0.034950
Content-Length: 533

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "ezjJ76L95y",
        "ticket_id": "GeAbZ39DMK",
        "contact_id": "k5V9Vxz8lr",
        "sender": "person_47",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1702408776.259907,
        "created_at": 1702404576.259686,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "k5V9Vxz8lr",
        "element_id": "0N6bwR8DML",
        "element_type": "PendingMessage",
        "sent_at": 1702405176.26218
      }
    ]
  },
  "page": 1
}

Search Scheduled Messages by scheduled date

Search for matching Messages scheduled to send between a time range

Endpoint

GET /v1/messages/scheduled

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 scheduled messages) string
page Page to request (default: 1) integer
from Phone number message will be sent from string
to Phone number message will be sent to string
contact_id Contact ID, filter messages scheduled to send to this Contact string
ticket_id Ticket ID, filter messages scheduled within this Ticket string
sender_id User ID who sent this message, filter messages scheduled by this User string
scheduled_for[from] Select messages scheduled to send after this date (default: now) unix_timestamp
scheduled_for[to] Select messages scheduled to send before this date (default: one year from now) unix_timestamp
created_at[from] Select scheduled messages created after this date unix_timestamp
created_at[to] Select scheduled messages created before this date (default: now) unix_timestamp

Request

Route

GET /v1/messages/scheduled?auth_id=wd6Jmzz87m&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1702405176.6953962&scheduled_for%5Bto%5D=1705083576.69541&document=false

Headers

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

Query Parameters

auth_id=wd6Jmzz87m
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1
scheduled_for={"from"=>"1702405176.6953962", "to"=>"1705083576.69541"}
document=false

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=wd6Jmzz87m&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1702405176.6953962&scheduled_for%5Bto%5D=1705083576.69541&document=false" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 430f7d2c-57ee-4b46-a419-2d5f36baa6ba
X-Runtime: 0.039492
Content-Length: 533

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "xDjJBnRJoO",
        "ticket_id": "43y83xbVNM",
        "contact_id": "kvnJA1eJAD",
        "sender": "person_48",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1702408776.646888,
        "created_at": 1702404576.646451,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "NEnJdnQbRm",
        "element_id": "M3NbrK9r6q",
        "element_type": "PendingMessage",
        "sent_at": 1702405176.65371
      }
    ]
  },
  "page": 1
}

Search Scheduled Uncancelled Messages

Search for any scheduled messages that have not been cancelled

Endpoint

GET /v1/messages/scheduled

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 scheduled messages) string
page Page to request (default: 1) integer
from Phone number message will be sent from string
to Phone number message will be sent to string
contact_id Contact ID, filter messages scheduled to send to this Contact string
ticket_id Ticket ID, filter messages scheduled within this Ticket string
sender_id User ID who sent this message, filter messages scheduled by this User string
scheduled_for[from] Select messages scheduled to send after this date (default: now) unix_timestamp
scheduled_for[to] Select messages scheduled to send before this date (default: one year from now) unix_timestamp
created_at[from] Select scheduled messages created after this date unix_timestamp
created_at[to] Select scheduled messages created before this date (default: now) unix_timestamp

Request

Route

GET /v1/messages/scheduled?auth_id=VePJl7Y9ar&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=aborted%3A+false&page=1&document=false

Headers

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

Query Parameters

auth_id=VePJl7Y9ar
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=aborted: false
page=1
document=false

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=VePJl7Y9ar&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=aborted%3A+false&page=1&document=false" -X GET \
	-H "Version: HTTP/1.0" \
	-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: a58961c4-7f6f-4e8c-ac88-114ecb3d1bb9
X-Runtime: 0.029301
Content-Length: 534

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "2jRbkR681P",
        "ticket_id": "xlYJpq8mwM",
        "contact_id": "AwebYqobaE",
        "sender": "person_49",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1702408777.040065,
        "created_at": 1702404577.0396202,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "3Ynbgne8ae",
        "element_id": "k5V9Vz9lrR",
        "element_type": "PendingMessage",
        "sent_at": 1702405177.04441
      }
    ]
  },
  "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
send_as_user_id Send on behalf of another user (match by ID). That user must belong to this API token's account. string
send_as_user_email Send on behalf of another user (match by email). That user must belong to this API token's account. string

Request

Route

POST /v1/messages

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/messages" -d '{"auth_id":"v5D9R5bVAL","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","from":"+15105551234","mark_addressed":"true","tags":"Some Tag, Another Tag","status_callback":"https://my.domain.com","send_as_user_email":"test-2@test.com"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 28eaefbb-c191-4ef2-a8e7-1e731dc98ed7
X-Runtime: 0.286998
Content-Length: 718

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "8fad33b6-7521-4991-a530-371a73e042c4",
      "account_id": "VePJl7Y9ar",
      "ticket_id": "Pwebo1JXmD",
      "contact_id": "M3NbrBKbr6",
      "sender_id": "ezjJ76L95y",
      "sender_type": "User",
      "broadcast_id": null,
      "salesforce_activity_id": null,
      "salesforce_group_activity_id": null,
      "to": "+14155553333",
      "from": "+15105551234",
      "direction": "out",
      "origin": "api",
      "message": "test message\n(Account 46: Reply STOP to opt out)",
      "contents": [

      ],
      "segments": 1,
      "carrier": "anything",
      "external_id": null,
      "status": "queued",
      "error_code": 0,
      "reason": null,
      "status_callback": "https://my.domain.com",
      "created_at": 1702405175.79936,
      "sent_at": 1702405175.79812,
      "event_id": "qQR91D7bge",
      "element_id": "AwebYoJaEr",
      "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
send_as_user_id Send on behalf of another user (match by ID). That user must belong to this API token's account. string
send_as_user_email Send on behalf of another user (match by email). That user must belong to this API token's account. string

Request

Route

POST /v1/messages

Headers

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

Body

{
  "auth_id": "xoWbqYbqnB",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "scheduled_for": 1702405773.729148,
  "from": "+15105551234",
  "mark_addressed": "true",
  "tags": "Some Tag, Another Tag",
  "status_callback": "https://my.domain.com",
  "send_as_user_email": "test-2@test.com"
}

cURL

curl "https://www.avochato.com/v1/messages" -d '{"auth_id":"xoWbqYbqnB","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","scheduled_for":1702405773.729148,"from":"+15105551234","mark_addressed":"true","tags":"Some Tag, Another Tag","status_callback":"https://my.domain.com","send_as_user_email":"test-2@test.com"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: d8b49950-4553-412f-b32a-41d362f60f10
X-Runtime: 0.239686
Content-Length: 522

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "xlYJpq8mwM",
      "ticket_id": "BDr8Gk8PlQ",
      "contact_id": "2jRbkR681P",
      "sender": "person_40",
      "message": "test message",
      "media_url": null,
      "aborted": false,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1702405773.0,
      "created_at": 1702405173.943124,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": null,
      "abort_reason": null,
      "status_callback": "https://my.domain.com",
      "event_id": "xlYJpq8mwM",
      "element_id": "BLP9Me9qYX",
      "element_type": "PendingMessage",
      "sent_at": 1702405173.94253
    }
  }
}

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/v7Mb6NbERA%2CYOobKd97E4/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/v7Mb6NbERA%2CYOobKd97E4/tags" -d '{"auth_id":"AwebYoJaEr","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-new-tag"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 39c0dded-0c9d-4dba-8148-b38f8a3ba4e9
X-Runtime: 0.027775
Content-Length: 94

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"NEnJdQ8RmO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-new-tag"}' -X POST \
	-H "Version: HTTP/1.0" \
	-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: 53aba810-bc72-409c-9f03-220f26643d87
X-Runtime: 0.038410
Content-Length: 81

Body

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

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/RkAJvlb0oL%2CAwebYoJaEr/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/RkAJvlb0oL%2CAwebYoJaEr/tags" -d '{"auth_id":"qxk9EVJRKA","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-old-tag"}' -X DELETE \
	-H "Version: HTTP/1.0" \
	-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: cc83823b-f532-4957-bf7d-b436c4eb1d5a
X-Runtime: 0.073186
Content-Length: 96

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"kvnJAeJADM","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-old-tag"}' -X DELETE \
	-H "Version: HTTP/1.0" \
	-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: 355419b8-cc80-4a06-baec-76534d59646b
X-Runtime: 0.016980
Content-Length: 83

Body

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

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/2jRbkR681P

Headers

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

Body

{
  "auth_id": "2jRbkR681P",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "autoassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/2jRbkR681P" -d '{"auth_id":"2jRbkR681P","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"autoassign"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: 8eee7b21-c152-468d-9fae-b7c59bf2a90a
X-Runtime: 0.124430
Content-Length: 371

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "2jRbkR681P",
        "uuid": "c909db8c-3d66-4ae8-b92a-e79cf567ae9f",
        "contact": "v7Mb6WN9ER",
        "user_id": "qQR91D7bge",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405177.9577851,
        "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/ezjJ76L95y

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/ezjJ76L95y" -d '{"auth_id":"xDjJBnRJoO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"unassign"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: f4edb505-fc28-4830-b9ce-ee4ea9871389
X-Runtime: 0.088137
Content-Length: 362

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ezjJ76L95y",
        "uuid": "b484aaa4-e5cb-427e-a053-03701c9129c5",
        "contact": "3o48OvgJeA",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405177.650191,
        "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/WAnJQLm9y1%2CBLP9MzeJqY

Headers

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

Body

{
  "auth_id": "PxB9NQVbYO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_35@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/WAnJQLm9y1%2CBLP9MzeJqY" -d '{"auth_id":"PxB9NQVbYO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_35@example.com"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: 92348b0f-33e7-4d3d-8d8a-5e9234deda6c
X-Runtime: 0.115612
Content-Length: 707

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "BLP9MzeJqY",
        "uuid": "72c83e0b-e648-4812-873b-ee89ece13048",
        "contact": "EDR8zM4JA2",
        "user_id": "qxk9ELVbRK",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405178.70667,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "WAnJQLm9y1",
        "uuid": "82ce1f6d-e584-4ac8-9933-03d9ccbf7024",
        "contact": "1K2b2xvJWR",
        "user_id": "qxk9ELVbRK",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405178.735892,
        "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/PxB9NQVbYO%2CenL8aAl87N

Headers

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

Body

{
  "auth_id": "enL8aAl87N",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "M3NbrBKbr6"
}

cURL

curl "https://www.avochato.com/v1/tickets/PxB9NQVbYO%2CenL8aAl87N" -d '{"auth_id":"enL8aAl87N","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"M3NbrBKbr6"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: d77fd0dc-d46f-45a0-a3ef-7ce48ac1fc05
X-Runtime: 0.147591
Content-Length: 709

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "enL8aAl87N",
        "uuid": "1536b815-bc6a-4d11-a301-a92f0709153f",
        "contact": "z1N8xD2837",
        "user_id": "M3NbrBKbr6",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405178.3520288,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "PxB9NQVbYO",
        "uuid": "802a147e-dec3-4d96-a8ee-9f05b2ef5cac",
        "contact": "BDr8GnkJPl",
        "user_id": "M3NbrBKbr6",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405178.382765,
        "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/KRg80KaJj0

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/KRg80KaJj0" -d '{"auth_id":"BLP9MzeJqY","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Closed"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: f102bcad-9fd2-43ec-9eae-77743309c60d
X-Runtime: 0.093349
Content-Length: 372

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "KRg80KaJj0",
        "uuid": "9fbe8854-3696-4fcf-a763-ca060a39b4e6",
        "contact": "3OLb4WY84Y",
        "user_id": "kvnJA1eJAD",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1702405179.047145,
        "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/0N6bwZR8DM%2CqQR91D7bge

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/0N6bwZR8DM%2CqQR91D7bge" -d '{"auth_id":"WAnJQLm9y1","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Pending"}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: 7e17f81a-0588-47df-b8a0-f446f8cef53e
X-Runtime: 0.081294
Content-Length: 703

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "qQR91D7bge",
        "uuid": "b5b85981-5a9d-4306-8f23-00a6b52f80e7",
        "contact": "EZA9Pl59rw",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405179.304236,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "0N6bwZR8DM",
        "uuid": "a4a068e5-3eb3-48ef-ab92-e59335951c99",
        "contact": "mQL9WL7JWq",
        "user_id": "NEnJdnQbRm",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405179.334742,
        "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/WAnJQmJy1v/previous?auth_id=v7Mb6NbERA&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=v7Mb6NbERA
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/tickets/WAnJQmJy1v/previous?auth_id=v7Mb6NbERA&auth_secret=YYYYYYYYYYYYYYYYYYYY" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 20d80775-932b-426d-a1e9-7f00b86779b7
X-Runtime: 0.052923
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "BLP9Me9qYX",
        "uuid": "edcb3243-b2c8-4157-b374-b02ea880de6d",
        "channel": "sms",
        "contact": "mQL9W79Wqz",
        "created_at": 1702405170.93905,
        "closed_at": 1702401570.93747,
        "user": {
          "id": "EDR8z49A2k",
          "name": "Person 18"
        },
        "device_type": null,
        "option_data": null,
        "tags": [

        ],
        "account_subdomain": "account_25"
      }
    ]
  }
}

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/3YnbgeJae2%2CAwebYoJaEr?auth_id=1K2b2vbWRy&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=1K2b2vbWRy
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/3YnbgeJae2%2CAwebYoJaEr?auth_id=1K2b2vbWRy&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: f60a9e05-7f06-4c0d-b602-ef98c7cafc6a
X-Runtime: 0.096370
Content-Length: 709

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "3YnbgeJae2",
        "uuid": "335bd422-c2d2-43ff-a246-0cadb2fc0c39",
        "contact": "xlYJpq8mwM",
        "user_id": "EZA9P5Jrwg",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405172.193402,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "AwebYoJaEr",
        "uuid": "089377fb-45ec-42ae-845f-a4983135eb60",
        "contact": "wEG8j28QlW",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405172.136173,
        "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=BDr8Gk8PlQ&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=BDr8Gk8PlQ
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=BDr8Gk8PlQ&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 977e5585-71e2-4e7d-b4a7-0c5594fa9ace
X-Runtime: 0.037317
Content-Length: 725

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "k5V9Vz9lrR",
        "uuid": "b4e92d9a-bfc3-430c-b812-1ab551acec9e",
        "contact": "GeAbZ39DMK",
        "user_id": "Pe6bez9Xwy",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405171.623553,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      },
      {
        "id": "0N6bwR8DML",
        "uuid": "b4028170-0542-4783-b4ef-19d7ac4e5d68",
        "contact": "Pwebo1JXmD",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1702405171.527621,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ],
    "total_count": 2
  },
  "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=EDR8z49A2k&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=EDR8z49A2k&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: f60c75a1-f1ff-4ce5-9f41-02cfb8ed66ba
X-Runtime: 0.035951
Content-Length: 395

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "NEnJdQ8RmO",
        "uuid": "79921df6-be5a-4bd3-b112-03446e1593d9",
        "contact": "43y83xbVNM",
        "user_id": "3OLb4Y94Ym",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405171.895977,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null
      }
    ],
    "total_count": 1
  },
  "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/qQR9178geK

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/qQR9178geK" -d '{"auth_id":"z1N8x2937L","auth_secret":"YYYYYYYYYYYYYYYYYYYY","unaddressed":false}' -X PUT \
	-H "Version: HTTP/1.0" \
	-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: b27ea54f-5978-4311-a5db-3bf846c94814
X-Runtime: 0.053321
Content-Length: 371

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "qQR9178geK",
        "uuid": "48b5f1d5-ae1d-46f4-9640-5eba09ab1698",
        "contact": "zPG9yg8aO0",
        "user_id": "1K2b2vbWRy",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1702405171.2693472,
        "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=enL8alJ7Nw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=enL8alJ7Nw
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/users?auth_id=enL8alJ7Nw&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Version: HTTP/1.0" \
	-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: 4beece79-d821-4116-b7db-e09492e8113e
X-Runtime: 0.029215
Content-Length: 249

Body

{
  "status": 200,
  "data": {
    "users": [
      {
        "email": "person_1@example.com",
        "id": "enL8alJ7Nw",
        "name": "Person 1"
      },
      {
        "email": "bob.mctest@test.com",
        "id": "PxB9NV9YOy",
        "name": "Bob McTest"
      },
      {
        "email": "other.bob@test.com",
        "id": "BLP9Me9qYX",
        "name": "Other Bob"
      }
    ]
  },
  "page": 1
}