Skip to main content
GET
/
digests
/
schedules
/
{schedule_id}
/
instances
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const digestInstanceListResponse = await client.digests.schedules.listInstances('schedule_id');

console.log(digestInstanceListResponse.has_more);
import os
from courier import Courier

client = Courier(
    api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
)
digest_instance_list_response = client.digests.schedules.list_instances(
    schedule_id="schedule_id",
)
print(digest_instance_list_response.has_more)
package main

import (
	"context"
	"fmt"

	"github.com/trycourier/courier-go"
	"github.com/trycourier/courier-go/option"
)

func main() {
	client := courier.NewClient(
		option.WithAPIKey("My API Key"),
	)
	digestInstanceListResponse, err := client.Digests.Schedules.ListInstances(
		context.TODO(),
		"schedule_id",
		courier.DigestScheduleListInstancesParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", digestInstanceListResponse.HasMore)
}
package com.courier.example;

import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.digests.DigestInstanceListResponse;
import com.courier.models.digests.schedules.ScheduleListInstancesParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        CourierClient client = CourierOkHttpClient.fromEnv();

        DigestInstanceListResponse digestInstanceListResponse = client.digests().schedules().listInstances("schedule_id");
    }
}
require "courier"

courier = Courier::Client.new(api_key: "My API Key")

digest_instance_list_response = courier.digests.schedules.list_instances("schedule_id")

puts(digest_instance_list_response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Courier\Client;
use Courier\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');

try {
  $digestInstanceListResponse = $client->digests->schedules->listInstances(
    'schedule_id', cursor: 'cursor', limit: 100
  );

  var_dump($digestInstanceListResponse);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using TryCourier;
using TryCourier.Models.Digests.Schedules;

CourierClient client = new();

ScheduleListInstancesParams parameters = new() { ScheduleID = "schedule_id" };

var digestInstanceListResponse = await client.Digests.Schedules.ListInstances(parameters);

Console.WriteLine(digestInstanceListResponse);
courier digests:schedules list-instances \
  --api-key 'My API Key' \
  --schedule-id schedule_id
curl --request GET \
  --url https://api.courier.com/digests/schedules/{schedule_id}/instances \
  --header 'Authorization: Bearer <token>'
{
  "type": "list",
  "has_more": false,
  "cursor": null,
  "url": "/digests/schedules/sch%2F00000000-0000-0000-0000-000000000000/instances",
  "next_url": null,
  "items": [
    {
      "digest_instance_id": "a1b2c3d4-0000-0000-0000-000000000000",
      "status": "IN_PROGRESS",
      "event_count": 3,
      "user_id": "user-123",
      "tenant_id": "tenant-abc",
      "disabled": false,
      "created_at": "2024-01-01T00:00:00.000Z",
      "categories": [
        {
          "category_key": "comments",
          "retain": "first"
        }
      ],
      "category_key_counts": {
        "comments": 3
      }
    }
  ]
}
{
  "message": "Unauthorized"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

schedule_id
string
required

The ID of the digest schedule, in the form sch/{uuid}. The value must be URL-encoded (e.g. sch%2F00000000-0000-0000-0000-000000000000).

Query Parameters

cursor
string

A cursor token from a previous response, used to fetch the next page of results.

limit
integer
default:20

The maximum number of digest instances to return. Defaults to 20, with a maximum of 100.

Required range: x <= 100

Response

type
enum<string>
required

Always list for a paginated list response.

Available options:
list
items
DigestInstance · object[]
required

The digest instances for this page of results.

has_more
boolean
required

Whether there are more digest instances to fetch using the cursor.

cursor
string | null

A cursor token for fetching the next page of results, or null when there are none.

url
string

The path of the current request.

next_url
string | null

The path to fetch the next page of results, or null when there are none.