API reference
Notifications
In-app notifications and email / SMS preferences.
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 booleanemailPickups• Required booleanemailShipments• Required booleanemailSupport• Required booleanmarketingEmails• Required boolean
curl "https://api.parcelhub.ca/v1/notification-preferences" \
-H "Authorization: Bearer $TOKEN"{
"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 booleanBilling and wallet emails.
emailPickups• Required booleanPickup updates.
emailShipments• Required booleanShipment updates.
emailSupport• Required booleanSupport ticket replies.
marketingEmails• Required booleanNews and offers.
Response in data
emailBilling• Required booleanemailPickups• Required booleanemailShipments• Required booleanemailSupport• Required booleanmarketingEmails• Required boolean
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
}'{
"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_onlybooleanlimitintegerMost results to return.
offsetintegerResults to skip, for paging.
Response in data
See the example on the right.
curl "https://api.parcelhub.ca/v1/notifications" \
-H "Authorization: Bearer $TOKEN"{
"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.
curl -X DELETE "https://api.parcelhub.ca/v1/notifications" \
-H "Authorization: Bearer $TOKEN"{
"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.
curl -X DELETE "https://api.parcelhub.ca/v1/notifications/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"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.
curl -X POST "https://api.parcelhub.ca/v1/notifications/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f/read" \
-H "Authorization: Bearer $TOKEN"{
"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.
curl -X POST "https://api.parcelhub.ca/v1/notifications/read-all" \
-H "Authorization: Bearer $TOKEN"{
"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.
curl "https://api.parcelhub.ca/v1/notifications/unread-count" \
-H "Authorization: Bearer $TOKEN"{
"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 booleanexception• Required booleaninTransit• Required booleanisPersonal• Required booleanorganizationId• Required uuidorganizationName• Required stringreadyForPickup• Required boolean
curl "https://api.parcelhub.ca/v1/sms-preferences" \
-H "Authorization: Bearer $TOKEN"{
"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 booleanText when a parcel is delivered.
exception• Required booleanText when there is a delivery problem.
inTransit• Required booleanText when a parcel is on its way.
readyForPickup• Required booleanText when a pickup is booked and ready.
Response in data
See the example on the right.
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
}'{
"ok": true,
"data": true,
"request_id": "01JBX7Q2…"
}