Skip to main content
GET
/
program_templates
/
{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 programTemplate = await client.programTemplates.retrieve('id');

console.log(programTemplate.id);
{
"id": "1CLJt2v17V1yuCdrUwA4PW",
"type": "program_template",
"subject": "Verify your email",
"body": {
"markdown": "Message content"
},
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID of the program template to retrieve.

Query Parameters

include[]
enum<string>[]

Specifies which related objects to include in the response. Valid option is program.

Available options:
program

Response

Successful response.

The ProgramTemplate object defines the content of a message sent by a Program, including support for Liquid templating.

type
string
required

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

Allowed value: "program_template"
id
string
required

Unique identifier for the object.

subject
string
required

The subject line of the email, which can include Liquid variables.

body
FormattedText · object
required

The body content of the email, which can include Liquid variables.

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.

program
Program · object

The Program that uses this template.

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