Skip to main content
GET
/
programs
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';

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

const program = await client.programs.retrieve('id');

console.log(program.id);
{
"id": "1CLJt2v17V1yuCdrUwA4PW",
"type": "program",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"display_name": "Test Subject to {{ person.name }}",
"status": "published",
"trigger": "api",
"track_opens": false,
"track_clicks": true
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID of the program to retrieve.

Query Parameters

include[]
enum<string>[]

Specifies which related objects to include in the response. Valid options are activity_metrics and program_template.

Available options:
activity_metrics,
program_template

Response

Successful response.

The Program object represents an email campaign. It defines the sending behavior and tracks engagement metrics.

type
string
required

String representing the object’s type. Always program for this object.

Allowed value: "program"
id
string
required

Unique identifier for the object.

status
enum<string>
required

The current status of the program. Can be draft, published, paused, or archived.

Available options:
draft,
published,
paused,
archived
trigger
enum<string>
required

The sending trigger for the program. Can be api for transactional sends or broadcast for scheduled sends.

Available options:
api,
broadcast
track_opens
boolean
required

true if email opens are tracked for this program.

track_clicks
boolean
required

true if link clicks are tracked for this program.

created_at
string<date-time>
required

Time at which the object was created, as an ISO 8601 timestamp in UTC.

updated_at
string<date-time>
required

Time at which the object was last updated, as an ISO 8601 timestamp in UTC.

display_name
string

The user-facing name of the program.

scheduled_at
string<date-time>

For broadcast programs, the time the program is scheduled to send, as an ISO 8601 timestamp in UTC.

activity_metrics
ProgramActivityMetrics · object

A ProgramActivityMetrics object summarizing engagement for this program.

Note: Only present when requested using the include query parameter.

program_template
ProgramTemplate · object

The ProgramTemplate used for messages in this program.

Note: Only present when requested using the include query parameter.