Group Resource

The Groups Resource endpoint helps you perform operations on groups (a.k.a Audiences, Newsletters).

Endpoint

https://propagate.at/api/v1/groups


GET /

Returns an array of all the groups/audiences/newsletters the authenticated user owns.

note

Make sure your request body is sent in the JSON Format.

Example Request

curl
-X GET
-H 'Content-Type: application/json'
-H "Authorization: Bearer {{API_SECRET_KEY}}"
https://propagate.at/api/v1/groups

Example Response

{
"data": {
"groups": [
{
"_id": "5f97f8963de2575b7888301c",
"groupIntegrations": [
"EMAIL"
],
"name": "Default Group Name",
"slug": "test",
"bio": "This group is for...",
"type": "OPEN",
"paidMonthly": 3,
"paidYearly": 28,
"creator": "5f72e09e613a120856e80da7",
"createdAt": "2020-10-27T10:38:14.202Z",
"updatedAt": "2020-10-27T10:56:48.877Z"
}
]
}
}

POST /

Creates a Group/Audience/Newsletter.

Body Parameters

name string required

The name of the group.

slug string required

The slug of the group. Slug decides what the join link would look like.

bio string required

The description of the group that will be visible publicly in the join link.

type enum open | paid | invite_only required

The type of the group.

paidMonthly int optional

Only applicable if type=paid. The integer value decides how much the newsletter subscription would cost per month (in USD) fro your subscribers.

paidYearly int optional

Only applicable if type=paid. The integer value decides how much the newsletter subscription would cost per year (in USD) fro your subscribers.

groupIntegrations [enum] email | whatsapp | sms required

The integrations or service platforms of subscribers that are allowed to subscribe to the group. If you want only Email IDs to subscribe to your group, groupIntegrations should be ["EMAIL"].

Example Request

curl
-X POST
-H 'Content-Type: application/json'
-H "Authorization: Bearer {{API_SECRET_KEY}}"
--data '{
"name": "Test Group",
"slug": "test",
"bio": "This is a test group",
"type": "paid",
"groupIntegrations": ["EMAIL", "SMS"],
"paidMonthly": 2,
"paidYearly": 12
}'
https://propagate.at/api/v1/groups

Example Response

{
"data": {
"createGroup": {
"name": "Test Group",
"slug": "test",
"groupIntegrations": [
"SMS",
"EMAIL"
],
"bio": "This is a test group",
"type": "paid",
"paidMonthly": 2,
"paidYearly": 12,
"creator": "5f72e09e613a120856e80da7",
"createdAt": "2020-10-27T18:05:56.422Z",
"updatedAt": "2020-10-27T18:05:56.422Z",
"_id": "5f98618452678e609bb0e431"
}
}
}

DELETE /

Deletes multiple groups by their IDs.

Body Parameters

groupIds [string] required

An array of Group IDs. The array consists IDs of the groups to be deleted.

Example Request

curl
-X DELETE
-H 'Content-Type: application/json'
-H "Authorization: Bearer {{API_SECRET_KEY}}"
--data '{"groupIds": ["5f97f9163de2575b7888301d", "5f97f9163de2575b7888301f"]}'
https://propagate.at/api/v1/groups

Example Response

{
"data": {
"deleteGroups": {
"result": {
"n": 2,
"ok": 1
},
"deletedCount": 2,
"ids": [
"5f97f9163de2575b7888301d",
"5f97f9163de2575b7888301f"
]
}
}
}

Ending note

If you got any questions, feel free to drop us those at hey[at]propagate.at. We will help!