1. Support
  2. List Support Requests

Support

List Support Requests

GET
`/v1/support`

Returns the support requests submitted by your organization, newest activity first when you ask for it. Requires authentication, but no particular permission - which also means any credential that can authenticate against your organization can list its support requests.

data is always an array, even when you have no support requests.

js
        const response = await fetch("https://api.packagex.io/v1/support", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const support_emails = response.data; //the array of support requests
const pagination = response.pagination; //the pagination object

      

What the list returns

Each entry is a Support Email object without the message body. A list of support requests does not need every message in full, so body is returned only when you retrieve a single request. Attachments work the same way: the list gives you attachment_count, and the attachment details come back on retrieve.

Pagination

If the has_more property on the pagination object is set to true, there are more support requests that have not been returned. The pagination object also has a page property indicating your current offset and a limit property. The total_count property returns the total number of support requests.

By default the page is set to 1 and the limit is 10.

js
        const response = await fetch("https://api.packagex.io/v1/support?page=2&limit=25", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const support_emails = response.data;
const pagination = response.pagination;

      

Filter

You can filter support requests by status.

  • status - Filter by delivery status. Valid statuses are queued, sent and failed. Pass several at once as a comma-separated list. For example: status=sent,failed
js
        const response = await fetch("https://api.packagex.io/v1/support?status=failed", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const failed_requests = response.data;

      

Sorting

Sorting describes in what order you want your responses to come in. You can select an available property by which to sort, as well as the direction.

  • order_by - The property by which to sort. Available properties are: created_at, updated_at, completed_at, status, subject.
  • direction - The direction to sort. Available directions are: asc and desc.

By default, support requests are sorted by created_at in ascending order, so the oldest are returned first. Pass direction=desc for the most recent first.

js
        const response = await fetch("https://api.packagex.io/v1/support?order_by=created_at&direction=desc", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const support_emails = response.data;
const pagination = response.pagination;

      

Support requests are not searchable. Passing a search query parameter returns 400. Filter by status and sort by date instead, or retrieve a request by its id if you already have one.

Errors

400
An invalid filter or sort value, or a search parameter, which is not supported here.
401
Not authenticated.