Subscription Groups

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"
}

GET/projects/{project}/subscriptionGroups

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.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"

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 after parameter 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 before parameter 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 after pagination 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 before pagination parameter if more items are available sorted before the current batch of items.

Request

GET
/projects/{project}/subscriptionGroups
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
}

POST/projects/{project}/subscriptionGroups

Create a subscription group

Creates a new subscription group in the specified project.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"

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

POST
/projects/{project}/subscriptionGroups
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"
}

GET/projects/{project}/subscriptionGroups/{subscriptionGroup}

Retrieve a subscription group

Retrieves the details of an existing subscription group.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    subscriptionGroup
    Type
    string
    required
    Description

    The unique identifier for the subscription group.

    Example: "sgr_0SNlurA049MEWV26leJMWPp4o23C"

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

GET
/projects/{project}/subscriptionGroups/{subscriptionGroup}
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/projects/{project}/subscriptionGroups/{subscriptionGroup}

Delete a subscription group

Deletes a subscription group. Subscriptions in the group are not deleted; they are detached from the group and continue independently.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    subscriptionGroup
    Type
    string
    required
    Description

    The unique identifier for the subscription group.

    Example: "sgr_0SNlurA049MEWV26leJMWPp4o23C"

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

DELETE
/projects/{project}/subscriptionGroups/{subscriptionGroup}
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"
}

POST/projects/{project}/subscriptionGroups/{subscriptionGroup}/addSubscriptions

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.

Body

  • Name
    subscriptions
    Type
    array
    required
    Description

    Unique identifiers of the subscriptions to add to the group. All subscriptions are added atomically: if any one cannot be added, none are.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    subscriptionGroup
    Type
    string
    required
    Description

    The unique identifier for the subscription group.

    Example: "sgr_0SNlurA049MEWV26leJMWPp4o23C"

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

POST
/projects/{project}/subscriptionGroups/{subscriptionGroup}/addSubscriptions
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"
}

POST/projects/{project}/subscriptionGroups/{subscriptionGroup}/removeSubscriptions

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.

Body

  • Name
    subscriptions
    Type
    array
    required
    Description

    Unique identifiers of the subscriptions to remove from the group. All subscriptions are removed atomically: if any one cannot be removed, none are.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    subscriptionGroup
    Type
    string
    required
    Description

    The unique identifier for the subscription group.

    Example: "sgr_0SNlurA049MEWV26leJMWPp4o23C"

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

POST
/projects/{project}/subscriptionGroups/{subscriptionGroup}/removeSubscriptions
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"
}