Email preferences

GET /v1/notification-preferences

Which optional email categories the person receives. Account, security and legal emails always go out.

Response in data

  • emailBilling • Required boolean
  • emailPickups • Required boolean
  • emailShipments • Required boolean
  • emailSupport • Required boolean
  • marketingEmails • Required boolean
GET /v1/notification-preferences
curl "https://api.parcelhub.ca/v1/notification-preferences" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": {
    "emailBilling": true,
    "emailPickups": true,
    "emailShipments": true,
    "emailSupport": true,
    "marketingEmails": true
  },
  "request_id": "01JBX7Q2…"
}

Update email preferences

PUT /v1/notification-preferences

Turns optional email categories on or off.

Request body

  • emailBilling • Required boolean

    Billing and wallet emails.

  • emailPickups • Required boolean

    Pickup updates.

  • emailShipments • Required boolean

    Shipment updates.

  • emailSupport • Required boolean

    Support ticket replies.

  • marketingEmails • Required boolean

    News and offers.

Response in data

  • emailBilling • Required boolean
  • emailPickups • Required boolean
  • emailShipments • Required boolean
  • emailSupport • Required boolean
  • marketingEmails • Required boolean
PUT /v1/notification-preferences
curl -X PUT "https://api.parcelhub.ca/v1/notification-preferences" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "emailBilling": true,
  "emailPickups": true,
  "emailShipments": true,
  "emailSupport": true,
  "marketingEmails": true
}'
Response
{
  "ok": true,
  "data": {
    "emailBilling": true,
    "emailPickups": true,
    "emailShipments": true,
    "emailSupport": true,
    "marketingEmails": true
  },
  "request_id": "01JBX7Q2…"
}

List notifications

GET /v1/notifications

In-app notifications, newest first.

Query parameters

  • unread_only boolean
  • limit integer

    Most results to return.

  • offset integer

    Results to skip, for paging.

Response in data

See the example on the right.

GET /v1/notifications
curl "https://api.parcelhub.ca/v1/notifications" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": [
    "string"
  ],
  "request_id": "01JBX7Q2…"
}

Delete all notifications

DELETE /v1/notifications

Deletes every notification.

Response in data

See the example on the right.

DELETE /v1/notifications
curl -X DELETE "https://api.parcelhub.ca/v1/notifications" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": 1,
  "request_id": "01JBX7Q2…"
}

Delete a notification

DELETE /v1/notifications/{id}

Deletes one notification.

Path parameters

  • id • Required string

Response in data

See the example on the right.

DELETE /v1/notifications/{id}
curl -X DELETE "https://api.parcelhub.ca/v1/notifications/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": true,
  "request_id": "01JBX7Q2…"
}

Mark as read

POST /v1/notifications/{id}/read

Marks one notification read.

Path parameters

  • id • Required string

Response in data

See the example on the right.

POST /v1/notifications/{id}/read
curl -X POST "https://api.parcelhub.ca/v1/notifications/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/read" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": true,
  "request_id": "01JBX7Q2…"
}

Mark all as read

POST /v1/notifications/read-all

Marks every notification read.

Response in data

See the example on the right.

POST /v1/notifications/read-all
curl -X POST "https://api.parcelhub.ca/v1/notifications/read-all" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": 1,
  "request_id": "01JBX7Q2…"
}

Unread count

GET /v1/notifications/unread-count

How many notifications are unread.

Response in data

See the example on the right.

GET /v1/notifications/unread-count
curl "https://api.parcelhub.ca/v1/notifications/unread-count" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": 1,
  "request_id": "01JBX7Q2…"
}

SMS preferences

GET /v1/sms-preferences

Text-message updates for each account the person belongs to. Texts need a verified phone number.

Response in data

  • delivered • Required boolean
  • exception • Required boolean
  • inTransit • Required boolean
  • isPersonal • Required boolean
  • organizationId • Required uuid
  • organizationName • Required string
  • readyForPickup • Required boolean
GET /v1/sms-preferences
curl "https://api.parcelhub.ca/v1/sms-preferences" \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "ok": true,
  "data": [
    {
      "delivered": true,
      "exception": true,
      "inTransit": true,
      "isPersonal": true,
      "organizationId": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
      "organizationName": "string",
      "readyForPickup": true
    }
  ],
  "request_id": "01JBX7Q2…"
}

Update SMS preferences

PUT /v1/sms-preferences/{org_id}

Turns text-message updates on or off for one account.

Path parameters

  • org_id • Required string

Request body

  • delivered • Required boolean

    Text when a parcel is delivered.

  • exception • Required boolean

    Text when there is a delivery problem.

  • inTransit • Required boolean

    Text when a parcel is on its way.

  • readyForPickup • Required boolean

    Text when a pickup is booked and ready.

Response in data

See the example on the right.

PUT /v1/sms-preferences/{org_id}
curl -X PUT "https://api.parcelhub.ca/v1/sms-preferences/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "delivered": true,
  "exception": true,
  "inTransit": true,
  "readyForPickup": true
}'
Response
{
  "ok": true,
  "data": true,
  "request_id": "01JBX7Q2…"
}