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.

Getting Started

To get started, here are some common routes 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
  • Users, which represent team members who have access to your Avochato account

The Default Scope of API Credentials

One set of API credentials is required to use the Avochato API. By default, your API credentials are scoped to the inbox they were created in, and all the actions taken are associated with the user who was assigned to the credentials. Any actions you take will be scoped to that inbox and its settings and capabilities.

For example, any contacts, messages, broadcasts etc that you create with the API will appear in the inbox associated with these credentials.

To view which inbox your API credentials are scoped to, you can send a GET request to the /whoami route.

If the user associated with a pair of API credentials is removed from an inbox, or the credentials are deleted, they will cease to function in that inbox and you will receive an authentication error when attempting to use the API.

Accessing other inboxes with the “subdomain” parameter

You can scope your request to a different inbox using the optional “subdomain” parameter as part of the body of any API request e.g. “subdomain=my_avochato_inbox”.

Use the List Accounts route to view the list of inboxes you have access to, including the list of subdomains.

You may use the subdomain parameter for any request to specify any inbox that your user is a member of. This must equal the subdomain (/accounts/my_avochato_inbox/tickets) of an inbox.

If you cannot access an inbox using your credentials, make sure you are spelling the subdomain correctly and that your user has access to that inbox.

Rate limits

The API is subject to rate-limiting - sending too many requests too quickly will return a 429 HTTP response and the API request will be ignored.

If you receive a rate limit error while using the API, stop making requests immediately and slow down the speed at which you are sending requests.

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

Headers

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

Query Parameters

auth_id=YOobKd97E4
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_24?auth_id=YOobKd97E4&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: e4a2e322-1781-4a74-b185-7157497e3bfc
X-Runtime: 0.022836
Content-Length: 314

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "YOobKd97E4",
        "subdomain": "account_24",
        "name": "Account 24",
        "phone": null,
        "created_at": 1774979797.138836,
        "tcr_campaign_id": null
      },
      {
        "id": "v7Mb6NbERA",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1774979797.1500318,
        "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=v7Mb6NbERA&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=v7Mb6NbERA
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=v7Mb6NbERA&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: 68cc605c-8c55-4877-a622-17b78cc70aba
X-Runtime: 0.017698
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "z1N8x2937L",
        "subdomain": "account_25",
        "name": "Account 25",
        "phone": null,
        "created_at": 1774979797.2019699,
        "tcr_campaign_id": null
      },
      {
        "id": "BDr8Gk8PlQ",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1774979797.2127738,
        "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=z1N8x2937L&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=z1N8x2937L
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/whoami?auth_id=z1N8x2937L&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: fc3dc1cc-6850-4a12-b794-8a9b1338fbe1
X-Runtime: 0.008351
Content-Length: 484

Body

{
  "status": 200,
  "data": {
    "account": {
      "id": "EDR8z49A2k",
      "subdomain": "account_26",
      "name": "Account 26",
      "phone": null,
      "created_at": 1774979797.248012,
      "tcr_campaign_id": null
    },
    "user": {
      "email": "person_31@example.com",
      "id": "Pe6bez9Xwy",
      "name": "Person 26",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979797.25032,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false
    },
    "origin": "api",
    "created_at": "2026-03-31T10:56:37.252-07: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/PxB9NV9YOy/audience_count?auth_id=xDjJBRJoOe&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=xDjJBRJoOe
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/broadcasts/PxB9NV9YOy/audience_count?auth_id=xDjJBRJoOe&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: a17fa768-125d-4167-b05a-10bcc4d49401
X-Runtime: 0.018575
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

Request

Route

POST /v1/broadcasts

Headers

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

Body

{
  "auth_id": "2jRbk681Pv",
  "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": "2jRbk681Pv",
  "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":"2jRbk681Pv","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":"2jRbk681Pv","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: 68fb2418-9448-4547-8690-96d222788dd8
X-Runtime: 0.080616
Content-Length: 859

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "KRg80abj0q",
      "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": 1774979783.796575,
      "updated_at": 1774979783.796575,
      "scheduled_for": 0.0,
      "completed_at": null,
      "user": {
        "email": "person_5@example.com",
        "id": "2jRbk681Pv",
        "name": "Person 5",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979783.71885,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      },
      "assign_to_user_id": null,
      "boost_multiplier": 1,
      "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/2jRbk681Pv%2CenL8alJ7Nw?auth_id=ezjJ7L85yZ&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=ezjJ7L85yZ
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/2jRbk681Pv%2CenL8alJ7Nw?auth_id=ezjJ7L85yZ&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: a5f8cade-a96f-447c-a4d5-9fdf71339dd0
X-Runtime: 0.108463
Content-Length: 1532

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "2jRbk681Pv",
        "name": null,
        "message": "Dolorem amet iure dicta.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1774979783.393248,
        "updated_at": 1774979783.393248,
        "scheduled_for": 1775584583.390301,
        "completed_at": null,
        "user": {
          "email": "person_3@example.com",
          "id": "ezjJ7L85yZ",
          "name": "Person 3",
          "image_url": null,
          "signed_in_at": null,
          "avobot_id": null,
          "phone": null,
          "phone_formatted": null,
          "created_at": 1774979783.38559,
          "require_2fa": true,
          "mfa_app_valid": false,
          "phone_valid": false
        },
        "assign_to_user_id": null,
        "boost_multiplier": 1,
        "sms_errors": {},
        "mms_errors": {},
        "audience": 1,
        "contacts_count": 1,
        "attempted": 0,
        "delivered": 0,
        "undelivered": 0,
        "responded": 0,
        "replied_stop": 0
      },
      {
        "id": "enL8alJ7Nw",
        "name": null,
        "message": "Beatae adipisci dolorem error.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1774979783.3940108,
        "updated_at": 1774979783.3940108,
        "scheduled_for": 1775584583.3939378,
        "completed_at": null,
        "user": {
          "email": "person_3@example.com",
          "id": "ezjJ7L85yZ",
          "name": "Person 3",
          "image_url": null,
          "signed_in_at": null,
          "avobot_id": null,
          "phone": null,
          "phone_formatted": null,
          "created_at": 1774979783.38559,
          "require_2fa": true,
          "mfa_app_valid": false,
          "phone_valid": false
        },
        "assign_to_user_id": null,
        "boost_multiplier": 1,
        "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=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/broadcasts?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: 43641394-f53c-49c2-9a5a-aa3692fa2d5a
X-Runtime: 0.023002
Content-Length: 1270

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "0N6bwR8DML",
        "name": null,
        "message": "Laborum voluptas voluptatem consequatur.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1774979783.876846,
        "updated_at": 1774979783.876846,
        "scheduled_for": 1775584583.876775,
        "completed_at": null,
        "user": {
          "email": "person_6@example.com",
          "id": "enL8alJ7Nw",
          "name": "Person 6",
          "image_url": null,
          "signed_in_at": null,
          "avobot_id": null,
          "phone": null,
          "phone_formatted": null,
          "created_at": 1774979783.87234,
          "require_2fa": true,
          "mfa_app_valid": false,
          "phone_valid": false
        },
        "assign_to_user_id": null,
        "boost_multiplier": 1
      },
      {
        "id": "qQR9178geK",
        "name": null,
        "message": "Architecto natus ut optio.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1774979783.8762,
        "updated_at": 1774979783.8762,
        "scheduled_for": 1775584583.875894,
        "completed_at": null,
        "user": {
          "email": "person_6@example.com",
          "id": "enL8alJ7Nw",
          "name": "Person 6",
          "image_url": null,
          "signed_in_at": null,
          "avobot_id": null,
          "phone": null,
          "phone_formatted": null,
          "created_at": 1774979783.87234,
          "require_2fa": true,
          "mfa_app_valid": false,
          "phone_valid": false
        },
        "assign_to_user_id": null,
        "boost_multiplier": 1
      }
    ]
  },
  "page": 1,
  "limit": 30
}

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": "wd6Jmz87m3",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "scheduled_for": 1774943782.8891242,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/wd6Jmz87m3/publish" -d '{"auth_id":"wd6Jmz87m3","auth_secret":"YYYYYYYYYYYYYYYYYYYY","scheduled_for":1774943782.8891242,"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: 1cddb31b-0cea-4cd8-8c84-3cabf81cc019
X-Runtime: 0.223356
Content-Length: 782

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "wd6Jmz87m3",
      "name": null,
      "message": "Voluptatem sapiente corrupti cum.",
      "media_url": null,
      "estimated_segments_sms": 1,
      "estimated_segments_mms": 0,
      "status_callback": null,
      "status": "draft",
      "created_at": 1774979782.725446,
      "updated_at": 1774979782.725446,
      "scheduled_for": 1774979792.993694,
      "completed_at": null,
      "user": {
        "email": "person_1@example.com",
        "id": "wd6Jmz87m3",
        "name": "Person 1",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979782.69736,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      },
      "assign_to_user_id": null,
      "boost_multiplier": 1,
      "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

Request

Route

POST /v1/broadcasts/ezjJ7L85yZ

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/broadcasts/ezjJ7L85yZ" -d '{"auth_id":"VePJlY8ar6","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":"VePJlY8ar6","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: 1de19a1d-8d86-4d7b-85a3-9e9f625e03bc
X-Runtime: 0.100727
Content-Length: 839

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "ezjJ7L85yZ",
      "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": 1774979783.159028,
      "updated_at": 1774979783.3086421,
      "scheduled_for": 1775584583.158684,
      "completed_at": null,
      "user": {
        "email": "person_2@example.com",
        "id": "VePJlY8ar6",
        "name": "Person 2",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979783.14751,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      },
      "assign_to_user_id": null,
      "boost_multiplier": 1,
      "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": "KRg80abj0q",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"KRg80abj0q","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Version: HTTP/1.0" \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com" \
	-H "User-Agent: Test"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 9c3d5d8d-db3b-42f5-93b9-107b4b3b0dd4
X-Runtime: 0.012457
Content-Length: 93

Body

{
  "status": 200,
  "data": {
    "twilio_token": null,
    "twilio_payload": {
      "account_hash_id": "KRg80abj0q"
    }
  }
}

Campaigns

Fetch Campaigns

Fetch a list of specific campaigns by their 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=PxB9NQVbYO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=PxB9NQVbYO
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=PxB9NQVbYO&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: abd1da9f-7730-4e5f-9fe9-e0707007141f
X-Runtime: 0.018433
Content-Length: 245

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "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
      }
    ]
  },
  "page": 1
}

List Campaigns

List all campaign steps in this inbox.

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=BLP9MzeJqY&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=BLP9MzeJqY
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=BLP9MzeJqY&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: 121a83c4-7be5-458e-ba64-65e5cb2817c1
X-Runtime: 0.013106
Content-Length: 435

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
      },
      {
        "id": "xDjJBRJoOe",
        "key": "two",
        "raw_text": "[Campaign 2] first message",
        "follow_up_message": "[Campaign 2] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "xDjJBRJoOe",
        "hotkey": null
      }
    ]
  }
}

Recursively remove a contact from a campaign

Remove a contact from a campaign and any subsequent steps in that campaign, using their phone number. Cancels any pending messages that would be sent by this campaign. If the contact has already started this campaign step, also cancels any pending messages from later campaign steps they may be currently on.

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, or comma-separated list of campaign keywords.
phone required Phone number of the contact to cancel the campaign
recursive required (Boolean) Cancel this step as well as all subsequent steps in this campaign (1 or 0, defaults to 0).

Request

Route

POST /v1/campaigns/one/cancel

Headers

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

Body

{
  "auth_id": "WAnJQLm9y1",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234",
  "recursive": "1"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"WAnJQLm9y1","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15105551234","recursive":"1"}' -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: 65351545-f0b3-4295-a847-3a8ed8d61e3b
X-Runtime: 0.025929
Content-Length: 107

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing 1 cancellations.",
    "contacts": [
      "+15105551234"
    ],
    "ids": [
      "one"
    ]
  }
}

Remove a contact from a campaign step

You can remove a contact from a campaign by their phone number. Cancels any pending messages that would be sent by this 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, or comma-separated list of campaign keywords.
phone required Phone number of the contact to cancel the campaign

Request

Route

POST /v1/campaigns/one/cancel

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"KRg80KaJj0","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: ddf9dd6e-63ca-4159-be57-a42f14b8138d
X-Runtime: 0.020370
Content-Length: 107

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing 1 cancellations.",
    "contacts": [
      "+15105551234"
    ],
    "ids": [
      "one"
    ]
  }
}

Remove all contacts from a campaign step

Remove all contacts from a campaign. Cancels any pending messages that would be sent by this 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, or comma-separated list of campaign keywords.
all required (Boolean) Cancel campaign for all contacts that are current on this step. Cannot pass "phone" or "contacts" when using this param. (1 or 0, defaults to 0)

Request

Route

POST /v1/campaigns/one/cancel

Headers

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

Body

{
  "auth_id": "qQR91D7bge",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "all": "1"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"qQR91D7bge","auth_secret":"YYYYYYYYYYYYYYYYYYYY","all":"1"}' -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: 798f4d47-6416-4fb3-840d-c4353b15ea09
X-Runtime: 0.019583
Content-Length: 147

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing cancellation of all contacts from 1 campaigns. This may take a moment.",
    "contacts": [],
    "ids": [
      "one"
    ]
  }
}

Remove multiple contacts from a campaign step

Remove contacts from a campaign step by their phone numbers. Cancels any pending messages that would be sent by this campaign to any of the contacts, if they are currently part of the 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, or comma-separated list of campaign keywords.
contacts required List of contacts to cancel

Request

Route

POST /v1/campaigns/one/cancel

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"0nMJLyk8vZ","auth_secret":"YYYYYYYYYYYYYYYYYYYY","contacts":["+15105551234","+15551234568"]}' -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: d23cf133-5d76-42b6-beb8-96b32aee8c00
X-Runtime: 0.022548
Content-Length: 128

Body

{
  "status": 200,
  "data": {
    "campaigns": "Processing up to 2 cancellations.",
    "contacts": [
      "+15105551234",
      "+15551234568"
    ],
    "ids": [
      "one"
    ]
  }
}

Contacts

Fetch Contacts

Retrieve a specific Contact (or Contacts) using one or more comma-separated 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/v5D9R5bVAL%2CZMvbX0zbRm?auth_id=mQL9W79Wqz&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=mQL9W79Wqz
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/v5D9R5bVAL%2CZMvbX0zbRm?auth_id=mQL9W79Wqz&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: 20de8de0-b0c0-4675-851c-7fbc11dcaeae
X-Runtime: 0.020784
Content-Length: 1202

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "v5D9R5bVAL",
        "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": 1774979198.37066,
        "tags": [
          "important"
        ],
        "tag_details": [
          {
            "name": "important",
            "color": null,
            "duration": null,
            "routable": null
          }
        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      },
      {
        "id": "ZMvbX0zbRm",
        "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": 1774979798.37214,
        "tags": [],
        "tag_details": [],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      }
    ]
  },
  "page": 1
}

List All Contacts

Returns a paginated list of Contacts in this inbox

Endpoint

GET /v1/contacts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
after_page Timestamp, return records created after this Unix timestamp, in milliseconds
limit Integer, number of records to return (default: 25, max: 100)

Request

Route

GET /v1/contacts?auth_id=BDr8Gk8PlQ&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=BDr8Gk8PlQ
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=BDr8Gk8PlQ&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: fa0f9346-9edb-47b7-a727-5ecaf686b595
X-Runtime: 0.083759
Content-Length: 1163

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "EDR8z49A2k",
        "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": 1774979197.29558,
        "tags": [],
        "tag_details": [],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      },
      {
        "id": "1K2b2vbWRy",
        "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": 1774979797.29836,
        "tags": [],
        "tag_details": [],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      }
    ],
    "size": 2,
    "next_page": null
  },
  "page": 1,
  "limit": 30
}

Paginate contact results

Search for matching Contacts based on a query string

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)
after_page Show the next set of contacts that match this search, created after this unixtime. Used for pagination.
limit Integer, number of records to return (default: 25, max: 100)
visible Boolean, show only visible contacts (defaults to true, set to false to include deleted contacts)

Request

Route

GET /v1/contacts?auth_id=EZA9P5Jrwg&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=country%3AUS&after_page=jnBggEZOodA

Headers

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

Query Parameters

auth_id=EZA9P5Jrwg
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=country:US
after_page=jnBggEZOodA

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=EZA9P5Jrwg&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=country%3AUS&after_page=jnBggEZOodA" -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: ea01f957-aa69-40b1-b0e8-522dfc7b3e96
X-Runtime: 0.028125
Content-Length: 645

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "xlYJpq8mwM",
        "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": 1774979798.26821,
        "tags": [],
        "tag_details": [],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      }
    ],
    "size": 1,
    "next_page": null
  },
  "limit": 30,
  "after_page": "jnBggEZOodA"
}

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": "EDR8z49A2k",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "query": null
}

cURL

curl "https://www.avochato.com/v1/contacts/remove_all" -d '{"auth_id":"EDR8z49A2k","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: 988aa477-6678-48e7-91e7-f323b1a30b8d
X-Runtime: 0.019942
Content-Length: 58

Body

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

Search Contacts

Search for matching Contacts based on a query string

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)
after_page String, Show results created after this ID. Used for pagination.
limit Integer, number of records to return (default: 25, max: 100)
visible Boolean, show only visible contacts (defaults to true, set to false to include deleted contacts)

Request

Route

GET /v1/contacts?auth_id=Pe6bez9Xwy&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1774979137.8337789&created_at%5Bto%5D=1774979257.833791

Headers

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

Query Parameters

auth_id=Pe6bez9Xwy
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR city:"San Francisco"
created_at={"from" => "1774979137.8337789", "to" => "1774979257.833791"}

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=Pe6bez9Xwy&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1774979137.8337789&created_at%5Bto%5D=1774979257.833791" -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: 412c6b10-57d8-449b-b791-48ae2a1e136c
X-Runtime: 0.036420
Content-Length: 618

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "zPG9yg8aO0",
        "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": 1774979197.80633,
        "tags": [],
        "tag_details": [],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": false,
        "salesforce_object_type": null,
        "salesforce_object_id": null,
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      }
    ],
    "size": 1,
    "next_page": null
  },
  "page": 1,
  "limit": 30
}

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": "3OLb4Y94Ym",
  "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":"3OLb4Y94Ym","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: 44a80605-f2ec-4bed-a8ca-1d62c8c06bfa
X-Runtime: 0.300118
Content-Length: 882

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "43y83xbVNM",
      "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": 1774979797.94506,
      "tags": [
        "red",
        "green",
        "blue"
      ],
      "tag_details": [
        {
          "name": "red",
          "color": null,
          "duration": null,
          "routable": false
        },
        {
          "name": "green",
          "color": null,
          "duration": null,
          "routable": false
        },
        {
          "name": "blue",
          "color": null,
          "duration": null,
          "routable": false
        }
      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": false,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": "Pwebo1JXmD",
      "visible": true,
      "current_owner": "Pwebo1JXmD",
      "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": "1K2b2vbWRy",
  "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":"1K2b2vbWRy","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: 31f2d68b-82b9-4cb0-a873-b247be358213
X-Runtime: 0.162309
Content-Length: 661

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "AEgb5r9ejL",
      "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": 1774979797.66284,
      "tags": [],
      "tag_details": [],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": false,
      "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/0nMJLk9vZ2/events

Headers

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

Body

{
  "auth_id": "0nMJLk9vZ2",
  "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/0nMJLk9vZ2/events" -d '{"auth_id":"0nMJLk9vZ2","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: d165a9cf-506f-456b-ad87-c41448bfc22e
X-Runtime: 0.016117
Content-Length: 346

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "0nMJLk9vZ2",
      "account_id": "0nMJLk9vZ2",
      "ticket_id": "xDjJBRJoOe",
      "contact_id": "0nMJLk9vZ2",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "event_id": "Pe6bez9Xwy",
      "element_id": "ezjJ7L85yZ",
      "element_type": "CustomEvent",
      "sent_at": 1774979784.4941
    }
  }
}

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": "PxB9NV9YOy",
  "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":"PxB9NV9YOy","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: 2875d920-bdeb-4833-9503-3a732d53cc69
X-Runtime: 0.052679
Content-Length: 360

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "PxB9NV9YOy",
      "account_id": "PxB9NV9YOy",
      "ticket_id": "wd6Jmz87m3",
      "contact_id": "PxB9NV9YOy",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "event_id": "BLP9Me9qYX",
      "element_id": "wd6Jmz87m3",
      "element_type": "CustomEvent",
      "sent_at": 1774979784.14932
    }
  }
}

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

Headers

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

Body

{
  "auth_id": "WAnJQmJy1v",
  "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/ezjJ7L85yZ/events" -d '{"auth_id":"WAnJQmJy1v","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: b99390c1-2592-43bc-84b3-2e0b4db656b5
X-Runtime: 0.022097
Content-Length: 350

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "WAnJQmJy1v",
      "account_id": "WAnJQmJy1v",
      "ticket_id": "ezjJ7L85yZ",
      "contact_id": "WAnJQmJy1v",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "event_id": "PDz9n29e3m",
      "element_id": "VePJlY8ar6",
      "element_type": "CustomEvent",
      "sent_at": 1774979784.42605
    }
  }
}

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

Headers

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

Query Parameters

auth_id=BLP9Me9qYX
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/VePJlY8ar6/events?auth_id=BLP9Me9qYX&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: 5cb4007d-28df-4695-9138-9f1cd2d14996
X-Runtime: 0.053768
Content-Length: 2853

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "BLP9Me9qYX",
        "ticket_id": "VePJlY8ar6",
        "user_id": "BLP9Me9qYX",
        "status": "Closed",
        "event_id": "k5V9Vz9lrR",
        "element_id": "xDjJBRJoOe",
        "element_type": "StatusChange",
        "sent_at": 1774979784.26842
      },
      {
        "account_id": "BLP9Me9qYX",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 119,
        "segments": 2,
        "recording_url": null,
        "recording_status": null,
        "transcript": null,
        "transcript_status": null,
        "summary": null,
        "event_id": "M3NbrK9r6q",
        "element_id": "xDjJBRJoOe",
        "element_type": "Call",
        "sent_at": 1774979784.26521
      },
      {
        "uuid": "70fee9ad-7e30-47c0-8b36-4ccff3e183ca",
        "account_id": "BLP9Me9qYX",
        "ticket_id": "VePJlY8ar6",
        "contact_id": "BLP9Me9qYX",
        "sender_id": "BLP9Me9qYX",
        "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,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979784.25711,
        "sent_at": 1774979784.26065,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "0N6bwR8DML",
        "element_id": "xDjJBRJoOe",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "71265621-e569-4fbe-8bee-49d5b19adc00",
        "account_id": "BLP9Me9qYX",
        "ticket_id": "VePJlY8ar6",
        "contact_id": "BLP9Me9qYX",
        "sender_id": "BLP9Me9qYX",
        "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,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979784.24855,
        "sent_at": 1774979784.24926,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "qQR9178geK",
        "element_id": "ezjJ7L85yZ",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "BLP9Me9qYX",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 10,
        "segments": 1,
        "recording_url": null,
        "recording_status": null,
        "transcript": null,
        "transcript_status": null,
        "summary": null,
        "event_id": "KRg80abj0q",
        "element_id": "ezjJ7L85yZ",
        "element_type": "Call",
        "sent_at": 1774979784.24605
      },
      {
        "account_id": "BLP9Me9qYX",
        "ticket_id": "VePJlY8ar6",
        "user_id": "BLP9Me9qYX",
        "status": "Open",
        "event_id": "0nMJLk9vZ2",
        "element_id": "ezjJ7L85yZ",
        "element_type": "StatusChange",
        "sent_at": 1774979784.24319
      },
      {
        "account_id": "BLP9Me9qYX",
        "ticket_id": "VePJlY8ar6",
        "user_id": "BLP9Me9qYX",
        "owner_id": "BLP9Me9qYX",
        "old_owner_id": null,
        "event_id": "WAnJQmJy1v",
        "element_id": "VePJlY8ar6",
        "element_type": "OwnerChange",
        "sent_at": 1774979784.23621
      }
    ]
  },
  "page": 1,
  "limit": 30
}

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

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/messages/ZMvbX0zbRm" -d '{"auth_id":"zPG9yg8aO0","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: 36e37d86-ae3a-4665-9431-39421ee6cd7c
X-Runtime: 0.032857
Content-Length: 542

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "xoWbqYbqnB",
      "ticket_id": "qxk9EVJRKA",
      "contact_id": "xDjJBnRJoO",
      "sender": "person_42",
      "message": "Just wanted to follow up.",
      "media_url": null,
      "aborted": true,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1774983398.893474,
      "created_at": 1774979198.8934689,
      "cancel_on": null,
      "aborter_id": 42,
      "aborted_by": "Test User",
      "abort_reason": "manually cancelled",
      "status_callback": null,
      "event_id": "ZMvbX0zbRm",
      "element_id": "VePJlY8ar6",
      "element_type": "PendingMessage",
      "sent_at": 1774979798.89514
    }
  }
}

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/EDR8zM4JA2?auth_id=wd6Jmzz87m&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=wd6Jmzz87m
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/messages/EDR8zM4JA2?auth_id=wd6Jmzz87m&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: 4cfbf73c-05ef-42a8-aa6c-03416b6894b5
X-Runtime: 0.009650
Content-Length: 751

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "85e10e1a-bf9e-42a1-8650-fc84ce219e5d",
      "account_id": "xDjJBnRJoO",
      "ticket_id": "zPG9yg8aO0",
      "contact_id": "3o48OvgJeA",
      "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,
      "error_description": null,
      "reason": null,
      "status_callback": null,
      "created_at": 1774979800.13002,
      "sent_at": 1774979800.13038,
      "content_blocked": null,
      "boost_multiplier": 1,
      "event_id": "EDR8zM4JA2",
      "element_id": "3OLb4Y94Ym",
      "element_type": "SmsMessage"
    }
  }
}

List All Messages

Returns a paginated list of Messages in this inbox

Endpoint

GET /v1/messages

Parameters

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

Request

Route

GET /v1/messages?auth_id=Pwebo1JXmD&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=Pwebo1JXmD
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=Pwebo1JXmD&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: 3904e303-72d4-49cf-8316-32da97f117c2
X-Runtime: 0.024548
Content-Length: 1461

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "784bc73f-dca4-4abf-956a-08869e9fb215",
        "account_id": "43y83xbVNM",
        "ticket_id": "NEnJdQ8RmO",
        "contact_id": "enL8aAl87N",
        "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,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979799.01395,
        "sent_at": 1774979799.01434,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "VePJl7Y9ar",
        "element_id": "k5V9Vz9lrR",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "96537fd3-bae1-44d1-a5c5-93f375cbd5e3",
        "account_id": "43y83xbVNM",
        "ticket_id": "NEnJdQ8RmO",
        "contact_id": "enL8aAl87N",
        "sender_id": null,
        "sender_type": null,
        "broadcast_id": null,
        "salesforce_activity_id": null,
        "salesforce_group_activity_id": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "out",
        "origin": null,
        "message": "How did you hear about us?",
        "contents": [],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "delivered",
        "error_code": 0,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979199.01158,
        "sent_at": 1774979799.01263,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "wd6Jmzz87m",
        "element_id": "M3NbrK9r6q",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

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=v5D9R5bVAL&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1774973799.9508328&created_at%5Bto%5D=1774979859.950846

Headers

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

Query Parameters

auth_id=v5D9R5bVAL
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from" => "1774973799.9508328", "to" => "1774979859.950846"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=v5D9R5bVAL&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1774973799.9508328&created_at%5Bto%5D=1774979859.950846" -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: fa9c735f-8bcd-4bb1-8e51-e85f1e6f64ad
X-Runtime: 0.020165
Content-Length: 763

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "c152c693-0bc1-43a7-ba6c-a9730959df73",
        "account_id": "VePJl7Y9ar",
        "ticket_id": "3OLb4Y94Ym",
        "contact_id": "RkAJvDlb0o",
        "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,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979799.91333,
        "sent_at": 1774979799.91373,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "PDz9nV29e3",
        "element_id": "BDr8Gk8PlQ",
        "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=ZMvbX0zbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1774979740.0601442&created_at%5Bto%5D=1774979860.0601568&document=false

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=ZMvbX0zbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1774979740.0601442&created_at%5Bto%5D=1774979860.0601568&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: 1163eb2f-ead2-4b8f-9d4d-a2e952a18d04
X-Runtime: 0.022154
Content-Length: 763

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "b47e0827-146c-452d-a924-9462304ed31f",
        "account_id": "ezjJ76L95y",
        "ticket_id": "mQL9W79Wqz",
        "contact_id": "1LxJDvKbn2",
        "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,
        "error_description": null,
        "reason": null,
        "status_callback": null,
        "created_at": 1774979800.01875,
        "sent_at": 1774979800.01913,
        "content_blocked": null,
        "boost_multiplier": 1,
        "event_id": "v7Mb6WN9ER",
        "element_id": "1K2b2vbWRy",
        "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=xoWbqYbqnB&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1

Headers

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

Query Parameters

auth_id=xoWbqYbqnB
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=xoWbqYbqnB&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: b9e585ba-46d4-457f-a25c-bcd1e65c2aa0
X-Runtime: 0.023924
Content-Length: 533

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "xlYJpq8mwM",
        "ticket_id": "PDz9n29e3m",
        "contact_id": "KRg80KaJj0",
        "sender": "person_46",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1774983399.314806,
        "created_at": 1774979199.314802,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "0nMJLyk8vZ",
        "element_id": "2jRbk681Pv",
        "element_type": "PendingMessage",
        "sent_at": 1774979799.31585
      }
    ]
  },
  "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=43y83xbVNM&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1774979799.477373&scheduled_for%5Bto%5D=1777571799.4773881&document=false

Headers

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

Query Parameters

auth_id=43y83xbVNM
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1
scheduled_for={"from" => "1774979799.477373", "to" => "1777571799.4773881"}
document=false

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=43y83xbVNM&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1774979799.477373&scheduled_for%5Bto%5D=1777571799.4773881&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: 9b2a7f5d-febc-4595-b831-174dedacf8fa
X-Runtime: 0.033117
Content-Length: 532

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "v5D9R5bVAL",
        "ticket_id": "YOobKd97E4",
        "contact_id": "0N6bwZR8DM",
        "sender": "person_47",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1774983399.424617,
        "created_at": 1774979199.424614,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "0N6bwZR8DM",
        "element_id": "enL8alJ7Nw",
        "element_type": "PendingMessage",
        "sent_at": 1774979799.4259
      }
    ]
  },
  "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=wEG8j28QlW&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=aborted%3A+false&page=1&document=false

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=wEG8j28QlW&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: e6f05e03-acc1-486f-8e1a-ca4df85e18d4
X-Runtime: 0.019883
Content-Length: 533

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "ZMvbX0zbRm",
        "ticket_id": "z1N8x2937L",
        "contact_id": "k5V9Vxz8lr",
        "sender": "person_48",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1774983399.564286,
        "created_at": 1774979199.564283,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "qxk9ELVbRK",
        "element_id": "PxB9NV9YOy",
        "element_type": "PendingMessage",
        "sent_at": 1774979799.56522
      }
    ]
  },
  "page": 1
}

Send Live Chat Message

Send a Live Chat Message to an active live chat session using the live chat session identifier.

Endpoint

POST /v1/messages

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Live chat contact identifier e.g. "avochato:c:XXXX-YYYY-ZZZZ" string
message required Text to send to the recipient 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": "GeAbZ39DMK",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "avochato:c:XXXX-YYYY-ZZZZ",
  "message": "test message",
  "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":"GeAbZ39DMK","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"avochato:c:XXXX-YYYY-ZZZZ","message":"test message","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: 2becae3e-da9d-4349-81ea-bf61fe2ed7a6
X-Runtime: 0.060946
Content-Length: 804

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "e672bcdb-e2a8-4d06-999f-59f0ee162182",
      "account_id": "wEG8j28QlW",
      "ticket_id": "1LxJDK9n26",
      "contact_id": "0nMJLyk8vZ",
      "sender_id": "ZMvbX0zbRm",
      "sender_type": "User",
      "broadcast_id": null,
      "salesforce_activity_id": null,
      "salesforce_group_activity_id": null,
      "to": "avochato:c:XXXX-YYYY-ZZZZ",
      "from": "avochato:a:wEG8j28QlW",
      "direction": "out",
      "origin": "api",
      "message": "test message",
      "contents": [],
      "segments": 1,
      "carrier": "avochato",
      "external_id": "AVOSMcd663c5ef3fe4ab98efbb2c058ce3",
      "status": "queued",
      "error_code": 0,
      "error_description": null,
      "reason": null,
      "status_callback": "https://my.domain.com",
      "created_at": 1774979799.23273,
      "sent_at": 1774979799.23218,
      "content_blocked": null,
      "boost_multiplier": 1,
      "event_id": "PxB9NQVbYO",
      "element_id": "NEnJdQ8RmO",
      "element_type": "SmsMessage"
    }
  }
}

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": "AEgb5r9ejL",
  "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":"AEgb5r9ejL","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: 5829990d-4cb0-4cfd-afaf-dda118230b0c
X-Runtime: 0.197836
Content-Length: 787

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "29ad5d83-fee2-4c11-bc03-b75d0170b17b",
      "account_id": "GeAbZ39DMK",
      "ticket_id": "k5V9Vz9lrR",
      "contact_id": "ezjJ76L95y",
      "sender_id": "43y83xbVNM",
      "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 38: Reply STOP to opt out)",
      "contents": [],
      "segments": 1,
      "carrier": "anything",
      "external_id": null,
      "status": "queued",
      "error_code": 0,
      "error_description": null,
      "reason": null,
      "status_callback": "https://my.domain.com",
      "created_at": 1774979798.76753,
      "sent_at": 1774979798.76557,
      "content_blocked": null,
      "boost_multiplier": 1,
      "event_id": "wEG8j28QlW",
      "element_id": "KRg80abj0q",
      "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": "xlYJpq8mwM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "scheduled_for": 1774980399.741911,
  "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":"xlYJpq8mwM","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","scheduled_for":1774980399.741911,"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: ee2ec1fa-63ad-440b-a887-3a9883d9b925
X-Runtime: 0.114231
Content-Length: 520

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "wd6Jmzz87m",
      "ticket_id": "Pe6bez9Xwy",
      "contact_id": "AwebYqobaE",
      "sender": "person_49",
      "message": "test message",
      "media_url": null,
      "aborted": false,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1774980399.0,
      "created_at": 1774979799.849418,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": null,
      "abort_reason": null,
      "status_callback": "https://my.domain.com",
      "event_id": "3Ynbgne8ae",
      "element_id": "WAnJQmJy1v",
      "element_type": "PendingMessage",
      "sent_at": 1774979799.849
    }
  }
}

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/AwebYoJaEr%2CRkAJvlb0oL/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/AwebYoJaEr%2CRkAJvlb0oL/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: 87184a91-6085-4550-ac26-1a397ecd9849
X-Runtime: 0.016445
Content-Length: 94

Body

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

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: 94341de9-f57e-43e5-aebf-841660c153e9
X-Runtime: 0.032750
Content-Length: 81

Body

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

List All Tags

Returns a paginated list of Tags in this inbox

Endpoint

GET /v1/tags

Parameters

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

Request

Route

GET /v1/tags?auth_id=kvnJAeJADM&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=kvnJAeJADM
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tags?auth_id=kvnJAeJADM&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: 4101deed-af01-4286-8e3e-7abc982dc48b
X-Runtime: 0.038997
Content-Length: 111

Body

{
  "status": 200,
  "data": {
    "tags": [
      {
        "name": "my-old-tag"
      },
      {
        "name": "my-new-tag"
      }
    ],
    "last_key": "my-new-tag"
  },
  "limit": 30
}

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/0N6bwR8DML%2CM3NbrK9r6q/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/0N6bwR8DML%2CM3NbrK9r6q/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: eace8772-27dd-4472-a96e-d0c76cfd3bcf
X-Runtime: 0.073324
Content-Length: 96

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"k5V9Vz9lrR","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: 82920eac-6c8e-4b72-b778-609228a2319d
X-Runtime: 0.017412
Content-Length: 83

Body

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

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

Headers

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

Body

{
  "auth_id": "3YnbgeJae2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "autoassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/2jRbk681Pv" -d '{"auth_id":"3YnbgeJae2","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: 90e29aac-9030-45c2-8c74-91121abef5a4
X-Runtime: 0.120994
Content-Length: 490

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "2jRbk681Pv",
        "uuid": "94d6bfe1-e61c-4382-be4f-3d443e9a9c11",
        "contact": "3YnbgeJae2",
        "user_id": "1LxJDK9n26",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979796.315882,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/KRg80abj0q

Headers

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

Body

{
  "auth_id": "3o48Og8eAv",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "unassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/KRg80abj0q" -d '{"auth_id":"3o48Og8eAv","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: 1ed4a374-499b-4373-b1ed-86b9d27f6d25
X-Runtime: 0.016483
Content-Length: 482

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "KRg80abj0q",
        "uuid": "5b84697f-f859-4af1-b534-d7b07a7249c1",
        "contact": "z1N8x2937L",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979797.040357,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/PxB9NV9YOy%2CBLP9Me9qYX

Headers

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

Body

{
  "auth_id": "1LxJDK9n26",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_24@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/PxB9NV9YOy%2CBLP9Me9qYX" -d '{"auth_id":"1LxJDK9n26","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_24@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: 356f013c-9a10-4a65-8b5b-eb48c4a98453
X-Runtime: 0.076849
Content-Length: 943

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "PxB9NV9YOy",
        "uuid": "87a99a23-8d33-49fc-a744-b47d6c4504fe",
        "contact": "PDz9n29e3m",
        "user_id": "3o48Og8eAv",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979796.6769001,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      },
      {
        "id": "BLP9Me9qYX",
        "uuid": "62f85eb8-ccb9-4966-a1eb-767c4b247f87",
        "contact": "3o48Og8eAv",
        "user_id": "3o48Og8eAv",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1774979796.716147,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/WAnJQmJy1v%2C0nMJLk9vZ2

Headers

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

Body

{
  "auth_id": "PDz9n29e3m",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "v7Mb6NbERA"
}

cURL

curl "https://www.avochato.com/v1/tickets/WAnJQmJy1v%2C0nMJLk9vZ2" -d '{"auth_id":"PDz9n29e3m","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"v7Mb6NbERA"}' -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: eab04dd4-38d9-4d39-9c09-7c0bc894b52f
X-Runtime: 0.061851
Content-Length: 944

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "WAnJQmJy1v",
        "uuid": "93fca4c5-59c1-483f-b5d7-52ff202f6ae3",
        "contact": "YOobKd97E4",
        "user_id": "v7Mb6NbERA",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979796.8720992,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      },
      {
        "id": "0nMJLk9vZ2",
        "uuid": "ef8153af-cf68-4691-b57e-2b960f413c85",
        "contact": "v7Mb6NbERA",
        "user_id": "v7Mb6NbERA",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1774979796.8971672,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/RkAJvDlb0o

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/RkAJvDlb0o" -d '{"auth_id":"M3NbrBKbr6","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: 140b441f-7901-42ad-b8e3-4b770075e4e3
X-Runtime: 0.036918
Content-Length: 488

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "RkAJvDlb0o",
        "uuid": "5fd1a5c0-b979-4931-8628-98611c9c258c",
        "contact": "ezjJ7WLJ5y",
        "user_id": "1LxJDvKbn2",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1774979802.23038,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/kvnJA1eJAD%2CNEnJdnQbRm

Headers

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

Body

{
  "auth_id": "0N6bwZR8DM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "status": "Pending"
}

cURL

curl "https://www.avochato.com/v1/tickets/kvnJA1eJAD%2CNEnJdnQbRm" -d '{"auth_id":"0N6bwZR8DM","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: 3b877eaa-2b8c-4dbc-807a-b48250c00d89
X-Runtime: 0.036756
Content-Length: 937

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "kvnJA1eJAD",
        "uuid": "def7c762-acb4-42a1-9635-32098ccc5168",
        "contact": "ZMvbX7z8Rm",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979802.062083,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      },
      {
        "id": "NEnJdnQbRm",
        "uuid": "d80d0eb6-39a6-4d40-8c28-0d93581587df",
        "contact": "wd6Jmxz97m",
        "user_id": "3Ynbgne8ae",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979802.087979,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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/v5D9R5bVAL/previous?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/tickets/v5D9R5bVAL/previous?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: b5d6c412-99fa-4c47-8c7d-d11f757e2314
X-Runtime: 0.018231
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xlYJpq8mwM",
        "uuid": "6ff14b35-4ab4-4e84-a3cb-d0ce98d754ac",
        "channel": "sms",
        "contact": "EDR8zM4JA2",
        "created_at": 1774979800.56088,
        "closed_at": 1774976200.56029,
        "user": {
          "id": "KRg80KaJj0",
          "name": "Person 36"
        },
        "device_type": null,
        "option_data": null,
        "tags": [],
        "account_subdomain": "account_46"
      }
    ]
  }
}

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

Headers

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

Query Parameters

auth_id=enL8aAl87N
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/BLP9MzeJqY%2CenL8aAl87N?auth_id=enL8aAl87N&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: ebdda825-5dce-4190-98f1-a74de0fd56aa
X-Runtime: 0.017915
Content-Length: 943

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "BLP9MzeJqY",
        "uuid": "5719743e-6006-45ea-8ed2-a6d67fac51f3",
        "contact": "AEgb56r9ej",
        "user_id": "M3NbrBKbr6",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1774979801.133238,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      },
      {
        "id": "enL8aAl87N",
        "uuid": "cabc8cdb-9086-489c-b7d0-e6c7769b91b4",
        "contact": "mQL9WL7JWq",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979801.086965,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": 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=VePJl7Y9ar&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=VePJl7Y9ar
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=VePJl7Y9ar&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: 6ce86d1b-8f1d-4b23-8188-527e3c5c0952
X-Runtime: 0.024375
Content-Length: 969

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "43y83xbVNM",
        "uuid": "80f8aa4d-c1f3-4312-a6d2-0e3390dfdd3f",
        "contact": "z1N8xD2837",
        "user_id": "0nMJLyk8vZ",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1774979800.408043,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      },
      {
        "id": "GeAbZ39DMK",
        "uuid": "5144ac5f-58d0-456f-94ac-707ef8bd7367",
        "contact": "v7Mb6WN9ER",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979800.33258,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      }
    ],
    "total_count": 2
  },
  "page": 1,
  "limit": 30
}

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=xDjJBnRJoO&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=xDjJBnRJoO&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: c5d370bc-2c43-4382-ba2e-d78b9302a46b
X-Runtime: 0.044755
Content-Length: 523

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "VePJl7Y9ar",
        "uuid": "c37962bf-e6a7-4839-b652-1db34b18e472",
        "contact": "Pe6beazbXw",
        "user_id": "qQR91D7bge",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1774979800.765426,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      }
    ],
    "total_count": 1
  },
  "page": 1,
  "limit": 30
}

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

Headers

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

Body

{
  "auth_id": "2jRbkR681P",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "unaddressed": false
}

cURL

curl "https://www.avochato.com/v1/tickets/ezjJ76L95y" -d '{"auth_id":"2jRbkR681P","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: 6390a73e-000c-4345-97d7-f523887d16d9
X-Runtime: 0.030472
Content-Length: 483

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ezjJ76L95y",
        "uuid": "c300d1f1-071a-42eb-ba4f-19e588baa59b",
        "contact": "3OLb4WY84Y",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1774979800.9113941,
        "device_type": null,
        "device": null,
        "helper_bot": false,
        "helper_bot_source_account": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null,
        "summary": null,
        "summary_updated_at": null
      }
    ]
  }
}

Users

Users are team members who have access to your Avochato account. Each User can send messages, view Tickets, and be assigned conversations. Use these endpoints to manage user onboarding, offboarding, roles, and account access.

Add a User

Add a user to this account. If the email matches an existing Avochato user, they are added to the account and receive a notification. If the email is new, a user is created and an invite email is sent so they can set their password.

Endpoint

POST /v1/users

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
email required Email address of the user to add. If the user does not yet exist in Avochato, a new user will be created and an invite email sent.
role Permission level for the user in this account. One of: member (default), manager, or owner. Members can view and respond to conversations. Managers can also manage team settings. Owners have full account control including billing.
name Display name for the user (only used when creating a new user)
phone Phone number in E.164 format (e.g., +14155551234). If provided, triggers MFA phone setup so the user can complete two-factor authentication during onboarding.

Request

Route

POST /v1/users

Headers

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

Body

{
  "auth_id": "3o48OvgJeA",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "email": "newuser@sunrisedental.com",
  "role": "member",
  "name": "Sarah Johnson"
}

cURL

curl "https://www.avochato.com/v1/users" -d '{"auth_id":"3o48OvgJeA","auth_secret":"YYYYYYYYYYYYYYYYYYYY","email":"newuser@sunrisedental.com","role":"member","name":"Sarah Johnson"}' -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: 498bb3dc-52bf-4de7-a2a4-3e77ba401dbc
X-Runtime: 0.093340
Content-Length: 430

Body

{
  "status": 200,
  "data": {
    "user": {
      "email": "newuser@sunrisedental.com",
      "id": "WAnJQzm8y1",
      "name": "Sarah Johnson",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979803.03074,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "member",
      "enabled": true,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979803.03313
    }
  }
}

Delete a User

Permanently remove a user from this account. Unlike disabling, this completely removes the user’s membership — their tickets will be unassigned and they will lose all access. The user’s Avochato account still exists and they can be re-added later.

Endpoint

DELETE /v1/users/:id

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User to delete. You can use the user's email instead.
email Email address of the user to delete. Alternative to passing the encoded ID in the URL.

Request

Route

DELETE /v1/users/z1N8xD2837

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/users/z1N8xD2837" -d '{"auth_id":"qxk9ELVbRK","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: 33d8fd9e-49a4-48bf-886a-3a54af29488e
X-Runtime: 0.034197
Content-Length: 72

Body

{
  "status": 200,
  "data": {
    "message": " has been removed from this account."
  }
}

Disable a User

Disable a user in this account. The user will lose access to the account and will no longer receive notifications or be assigned conversations. Their conversation history is preserved.

Endpoint

POST /v1/users/:id/disable

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User to disable. You can use the user's email instead.
email Email address of the user to disable. Alternative to passing the encoded ID in the URL.

Request

Route

POST /v1/users/wd6Jmxz97m/disable

Headers

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

Body

{
  "auth_id": "1LxJDvKbn2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/users/wd6Jmxz97m/disable" -d '{"auth_id":"1LxJDvKbn2","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: 4f95ce3f-0f65-4c71-a5e8-1712855634dd
X-Runtime: 0.019487
Content-Length: 405

Body

{
  "status": 200,
  "data": {
    "user": {
      "email": null,
      "id": "wd6Jmxz97m",
      "name": "Bob McTest",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979802.87481,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "member",
      "enabled": false,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979802.87611
    }
  }
}

Get User Details

Retrieve detailed information about a specific User, including their role, enabled status, permissions (can_message, can_call, can_view_billing, can_view_org), MFA status, last login date, and the date they were added to the account.

Endpoint

GET /v1/users/:id

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User to retrieve. You can use the user's email instead — pass it as the email parameter.
email Email address of the user to look up. Alternative to passing the encoded ID in the URL.

Request

Route

GET /v1/users/xDjJBNRJoO?auth_id=PDz9nV29e3&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=PDz9nV29e3
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/users/xDjJBNRJoO?auth_id=PDz9nV29e3&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: 7761877b-0fc0-49dc-ac19-88f20033e53f
X-Runtime: 0.014692
Content-Length: 404

Body

{
  "status": 200,
  "data": {
    "user": {
      "email": null,
      "id": "xDjJBNRJoO",
      "name": "Bob McTest",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979802.94566,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "member",
      "enabled": true,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979802.94673
    }
  }
}

List User Inboxes

Returns a list of all inboxes (accounts) the specified user has access to within your organization. Each account includes its subdomain, name, phone number, and creation date. Results are scoped to your organization — you will not see accounts in other organizations.

Endpoint

GET /v1/users/:id/accounts

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User. You can use the user's email instead.
email Email address of the user. Alternative to passing the encoded ID in the URL.

Request

Route

GET /v1/users/EZA9Pl59rw/accounts?auth_id=NEnJdnQbRm&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=NEnJdnQbRm
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/users/EZA9Pl59rw/accounts?auth_id=NEnJdnQbRm&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: 8d6f6321-75d2-4a24-8d15-6aecd04ac19f
X-Runtime: 0.021280
Content-Length: 146

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "3Ynbgne8ae",
        "subdomain": "account_61",
        "name": "Account 61",
        "phone": null,
        "created_at": 1774979802.5592299
      }
    ]
  }
}

List all Users

Returns a paginated list of all Users within an account. Response includes each user’s email, name, phone number, last login date, MFA status, and creation date.

Endpoint

GET /v1/users

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
page Page of users to request (default: 1)

Request

Route

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

Headers

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

Query Parameters

auth_id=k5V9Vxz8lr
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/users?auth_id=k5V9Vxz8lr&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: 4c909bc3-21a0-47f4-ac08-2f13f1ecfc5f
X-Runtime: 0.026970
Content-Length: 763

Body

{
  "status": 200,
  "data": {
    "users": [
      {
        "email": "person_63@example.com",
        "id": "PDz9nV29e3",
        "name": "Person 42",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979802.31703,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      },
      {
        "email": null,
        "id": "3o48OvgJeA",
        "name": "Bob McTest",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979802.33207,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      },
      {
        "email": null,
        "id": "YOobKadJ7E",
        "name": "Alice Rivera",
        "image_url": null,
        "signed_in_at": null,
        "avobot_id": null,
        "phone": null,
        "phone_formatted": null,
        "created_at": 1774979802.3353,
        "require_2fa": true,
        "mfa_app_valid": false,
        "phone_valid": false
      }
    ]
  },
  "page": 1
}

Re-enable a User

Re-enable a previously disabled user in this account. The user will regain access to the account. Requires manager or owner role.

Endpoint

POST /v1/users/:id/enable

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User to re-enable. You can use the user's email instead.
email Email address of the user to re-enable. Alternative to passing the encoded ID in the URL.

Request

Route

POST /v1/users/xoWbqpY8qn/enable

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/users/xoWbqpY8qn/enable" -d '{"auth_id":"RkAJvDlb0o","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: 47360903-a6dd-4bb4-8b60-d1be362ea7b4
X-Runtime: 0.016711
Content-Length: 403

Body

{
  "status": 200,
  "data": {
    "user": {
      "email": null,
      "id": "xoWbqpY8qn",
      "name": "Bob McTest",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979802.7315,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "member",
      "enabled": true,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979802.73245
    }
  }
}

Set MFA Phone Number

Set or update the MFA phone number for a user. The phone number is set as pending until the user verifies it via SMS code. Requires org-level permissions.

Endpoint

POST /v1/users/:id/mfa_phone

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
phone required Phone number in E.164 format (e.g., +14155551234). This sets a pending MFA phone number — the user must verify it by entering the SMS code they receive.
id (URL) The encoded ID of the User. You can use the user's email instead.
email Email address of the user. Alternative to passing the encoded ID in the URL.

Request

Route

POST /v1/users/xlYJplqJmw/mfa_phone

Headers

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

Body

{
  "auth_id": "3Ynbgne8ae",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155559876",
  "private": true
}

cURL

curl "https://www.avochato.com/v1/users/xlYJplqJmw/mfa_phone" -d '{"auth_id":"3Ynbgne8ae","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155559876","private":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: 5ef0c75b-3d48-4f56-809b-611a6bf199b6
X-Runtime: 0.030217
Content-Length: 478

Body

{
  "status": 200,
  "data": {
    "message": "MFA phone number has been set. User must verify via SMS code.",
    "user": {
      "email": null,
      "id": "xlYJplqJmw",
      "name": "Bob McTest",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979802.79541,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "member",
      "enabled": true,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979802.79666
    }
  }
}

Trigger a Password Reset

Send a password reset email to the specified user. The user will receive an email with a link to set a new password. The link expires after 48 hours. Requires manager or owner role.

Endpoint

POST /v1/users/:id/password_reset

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
id (URL) The encoded ID of the User. You can use the user's email instead.
email Email address of the user to send a password reset to. Alternative to passing the encoded ID in the URL.

Request

Route

POST /v1/users/zPG9y3g8aO/password_reset

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/users/zPG9y3g8aO/password_reset" -d '{"auth_id":"AwebYqobaE","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: 35b648dc-ce76-4601-853c-06b8d06e3e67
X-Runtime: 0.026582
Content-Length: 65

Body

{
  "status": 200,
  "data": {
    "message": "Password reset email sent to "
  }
}

Update a User role

Change a user’s permission level in this account. Requires manager or owner role. Managers cannot promote users to owner or modify existing owners — only owners and admins can do that.

Endpoint

PUT /v1/users/:id

Parameters

Name Description
auth_id required Your API authentication ID. Find this in Settings > API Access.
auth_secret required Your API authentication secret. Pair this with auth_id for every request.
role required New role for the user. One of: member, manager, or owner.
id (URL) The encoded ID of the User to update. You can use the user's email instead.
email Email address of the user to update. Alternative to passing the encoded ID in the URL.

Request

Route

PUT /v1/users/1K2b2xvJWR

Headers

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

Body

{
  "auth_id": "kvnJA1eJAD",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "role": "manager"
}

cURL

curl "https://www.avochato.com/v1/users/1K2b2xvJWR" -d '{"auth_id":"kvnJA1eJAD","auth_secret":"YYYYYYYYYYYYYYYYYYYY","role":"manager"}' -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: 3b71096a-06ed-44d7-912c-14475795d1c8
X-Runtime: 0.026908
Content-Length: 405

Body

{
  "status": 200,
  "data": {
    "user": {
      "email": null,
      "id": "1K2b2xvJWR",
      "name": "Bob McTest",
      "image_url": null,
      "signed_in_at": null,
      "avobot_id": null,
      "phone": null,
      "phone_formatted": null,
      "created_at": 1774979802.49421,
      "require_2fa": true,
      "mfa_app_valid": false,
      "phone_valid": false,
      "role": "manager",
      "enabled": true,
      "can_message": true,
      "can_call": true,
      "can_view_billing": false,
      "can_view_org": false,
      "added_at": 1774979802.49591
    }
  }
}