Subscription Groups
Preview
This schema is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
A subscription group represents a collection of subscriptions.
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Example
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13.0Z"
}
List all subscription groups
Returns a list of subscription groups. The subscription groups returned are sorted by creation date, with the most recently created subscription groups appearing first.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
Query Parameters
- Name
- subscription
- Type
- array
- Description
A comma-separated list of subscriptions by which to filter the subscription groups.
- Name
- after
- Type
- string
- Description
A cursor for use in pagination. The
afterparameter takes an object ID that defines the position in the list, only items immediately following the item with that ID will be returned.
- Name
- before
- Type
- string
- Description
A cursor for use in pagination. The
beforeparameter takes an object ID that defines the position in the list, only items immediately preceding the item with that ID will be returned.
- Name
- limit
- Type
- integer
- Description
The limit of items to be returned in the list, between 0 and 200.
Default:10>= 0<= 200
Responses
Returns a dictionary with an items property that contains an array of subscription groups.
- Name
- object
- Type
- string
- Description
Type of object is always
list.Allowed values:list
- Name
- items
- Type
- array
- Description
- List of objects of type
subscriptionGroup.
- Name
- moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
afterpagination parameter if more items are available sorted after the current batch of items.
- Name
- moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
beforepagination parameter if more items are available sorted before the current batch of items.
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses
{
"object": "list",
"items": [
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Create a subscription group
Creates a new subscription group in the specified project.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Responses
Returns the newly created subscription group.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Response
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}
Retrieve a subscription group
Retrieves the details of an existing subscription group.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
- Name
- subscriptionGroup
- Type
- string
- Description
The unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
required
Responses
Returns the subscription group object if it exists.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups/{subscriptionGroup} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Response
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}
Delete a subscription group
Deletes a subscription group. Subscriptions in the group are not deleted; they are detached from the group and continue independently.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
- Name
- subscriptionGroup
- Type
- string
- Description
The unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
required
Responses
Returns the deleted subscription group.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups/{subscriptionGroup} \
-X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Response
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}
Add subscriptions to a subscription group
Adds one or more existing subscriptions to the specified subscription group. The operation is atomic: if any subscription cannot be added, none are added and the response identifies the offending subscriptions.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Body
- Name
- subscriptions
- Type
- array
- Description
Unique identifiers of the subscriptions to add to the group. All subscriptions are added atomically: if any one cannot be added, none are.
required
Path Parameters
- Name
- subscriptionGroup
- Type
- string
- Description
The unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
required
Responses
Returns the updated subscription group.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups/{subscriptionGroup}/addSubscriptions \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
]
}'
Response
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}
Remove subscriptions from a subscription group
Removes one or more subscriptions from a subscription group. The subscriptions are not deleted and continue independently. The operation is atomic: if any subscription cannot be removed, none are removed and the response identifies the offending subscriptions.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Body
- Name
- subscriptions
- Type
- array
- Description
Unique identifiers of the subscriptions to remove from the group. All subscriptions are removed atomically: if any one cannot be removed, none are.
required
Path Parameters
- Name
- subscriptionGroup
- Type
- string
- Description
The unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
required
Responses
Returns the updated subscription group.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionGroup.Allowed values:subscriptionGroup
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription group.
Example:"sgr_0SNlurA049MEWV26leJMWPp4o23C"
- Name
- subscriptions
- Type
- array
- Description
List of subscription identifiers that belong to this group.
- Name
- createdAt
- Type
- string
- Description
Time when the subscription group was created.
Example:"2021-01-21T19:32:13Z"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionGroups/{subscriptionGroup}/removeSubscriptions \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
]
}'
Response
{
"object": "subscriptionGroup",
"id": "sgr_0SNlurA049MEWV26leJMWPp4o23C",
"subscriptions": [
"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
],
"createdAt": "2021-01-21T19:32:13Z"
}