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

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

Headers

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

Query Parameters

auth_id=mQL9W1x8Wq
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_19?auth_id=mQL9W1x8Wq&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: 569d0214-06f0-4470-95d3-0e2e1e5d5cdf
X-Runtime: 0.026753
Content-Length: 314

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "3OLb4G384Y",
        "subdomain": "account_19",
        "name": "Account 19",
        "phone": null,
        "created_at": 1728956186.369896,
        "tcr_campaign_id": null
      },
      {
        "id": "EZA9PEkJrw",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1728956186.3947651,
        "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=zPG9yyO9aO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=zPG9yyO9aO
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=zPG9yyO9aO&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: 18f24a35-de9a-43b3-962e-42fb26d8e07b
X-Runtime: 0.018125
Content-Length: 313

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "zPG9yAk9aO",
        "subdomain": "account_21",
        "name": "Account 21",
        "phone": null,
        "created_at": 1728956186.531412,
        "tcr_campaign_id": null
      },
      {
        "id": "PweboRe8Xm",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": 1728956186.559356,
        "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=AEgb5OPJej&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=AEgb5OPJej
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/whoami?auth_id=AEgb5OPJej&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: 2204f51f-a4aa-43ea-acc2-7598ab8685d9
X-Runtime: 0.015499
Content-Length: 321

Body

{
  "status": 200,
  "data": {
    "account": {
      "id": "mQL9Wn6bWq",
      "subdomain": "account_20",
      "name": "Account 20",
      "phone": null,
      "created_at": 1728956186.4606452,
      "tcr_campaign_id": null
    },
    "user": {
      "email": "person_23@example.com",
      "id": "3NbrBvDbr6",
      "name": "Person 24",
      "image_url": null
    },
    "origin": "api",
    "created_at": "2024-10-14T18:36:26.469-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/k5V9VZr9lr/audience_count?auth_id=3OLb44rb4Y&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=3OLb44rb4Y
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/broadcasts/k5V9VZr9lr/audience_count?auth_id=3OLb44rb4Y&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: 2da810fb-3748-430d-9a3b-92ada32d138b
X-Runtime: 0.030739
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": "BDr8G6RJPl",
  "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": "OLb4pLEb4Y",
  "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":"BDr8G6RJPl","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":"OLb4pLEb4Y","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: cb6d0e8c-23f4-4dc9-b550-aeaa37820ecf
X-Runtime: 0.115636
Content-Length: 678

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "BLP9MZYJqY",
      "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": 1728956185.3025432,
      "updated_at": 1728956185.3025432,
      "scheduled_for": 0.0,
      "completed_at": null,
      "user": {
        "email": "person_17@example.com",
        "id": "xB9NQ3xbYO",
        "name": "Person 17",
        "image_url": null
      },
      "assign_to_user_id": null,
      "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/xDjJBZLJoO%2C2jRbkNj81P?auth_id=z1N8xZN937&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=z1N8xZN937
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/xDjJBZLJoO%2C2jRbkNj81P?auth_id=z1N8xZN937&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: 664cfcbe-e0ae-44cb-b69c-50314088d6c3
X-Runtime: 0.122312
Content-Length: 1168

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "xDjJBZLJoO",
        "name": null,
        "message": "Aut natus nulla enim.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1728956184.81983,
        "updated_at": 1728956184.81983,
        "scheduled_for": 1729560984.818495,
        "completed_at": null,
        "user": {
          "email": "person_16@example.com",
          "id": "nL8aA3O87N",
          "name": "Person 16",
          "image_url": null
        },
        "assign_to_user_id": null,
        "sms_errors": {
        },
        "mms_errors": {
        },
        "audience": 1,
        "contacts_count": 1,
        "attempted": 0,
        "delivered": 0,
        "undelivered": 0,
        "responded": 0,
        "replied_stop": 0
      },
      {
        "id": "2jRbkNj81P",
        "name": null,
        "message": "Blanditiis deserunt voluptatibus dolore.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1728956184.827631,
        "updated_at": 1728956184.827631,
        "scheduled_for": 1729560984.827264,
        "completed_at": null,
        "user": {
          "email": "person_16@example.com",
          "id": "nL8aA3O87N",
          "name": "Person 16",
          "image_url": null
        },
        "assign_to_user_id": null,
        "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=EDR8z3PbA2&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=EDR8z3PbA2
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts?auth_id=EDR8z3PbA2&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: 67a55eec-8b83-4f41-8129-7e69a98302f5
X-Runtime: 0.022436
Content-Length: 878

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "0nMJLZpbvZ",
        "name": null,
        "message": "Minus eum et debitis.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1728956185.44016,
        "updated_at": 1728956185.44016,
        "scheduled_for": 1729560985.440044,
        "completed_at": null,
        "user": {
          "email": "person_18@example.com",
          "id": "LP9MzDrJqY",
          "name": "Person 18",
          "image_url": null
        },
        "assign_to_user_id": null
      },
      {
        "id": "WAnJQZO8y1",
        "name": null,
        "message": "Accusantium neque velit cum.",
        "media_url": null,
        "estimated_segments_sms": 1,
        "estimated_segments_mms": 0,
        "status_callback": null,
        "status": "draft",
        "created_at": 1728956185.437918,
        "updated_at": 1728956185.437918,
        "scheduled_for": 1729560985.436696,
        "completed_at": null,
        "user": {
          "email": "person_18@example.com",
          "id": "LP9MzDrJqY",
          "name": "Person 18",
          "image_url": null
        },
        "assign_to_user_id": null
      }
    ]
  },
  "page": 1
}

Publish Broadcast

Publish your broadcast

Endpoint

POST /v1/broadcasts/:id/publish

Parameters

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

Request

Route

POST /v1/broadcasts/KRg80vz9j0/publish

Headers

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

Body

{
  "auth_id": "1K2b2p7JWR",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "scheduled_for": 1728920185.725774,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/KRg80vz9j0/publish" -d '{"auth_id":"1K2b2p7JWR","auth_secret":"YYYYYYYYYYYYYYYYYYYY","scheduled_for":1728920185.725774,"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: 6bdf49a9-e432-46e6-a288-f7426ea694e1
X-Runtime: 0.105616
Content-Length: 595

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "KRg80vz9j0",
      "name": null,
      "message": "Qui accusantium culpa labore.",
      "media_url": null,
      "estimated_segments_sms": 1,
      "estimated_segments_mms": 0,
      "status_callback": null,
      "status": "draft",
      "created_at": 1728956185.606915,
      "updated_at": 1728956185.606915,
      "scheduled_for": 1728956195.763496,
      "completed_at": null,
      "user": {
        "email": "person_19@example.com",
        "id": "AnJQL6L9y1",
        "name": "Person 19",
        "image_url": null
      },
      "assign_to_user_id": null,
      "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/0N6bwY4JDM

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/broadcasts/0N6bwY4JDM" -d '{"auth_id":"Pe6beQMbXw","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":"Egb5WXQJej","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: 30ae0f8a-deba-412d-b636-ccd4837a960f
X-Runtime: 0.094762
Content-Length: 654

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "0N6bwY4JDM",
      "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": 1728956185.878392,
      "updated_at": 1728956185.99363,
      "scheduled_for": 1729560985.877995,
      "completed_at": null,
      "user": {
        "email": "person_20@example.com",
        "id": "nMJLygN8vZ",
        "name": "Person 20",
        "image_url": null
      },
      "assign_to_user_id": null,
      "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": "EZA9Pk1brw",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"EZA9Pk1brw","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: 9d367663-7f04-48f4-9da5-de39c020b63e
X-Runtime: 0.027747
Content-Length: 93

Body

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

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

Headers

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

Query Parameters

auth_id=WAnJQQ5Jy1
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/campaigns/one?auth_id=WAnJQQ5Jy1&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: c060fd47-c686-46c3-bc22-a8094ced0fab
X-Runtime: 0.026469
Content-Length: 245

Body

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

Headers

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

Query Parameters

auth_id=0nMJLB6bvZ
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/campaigns?auth_id=0nMJLB6bvZ&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: 3de1d28f-bc42-4b88-845a-754aee59c8f1
X-Runtime: 0.016374
Content-Length: 435

Body

{
  "status": 200,
  "data": {
    "campaigns": [
      {
        "id": "e6beazzbXw",
        "key": "one",
        "raw_text": "[Campaign 1] first message",
        "follow_up_message": "[Campaign 1] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "e6beazzbXw",
        "hotkey": null
      },
      {
        "id": "OLb4WPY84Y",
        "key": "two",
        "raw_text": "[Campaign 2] first message",
        "follow_up_message": "[Campaign 2] second message",
        "follow_up_delay": null,
        "media_url": null,
        "hash_id": "OLb4WPY84Y",
        "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": "KRg80PQ8j0",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234",
  "recursive": "1"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"KRg80PQ8j0","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: 36134682-b026-4d16-84cc-161896429df5
X-Runtime: 0.107091
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": "wd6JmaLJ7m",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15105551234"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"wd6JmaLJ7m","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: e3fa8ebd-a23a-45e6-b3f9-11ad0ff6021c
X-Runtime: 0.027910
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": "ZMvbXEZ9Rm",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "all": "1"
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"ZMvbXEZ9Rm","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: 77a61207-882e-4a7a-ab91-8aa0910f215a
X-Runtime: 0.046565
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": "VePJlka9ar",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    "+15105551234",
    "+15551234568"
  ]
}

cURL

curl "https://www.avochato.com/v1/campaigns/one/cancel" -d '{"auth_id":"VePJlka9ar","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: b5ed85be-01cb-40dc-824d-adb9b8f149d7
X-Runtime: 0.044248
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/jRbkGMjb1P%2CnL8aW5d97N?auth_id=Pweboo1bXm&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=Pweboo1bXm
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/jRbkGMjb1P%2CnL8aW5d97N?auth_id=Pweboo1bXm&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: 7c3c0b5c-ae24-488f-b5b6-210cf6c82ebc
X-Runtime: 0.027824
Content-Length: 1192

Body

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

        ],
        "tag_details": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": "",
        "salesforce_object_id": "",
        "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=GeAbZp3JDM&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=GeAbZp3JDM
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=GeAbZp3JDM&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: 25a962c2-f310-4c3c-8de5-5fe03b972002
X-Runtime: 0.020798
Content-Length: 1152

Body

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

        ],
        "tag_details": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": "",
        "salesforce_object_id": "",
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      },
      {
        "id": "LP9MWVY8qY",
        "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": 1733447846.19635,
        "tags": [

        ],
        "tag_details": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": "",
        "salesforce_object_id": "",
        "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=43y83BxJVN&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=country%3AUS&after_page=7WE4QyP4AEL

Headers

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

Query Parameters

auth_id=43y83BxJVN
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=country:US
after_page=7WE4QyP4AEL

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=43y83BxJVN&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=country%3AUS&after_page=7WE4QyP4AEL" -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: 7597d36f-ee17-4629-8650-da27f9222d84
X-Runtime: 0.020278
Content-Length: 640

Body

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

        ],
        "tag_details": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": "",
        "salesforce_object_id": "",
        "priority": 0,
        "user_id": null,
        "visible": true,
        "current_owner": null,
        "due_for_compliance": true
      }
    ],
    "size": 1,
    "next_page": null
  },
  "limit": 30,
  "after_page": "7WE4QyP4AEL"
}

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

cURL

curl "https://www.avochato.com/v1/contacts/remove_all" -d '{"auth_id":"AEgb5arbej","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: cd02e404-2d29-49a6-8e00-6849d4012a76
X-Runtime: 0.015729
Content-Length: 58

Body

{
  "status": 200,
  "data": {
    "account": "account_37",
    "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=mQL9Wp7JWq&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1733447185.5182679&created_at%5Bto%5D=1733447305.5182898

Headers

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

Query Parameters

auth_id=mQL9Wp7JWq
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR city:"San Francisco"
created_at={"from"=>"1733447185.5182679", "to"=>"1733447305.5182898"}

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=mQL9Wp7JWq&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+city%3A%22San+Francisco%22&created_at%5Bfrom%5D=1733447185.5182679&created_at%5Bto%5D=1733447305.5182898" -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: a7d9d0f3-a769-4860-ad19-33815c952775
X-Runtime: 0.079040
Content-Length: 613

Body

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

        ],
        "tag_details": [

        ],
        "opted_out": false,
        "double_opted_in": false,
        "muted": false,
        "blocked": null,
        "salesforce_object_type": "",
        "salesforce_object_id": "",
        "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": "xoWbqjY9qn",
  "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":"xoWbqjY9qn","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: 5a0cceec-e754-4b57-8faa-3a7dfae980ac
X-Runtime: 0.314142
Content-Length: 880

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "Rg803nzJj0",
      "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": 1733447846.3732,
      "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": null,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": "EG8jGeYbQl",
      "visible": true,
      "current_owner": "EG8jGeYbQl",
      "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": "zPG9yog8aO",
  "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":"zPG9yog8aO","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: 2785ed7f-88d9-4c12-b296-7324244ecfa8
X-Runtime: 0.116275
Content-Length: 659

Body

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

      ],
      "tag_details": [

      ],
      "opted_out": false,
      "double_opted_in": false,
      "muted": false,
      "blocked": null,
      "salesforce_object_type": "Contact",
      "salesforce_object_id": "0030030000000014cAAA",
      "priority": 0,
      "user_id": null,
      "visible": true,
      "current_owner": null,
      "due_for_compliance": true,
      "custom_variable_name": "value to set custom variable"
    }
  }
}

Events

Add Event (Contact id)

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

Endpoint

POST /v1/contacts/:id/events

Parameters

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

Request

Route

POST /v1/contacts/Dr8GzjmJPl/events

Headers

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

Body

{
  "auth_id": "3o48OBjJeA",
  "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/Dr8GzjmJPl/events" -d '{"auth_id":"3o48OBjJeA","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: eddf5d0e-b097-44a3-a2e7-86da29280c82
X-Runtime: 0.076600
Content-Length: 347

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "zjJ76zX95y",
      "account_id": "1LxJDBEbn2",
      "ticket_id": "eAbZvoYbDM",
      "contact_id": "Dr8GzjmJPl",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "event_id": "VePJlqK8ar",
      "element_id": "BDr8Gk8PlQ",
      "element_type": "CustomEvent",
      "sent_at": 1728956184.45761
    }
  }
}

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": "v7Mb6Kj9ER",
  "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":"v7Mb6Kj9ER","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: 0dd48824-ff63-4bf6-ab78-ab4f47afb873
X-Runtime: 0.030116
Content-Length: 360

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "jRbkRke81P",
      "account_id": "3o48OVeJeA",
      "ticket_id": "3y832zGJVN",
      "contact_id": "K2b2qMw8WR",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "event_id": "NEnJdqL8Rm",
      "element_id": "1K2b2vbWRy",
      "element_type": "CustomEvent",
      "sent_at": 1728956184.75681
    }
  }
}

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

Headers

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

Body

{
  "auth_id": "YOobKXr97E",
  "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/oWbqpvg8qn/events" -d '{"auth_id":"YOobKXr97E","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: e4812c33-4b41-4b47-a029-38d7bc39219a
X-Runtime: 0.034720
Content-Length: 350

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "DjJBn3lJoO",
      "account_id": "PDz9najbe3",
      "ticket_id": "oWbqpvg8qn",
      "contact_id": "DR8zp739A2",
      "qa_keyword_id": null,
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "event_id": "0nMJLLKJvZ",
      "element_id": "EDR8z49A2k",
      "element_type": "CustomEvent",
      "sent_at": 1728956184.62229
    }
  }
}

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

Headers

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

Query Parameters

auth_id=PDz9nd18e3
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/weboadyJXm/events?auth_id=PDz9nd18e3&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: 06a88eef-bbe5-4df9-9bb5-d96d387b8476
X-Runtime: 0.097274
Content-Length: 2594

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "3Ynbgq6Jae",
        "ticket_id": "weboadyJXm",
        "user_id": "ePJl7aa9ar",
        "status": "Closed",
        "event_id": "GeAbZOL9DM",
        "element_id": "2jRbkdV91P",
        "element_type": "StatusChange",
        "sent_at": 1728956184.19751
      },
      {
        "account_id": "3Ynbgq6Jae",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 119,
        "segments": 2,
        "event_id": "PweboqGJXm",
        "element_id": "Pweboa1JXm",
        "element_type": "Call",
        "sent_at": 1728956184.19485
      },
      {
        "uuid": "5307dc79-f5fe-430b-ac9d-365f645adc25",
        "account_id": "3Ynbgq6Jae",
        "ticket_id": "weboadyJXm",
        "contact_id": "1N8xMm3b37",
        "sender_id": "ePJl7aa9ar",
        "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": 1728956184.18951,
        "sent_at": 1728956184.19125,
        "content_blocked": null,
        "event_id": "zPG9yqQ9aO",
        "element_id": "KRg80lz8j0",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "20201959-5b0f-4894-bef8-4b1b5dc694e9",
        "account_id": "3Ynbgq6Jae",
        "ticket_id": "weboadyJXm",
        "contact_id": "1N8xMm3b37",
        "sender_id": "ePJl7aa9ar",
        "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": 1728956184.18224,
        "sent_at": 1728956184.18494,
        "content_blocked": null,
        "event_id": "AEgb5V49ej",
        "element_id": "0nMJLDpJvZ",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "3Ynbgq6Jae",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": 0.0,
        "duration": 10,
        "segments": 1,
        "event_id": "mQL9Wgy9Wq",
        "element_id": "zPG9y3g8aO",
        "element_type": "Call",
        "sent_at": 1728956184.16864
      },
      {
        "account_id": "3Ynbgq6Jae",
        "ticket_id": "weboadyJXm",
        "user_id": "ePJl7aa9ar",
        "status": "Open",
        "event_id": "EZA9Prl8rw",
        "element_id": "xDjJBN1JoO",
        "element_type": "StatusChange",
        "sent_at": 1728956184.15467
      },
      {
        "account_id": "3Ynbgq6Jae",
        "ticket_id": "weboadyJXm",
        "user_id": "ePJl7aa9ar",
        "owner_id": "ePJl7aa9ar",
        "old_owner_id": null,
        "event_id": "3OLb4rqJ4Y",
        "element_id": "BLP9MW18qY",
        "element_type": "OwnerChange",
        "sent_at": 1728956184.13143
      }
    ]
  },
  "page": 1
}

Messages

Cancel Scheduled Message

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

Endpoint

DELETE /v1/messages/:id

Parameters

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

Request

Route

DELETE /v1/messages/Pe6beq2bXw

Headers

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

Body

{
  "auth_id": "2jRbkERJ1P",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/messages/Pe6beq2bXw" -d '{"auth_id":"2jRbkERJ1P","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: f72777e0-2cb9-47c5-8a13-cdf7d2d45c83
X-Runtime: 0.043950
Content-Length: 538

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "enL8aPwJ7N",
      "ticket_id": "EnJdnN3bRm",
      "contact_id": "xB9NXoV8YO",
      "sender": "person_40",
      "message": "Just wanted to follow up.",
      "media_url": null,
      "aborted": true,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1728959791.245722,
      "created_at": 1728955591.245715,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": "User",
      "abort_reason": "manually cancelled",
      "status_callback": null,
      "event_id": "Pe6beq2bXw",
      "element_id": "1LxJDkd9n2",
      "element_type": "PendingMessage",
      "sent_at": 1728956191.24817
    }
  }
}

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/PxB9NL28YO?auth_id=ZMvbXod8Rm&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=ZMvbXod8Rm
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/messages/PxB9NL28YO?auth_id=ZMvbXod8Rm&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: af761ed5-0dc1-4b48-9d30-eb440ebb0c55
X-Runtime: 0.022517
Content-Length: 730

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "b9ac5cfb-cb86-4c07-8c7a-54c38545ead9",
      "account_id": "wd6JmkPb7m",
      "ticket_id": "OLb4Wro84Y",
      "contact_id": "YnbgEGeJae",
      "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": 1728956194.46797,
      "sent_at": 1728956194.49522,
      "content_blocked": null,
      "event_id": "PxB9NL28YO",
      "element_id": "GeAbZ7Q9DM",
      "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=BLP9M6WJqY&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=BLP9M6WJqY
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=BLP9M6WJqY&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: 3db948d6-4544-4141-b8ca-17eb73cd21e6
X-Runtime: 0.028737
Content-Length: 1419

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "399a4417-2577-4acf-83b2-face59ea80bd",
        "account_id": "WAnJQAYJy1",
        "ticket_id": "o48OvwnJeA",
        "contact_id": "N6bwQ3RJDM",
        "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": 1728956192.64492,
        "sent_at": 1728956192.67656,
        "content_blocked": null,
        "event_id": "xoWbq4W8qn",
        "element_id": "1K2b2lqJWR",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "20b2cd94-d368-4f11-86c3-fd18a51f1c10",
        "account_id": "WAnJQAYJy1",
        "ticket_id": "o48OvwnJeA",
        "contact_id": "N6bwQ3RJDM",
        "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": 1728955592.55914,
        "sent_at": 1728956192.60348,
        "content_blocked": null,
        "event_id": "GeAbZDLJDM",
        "element_id": "EDR8z6M8A2",
        "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=enL8aaj87N&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1728950191.6714518&created_at%5Bto%5D=1728956251.6714702

Headers

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

Query Parameters

auth_id=enL8aaj87N
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1728950191.6714518", "to"=>"1728956251.6714702"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=enL8aaj87N&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1728950191.6714518&created_at%5Bto%5D=1728956251.6714702" -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: 749365b6-7f02-4028-9391-ecf45a06ef31
X-Runtime: 0.105303
Content-Length: 742

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "360c44c2-70ba-4d5c-a6f6-9261ea40b23e",
        "account_id": "PxB9NrB9YO",
        "ticket_id": "kAJvDKrb0o",
        "contact_id": "AnJQz4m8y1",
        "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": 1728956191.58655,
        "sent_at": 1728956191.60994,
        "content_blocked": null,
        "event_id": "EZA9P1lJrw",
        "element_id": "v7Mb6Mn8ER",
        "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=PxB9N6O9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1728956132.301282&created_at%5Bto%5D=1728956252.301295&document=false

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=PxB9N6O9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1728956132.301282&created_at%5Bto%5D=1728956252.301295&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: 7dceee9b-2dd5-4086-a1da-87f3366a4b2d
X-Runtime: 0.048445
Content-Length: 741

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "cc02e5a7-187c-4e99-a747-c7a146f7ec61",
        "account_id": "BLP9MwZ8qY",
        "ticket_id": "LxJDvGobn2",
        "contact_id": "Rg80glaJj0",
        "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": 1728956192.21596,
        "sent_at": 1728956192.2386,
        "content_blocked": null,
        "event_id": "zPG9y4QbaO",
        "element_id": "BDr8GWM8Pl",
        "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=WAnJQqKJy1&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1

Headers

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

Query Parameters

auth_id=WAnJQqKJy1
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=WAnJQqKJy1&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: 828d8c61-c1f8-4b6e-b203-39ef901a7c11
X-Runtime: 0.035859
Content-Length: 533

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "0nMJL138vZ",
        "ticket_id": "7Mb6WEk9ER",
        "contact_id": "5V9VA4zblr",
        "sender": "person_44",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1728959793.164507,
        "created_at": 1728955593.164481,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "v5D9RrW9VA",
        "element_id": "v7Mb6yG8ER",
        "element_type": "PendingMessage",
        "sent_at": 1728956193.16994
      }
    ]
  },
  "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=0nMJLWR9vZ&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1728956193.6550322&scheduled_for%5Bto%5D=1731638193.655071&document=false

Headers

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

Query Parameters

auth_id=0nMJLWR9vZ
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=
page=1
scheduled_for={"from"=>"1728956193.6550322", "to"=>"1731638193.655071"}
document=false

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=0nMJLWR9vZ&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=&page=1&scheduled_for%5Bfrom%5D=1728956193.6550322&scheduled_for%5Bto%5D=1731638193.655071&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: b10850a9-ec02-4e5a-a082-d59d9ea6cb5c
X-Runtime: 0.048821
Content-Length: 532

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "KRg80O4Jj0",
        "ticket_id": "Dr8GnkDJPl",
        "contact_id": "vnJAvpe8AD",
        "sender": "person_45",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1728959793.6125178,
        "created_at": 1728955593.6125,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "VePJljKbar",
        "element_id": "z1N8x16b37",
        "element_type": "PendingMessage",
        "sent_at": 1728956193.62006
      }
    ]
  },
  "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=KRg80078j0&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=aborted%3A+false&page=1&document=false

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/messages/scheduled?auth_id=KRg80078j0&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: e973c3dd-eacd-46c5-a669-57b347acae76
X-Runtime: 0.039107
Content-Length: 535

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "account_id": "ZMvbXOO8Rm",
        "ticket_id": "K2b2x13JWR",
        "contact_id": "webY02o8aE",
        "sender": "person_46",
        "message": "Just wanted to follow up.",
        "media_url": null,
        "aborted": false,
        "sent": {
          "element_id": null,
          "element_type": null
        },
        "scheduled_for": 1728959794.0760589,
        "created_at": 1728955594.0760179,
        "cancel_on": null,
        "aborter_id": null,
        "aborted_by": null,
        "abort_reason": null,
        "status_callback": null,
        "event_id": "2jRbk4V91P",
        "element_id": "BDr8G1N9Pl",
        "element_type": "PendingMessage",
        "sent_at": 1728956194.09062
      }
    ]
  },
  "page": 1
}

Send Message

Send a Message to any Contact based on their phone

Endpoint

POST /v1/messages

Parameters

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

Request

Route

POST /v1/messages

Headers

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

Body

{
  "auth_id": "ezjJ74O85y",
  "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":"ezjJ74O85y","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: 76d8aedd-bee9-4b6b-bc09-78731c9d7707
X-Runtime: 0.457934
Content-Length: 765

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "caf49cb2-2e6a-4f75-9981-13c34f336d52",
      "account_id": "xDjJBlmboO",
      "ticket_id": "3NbrBg2br6",
      "contact_id": "zjJ7WQLJ5y",
      "sender_id": "7Mb6WZA9ER",
      "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 35: 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": 1728956190.13655,
      "sent_at": 1728956190.1342,
      "content_blocked": null,
      "event_id": "PDz9nqmbe3",
      "element_id": "RkAJvzdJ0o",
      "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": "xDjJBq69oO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "scheduled_for": 1728956790.72825,
  "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":"xDjJBq69oO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","scheduled_for":1728956790.72825,"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: afd17f18-06da-48c5-91a4-d645b81f732a
X-Runtime: 0.208443
Content-Length: 522

Body

{
  "status": 200,
  "data": {
    "message": {
      "account_id": "2jRbk7Xb1P",
      "ticket_id": "vnJA1z7JAD",
      "contact_id": "nL8ajGlb7N",
      "sender": "person_38",
      "message": "test message",
      "media_url": null,
      "aborted": false,
      "sent": {
        "element_id": null,
        "element_type": null
      },
      "scheduled_for": 1728956790.0,
      "created_at": 1728956190.907294,
      "cancel_on": null,
      "aborter_id": null,
      "aborted_by": null,
      "abort_reason": null,
      "status_callback": "https://my.domain.com",
      "event_id": "BDr8GkN8Pl",
      "element_id": "3Ynbgd59ae",
      "element_type": "PendingMessage",
      "sent_at": 1728956190.90589
    }
  }
}

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/MvbX74z8Rm%2CRg80gaLJj0/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/MvbX74z8Rm%2CRg80gaLJj0/tags" -d '{"auth_id":"VePJlE58ar","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: 2036430c-b2bb-41a7-a184-30bdadc4427d
X-Runtime: 0.038431
Content-Length: 94

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"wd6JmdP97m","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: e2860eb2-7032-4850-8289-64560decc9e2
X-Runtime: 0.147747
Content-Length: 81

Body

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

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

Headers

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

Query Parameters

auth_id=v5D9RNx9VA
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tags?auth_id=v5D9RNx9VA&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: 8272ab6e-2d20-4984-b6fe-ca53a325aa41
X-Runtime: 0.034420
Content-Length: 100

Body

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

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/DjJBNyZJoO%2CzjJ7WlEJ5y/tags

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/contacts/DjJBNyZJoO%2CzjJ7WlEJ5y/tags" -d '{"auth_id":"xlYJpWL9mw","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: e447f10a-d7e3-4e57-be6b-a9d2f47ffeb8
X-Runtime: 0.083247
Content-Length: 96

Body

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

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

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"ZMvbXwO8Rm","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: b54ef510-241c-4408-adb6-0e99f6629e5b
X-Runtime: 0.023479
Content-Length: 83

Body

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

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

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/QL9WLGaJWq" -d '{"auth_id":"NEnJdMp8Rm","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: 7b77eebc-767f-4c38-b1c0-e14fdecde6a9
X-Runtime: 0.094475
Content-Length: 394

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "QL9WLGaJWq",
        "uuid": "d273da04-1936-47fe-98f6-2ea7732173c9",
        "contact": "o48OmoE9eA",
        "user_id": "3y832KdJVN",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956182.968538,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/PG9y32z8aO

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/PG9y32z8aO" -d '{"auth_id":"AwebYrm9aE","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: 4bab96c5-e794-4846-a055-d2d904fffe68
X-Runtime: 0.075072
Content-Length: 387

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "PG9y32z8aO",
        "uuid": "10027413-872f-4f48-9ed5-0b0b14d1b513",
        "contact": "7Mb6km79ER",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956183.2869272,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/K2b2xz3JWR%2CDR8zM2AJA2

Headers

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

Body

{
  "auth_id": "qxk9EOE8RK",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_2@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/K2b2xz3JWR%2CDR8zM2AJA2" -d '{"auth_id":"qxk9EOE8RK","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_2@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: 039b8c3f-d736-4544-b9d6-d26bfed2e716
X-Runtime: 0.469796
Content-Length: 758

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "DR8zM2AJA2",
        "uuid": "f97aed1c-39a2-46bb-98bf-52988c7a1826",
        "contact": "webY0dv8aE",
        "user_id": "PG9y3Yq8aO",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956181.3669171,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      },
      {
        "id": "K2b2xz3JWR",
        "uuid": "278f86e3-920d-4d10-a2da-5cd21c3b5cb1",
        "contact": "kAJvMLa90o",
        "user_id": "PG9y3Yq8aO",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956181.5008378,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/OLb4Wzo84Y%2Ce6beaMdbXw

Headers

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

Body

{
  "auth_id": "kvnJAenJAD",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "eAbZv3XbDM"
}

cURL

curl "https://www.avochato.com/v1/tickets/OLb4Wzo84Y%2Ce6beaMdbXw" -d '{"auth_id":"kvnJAenJAD","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"eAbZv3XbDM"}' -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: 54a7bb11-5517-49a7-975f-faaf03c3138f
X-Runtime: 0.411248
Content-Length: 756

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "e6beaMdbXw",
        "uuid": "30415215-72c2-4873-9706-ae47769f1043",
        "contact": "YnbgEPRJae",
        "user_id": "eAbZv3XbDM",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956182.230648,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      },
      {
        "id": "OLb4Wzo84Y",
        "uuid": "9c09c2dd-3023-4482-933a-a4d78374c168",
        "contact": "LxJD5yW8n2",
        "user_id": "eAbZv3XbDM",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956182.314705,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/EG8jAqrJQl

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/EG8jAqrJQl" -d '{"auth_id":"M3Nbr5R8r6","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: 47c0489e-f573-498f-a473-2d687d4c3f49
X-Runtime: 0.108086
Content-Length: 396

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "EG8jAqrJQl",
        "uuid": "bbfad1bb-61e8-41e0-81e9-1133af30b5e0",
        "contact": "MvbX7mz8Rm",
        "user_id": "nMJLy1N8vZ",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1728956198.733112,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/5D9R0E28VA%2ClYJplp5Jmw

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/5D9R0E28VA%2ClYJplp5Jmw" -d '{"auth_id":"k5V9V2Y9lr","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: fd3180e4-c1d8-4276-854e-402c1e4dc4ac
X-Runtime: 0.060981
Content-Length: 752

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "lYJplp5Jmw",
        "uuid": "7d731827-9d05-4b49-935c-27d434b93e43",
        "contact": "d6Jmxpz97m",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956199.018301,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      },
      {
        "id": "5D9R0E28VA",
        "uuid": "7a904ba6-3006-4358-aee1-2fff4297c8b2",
        "contact": "ePJlYyY8ar",
        "user_id": "Rg80KOyJj0",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956199.0563252,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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/LP9MzG0JqY/previous?auth_id=43y83ZnJVN&auth_secret=YYYYYYYYYYYYYYYYYYYY

Headers

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

Query Parameters

auth_id=43y83ZnJVN
auth_secret=YYYYYYYYYYYYYYYYYYYY

cURL

curl -g "https://www.avochato.com/v1/tickets/LP9MzG0JqY/previous?auth_id=43y83ZnJVN&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: 776f999e-cc28-450e-a017-7839100b70c5
X-Runtime: 0.034146
Content-Length: 326

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xB9NQWWbYO",
        "uuid": "041de9c4-914e-49d6-b24e-28b640c7b317",
        "channel": "sms",
        "contact": "MvbX7en8Rm",
        "created_at": 1728956187.58332,
        "closed_at": 1728952587.58231,
        "user": {
          "id": "webYqWdbaE",
          "name": "Person 29"
        },
        "device_type": null,
        "option_data": null,
        "tags": [

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

Fetch Tickets

You can fetch Tickets by ids

Endpoint

GET /v1/tickets/:ids

Parameters

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

Request

Route

GET /v1/tickets/jRbkRr581P%2CzjJ76Z095y?auth_id=xoWbqdB8qn&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=xoWbqdB8qn
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/jRbkRr581P%2CzjJ76Z095y?auth_id=xoWbqdB8qn&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: 7432e446-5b53-410b-8e4a-94acaa61cf66
X-Runtime: 0.022724
Content-Length: 757

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "jRbkRr581P",
        "uuid": "e6045471-d97b-4138-a81c-94b3bba35817",
        "contact": "lYJp6BDbmw",
        "user_id": "EnJdnaDbRm",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956187.349943,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      },
      {
        "id": "zjJ76Z095y",
        "uuid": "2240d619-136b-44c7-8ba8-06dbc64e1417",
        "contact": "EG8jnzp8Ql",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956187.265719,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": 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=wEG8jrN8Ql&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

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

Query Parameters

auth_id=wEG8jrN8Ql
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=wEG8jrN8Ql&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: a24a6464-011d-4d3a-b9ce-0e46f597f6c0
X-Runtime: 0.028402
Content-Length: 773

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "Rg80KzPJj0",
        "uuid": "1c7ae184-c2ad-4705-a3c2-b5fea64270a8",
        "contact": "ePJlYXO8ar",
        "user_id": "kAJvDOzb0o",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956187.892693,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      },
      {
        "id": "AnJQLGw9y1",
        "uuid": "97b6f619-30f3-4896-a41c-e40423cf6623",
        "contact": "d6Jmxml97m",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1728956187.825082,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      }
    ],
    "total_count": 2
  },
  "page": 1
}

Search Tickets

You can search for matching Tickets based on a query

Endpoint

GET /v1/tickets

Parameters

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

Request

Route

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

Headers

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

Query Parameters

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

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=GeAbZVabDM&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: 450d83dd-8b07-4af9-8674-a86fb4d51098
X-Runtime: 0.035521
Content-Length: 419

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ePJl7VN9ar",
        "uuid": "afe3d0d6-3b98-41c5-b150-2bd3a91da8e3",
        "contact": "3y83WQw8VN",
        "user_id": "vnJA1LoJAD",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956187.076076,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      }
    ],
    "total_count": 1
  },
  "page": 1
}

Update Unaddressed

You can mark a ticket as Addressed or Unaddressed automatically

Endpoint

PUT /v1/tickets/:ids

Parameters

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

Request

Route

PUT /v1/tickets/5D9R0G28VA

Headers

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

Body

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

cURL

curl "https://www.avochato.com/v1/tickets/5D9R0G28VA" -d '{"auth_id":"PweboWBbXm","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: 895bfbb4-6070-419b-8a58-f022233159c5
X-Runtime: 0.048331
Content-Length: 394

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "5D9R0G28VA",
        "uuid": "19050317-11fe-4369-8343-1719d4255567",
        "contact": "eAbZnPpbDM",
        "user_id": "xk9ELr6bRK",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1728956186.795299,
        "device_type": null,
        "device": null,
        "os": null,
        "os_version": null,
        "browser": null,
        "browser_version": null,
        "ip": null,
        "widget_referrer_url": null,
        "active_survey_id": null
      }
    ]
  }
}

Users

Users represent a unique user an Avochato Account.

List all Users

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

Endpoint

GET /v1/users

Parameters

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

Request

Route

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

Headers

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

Query Parameters

auth_id=wd6Jm5rJ7m
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/users?auth_id=wd6Jm5rJ7m&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: 0baa4bc9-2d74-4e62-b952-d5d7671419f2
X-Runtime: 0.044838
Content-Length: 302

Body

{
  "status": 200,
  "data": {
    "users": [
      {
        "email": "person_30@example.com",
        "id": "eAbZv5XbDM",
        "name": "Person 31",
        "image_url": null
      },
      {
        "email": "bob.mctest@test.com",
        "id": "oWbqpYL8qn",
        "name": "Bob McTest",
        "image_url": null
      },
      {
        "email": "other.bob@test.com",
        "id": "3y8325dJVN",
        "name": "Other Bob",
        "image_url": null
      }
    ]
  },
  "page": 1
}