curl -X PUT https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/digestSubscriptions \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subscription": {"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY", "email": "dana@acme.com", "cadence": "DIGEST_CADENCE_WEEKLY", "dayOfWeek": 1}}'
{
"subscription": {
"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY",
"email": "dana@acme.com",
"cadence": "DIGEST_CADENCE_WEEKLY",
"dayOfWeek": 1
}
}
{ "code": 16, "message": "unauthenticated" }
API
Put digest subscription
Subscribe a recipient to a digest or change its schedule
curl -X PUT https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/digestSubscriptions \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subscription": {"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY", "email": "dana@acme.com", "cadence": "DIGEST_CADENCE_WEEKLY", "dayOfWeek": 1}}'
{
"subscription": {
"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY",
"email": "dana@acme.com",
"cadence": "DIGEST_CADENCE_WEEKLY",
"dayOfWeek": 1
}
}
{ "code": 16, "message": "unauthenticated" }
Subscribes a recipient to a digest, or changes the schedule of an existing subscription for the same recipient and digest. Macroscope emails the digest to the recipient on that schedule from then on. The recipient does not need to be a workspace member and is not asked to confirm the subscription. Each attempt, including a refused or invalid one, is recorded in the workspace audit log with its outcome and the API key, or the person and connected app, that made it. Requests rejected before they reach the operation, such as malformed requests, invalid credentials and rate-limited requests, may have no entry. The entry records the recipient address, digest and cadence.
When the workspace has an email domain allow list, the recipient’s domain must be on it.
See Errors for the rest.
Authorization
Requires an Admin API key, or an OAuth sign-in with Admin access by any workspace member. Read and Write keys get403, and a sign-in with Read or Write access gets an insufficient_scope challenge for macroscope:admin.
Bearer <key>. See Authentication.How your client identifies the source of the request in the workspace audit log. Use
human or agent. Macroscope records the client’s value without verifying it. Other values are treated as unspecified.Path parameters
Body
The subscription.
reportType, email and cadence are required. email must be a valid email address of up to 320 characters. areaId is required for an area digest and not accepted otherwise. ordinalWeek is required for monthly (1 to 5) and quarterly (1 to 14) digests and not accepted otherwise. See DigestSubscription for field values.Response
Errors
| HTTP | Meaning |
|---|---|
400 | Invalid subscription, such as an invalid email address, an areaId that does not match the digest or is not one of the workspace’s areas, an ordinalWeek that does not match the cadence, or the recipient’s domain is not on the workspace’s email domain allow list |
403 | Your credential or your permissions do not allow managing digests |
curl -X PUT https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/digestSubscriptions \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subscription": {"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY", "email": "dana@acme.com", "cadence": "DIGEST_CADENCE_WEEKLY", "dayOfWeek": 1}}'
{
"subscription": {
"reportType": "DIGEST_REPORT_TYPE_PROJECT_ACTIVITY",
"email": "dana@acme.com",
"cadence": "DIGEST_CADENCE_WEEKLY",
"dayOfWeek": 1
}
}
{ "code": 16, "message": "unauthenticated" }