Subscriptions

Search Subscriptions

Method: GET

URL: https://zstatus.io/api/v0/subscriptions

Params

KeyDescriptionRequired

Example

const subscriptions = await api.getSubscriptions({
})

Example Response

{
"edges": [
{
"node": {
"id": "cl4wwd75n007909mthh9z5woq",
"type": "SMS",
"value": "+14025950585",
"userId": "cl4ww9o71012909mjg92ih1cm",
"pageId": "cl4ww9v04016509mjisnijiwe",
"serviceId": "cl4wwa86t040409mj0y2n0tfq",
"createdAt": "2022-06-27T15:30:56.507Z",
"updatedAt": "2022-06-27T15:30:56.508Z",
"page": {
...
},
"service": {
...
}
},
"cursor": "cl4wwd75n007909mthh9z5woq"
},
{
"node": {
"id": "cl4wwcxkc005609mt9n28ah5m",
"type": "Email",
"value": "eric@zeusdev.co",
"userId": "cl4ww9o71012909mjg92ih1cm",
"pageId": "cl4ww9v04016509mjisnijiwe",
"serviceId": null,
"createdAt": "2022-06-27T15:30:44.076Z",
"updatedAt": "2022-06-27T15:30:44.077Z",
"page": {
...
},
"service": null
},
"cursor": "cl4wwcxkc005609mt9n28ah5m"
}
],
"nodes": [
{
"id": "cl4wwd75n007909mthh9z5woq",
"type": "SMS",
"value": "+14025950585",
"userId": "cl4ww9o71012909mjg92ih1cm",
"pageId": "cl4ww9v04016509mjisnijiwe",
"serviceId": "cl4wwa86t040409mj0y2n0tfq",
"createdAt": "2022-06-27T15:30:56.507Z",
"updatedAt": "2022-06-27T15:30:56.508Z",
"page": {
...
},
"service": {
...
}
},
{
"id": "cl4wwcxkc005609mt9n28ah5m",
"type": "Email",
"value": "eric@zeusdev.co",
"userId": "cl4ww9o71012909mjg92ih1cm",
"pageId": "cl4ww9v04016509mjisnijiwe",
"serviceId": null,
"createdAt": "2022-06-27T15:30:44.076Z",
"updatedAt": "2022-06-27T15:30:44.077Z",
"page": {
...
},
"service": null
}
],
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "cl4wwd75n007909mthh9z5woq",
"endCursor": "cl4wwcxkc005609mt9n28ah5m"
},
"totalCount": 2
}

API Types

export enum APIPageSubscriptionNotificationType {
Email = 'Email',
SMS = 'SMS',
Webhook = 'Webhook',
}
export interface APISubscriptionDeleteResponse {
success: boolean;
}
export interface APIImportBulkSubscriptionsResponse {
count: number;
}
export interface CreateBulkSubscriptionProps {
pageId: string;
subscriptions: {
type: APIPageSubscriptionNotificationType;
value: string;
}[];
}
export interface CreateEmailSubscriptionProps {
pageId: string;
serviceId?: string;
userId?: string;
type: APIPageSubscriptionNotificationType.Email;
email: string;
}
export interface CreateSMSSubscriptionProps {
pageId: string;
serviceId?: string;
userId?: string;
type: APIPageSubscriptionNotificationType.SMS;
phone: string;
}
export interface CreateWebhookSubscriptionProps {
pageId: string;
serviceId?: string;
userId?: string;
type: APIPageSubscriptionNotificationType.Webhook;
url: string;
email: string;
}
export interface UpdateSubscriptionProps {
id: string;
pageId: string;
serviceId?: string;
userId?: string;
type: APIPageSubscriptionNotificationType;
value: string;
}
export interface APISubscription {
id: string;
pageId: string;
serviceId?: string;
userId?: string;
type: APIPageSubscriptionNotificationType;
value: string;
createdAt: string;
updatedAt: string;
}
export interface APISubscriptionSearchArgs {
pageId: string;
type: APIPageSubscriptionNotificationType;
}