List all layouts
Retrieves a list of layouts with optional filtering and pagination
Authorization
Authorization
<token>API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
In: header
Query Parameters
limit
numberNumber of items to return per page
offset
numberNumber of items to skip before starting to return results
orderDirection
stringDirection of sorting
Value in:
"ASC" | "DESC"
orderBy
stringField to sort the results by
Value in:
"createdAt" | "updatedAt" | "name"
query
stringSearch query to filter layouts
Header Parameters
idempotency-key
stringA header for idempotency purposes
Response Body
OK
layouts
Requiredarray<object>List of layouts
totalCount
RequirednumberTotal number of layouts
export interface Response {
/**
* List of layouts
*/
layouts: LayoutResponseDto[];
/**
* Total number of layouts
*/
totalCount: number;
}
export interface LayoutResponseDto {
/**
* Unique internal identifier of the layout
*/
_id: string;
/**
* Unique identifier for the layout
*/
layoutId: string;
/**
* Slug of the layout
*/
slug: string;
/**
* Name of the layout
*/
name: string;
/**
* Whether the layout is the default layout
*/
isDefault: boolean;
/**
* Whether the layout translations are enabled
*/
isTranslationEnabled: boolean;
/**
* Last updated timestamp
*/
updatedAt: string;
/**
* User who last updated the layout
*/
updatedBy?: UserResponseDto;
/**
* Creation timestamp
*/
createdAt: string;
/**
* Origin of the layout
*/
origin: "novu-cloud" | "novu-cloud-v1" | "external";
/**
* Type of the layout
*/
type: "REGULAR" | "ECHO" | "BRIDGE";
/**
* The variables JSON Schema for the layout
*/
variables?: {
[k: string]: unknown;
} | null;
/**
* Controls metadata for the layout
*/
controls: LayoutControlsDto;
}
export interface UserResponseDto {
/**
* User ID
*/
_id: string;
/**
* User first name
*/
firstName?: string | null;
/**
* User last name
*/
lastName?: string | null;
/**
* User external ID
*/
externalId?: string | null;
}
export interface LayoutControlsDto {
/**
* JSON Schema for data
*/
dataSchema?: {
[k: string]: unknown;
};
/**
* UI Schema for rendering
*/
uiSchema?: UiSchema;
/**
* Email layout controls
*/
values: LayoutControlValuesDto;
}
export interface UiSchema {
/**
* Group of the UI Schema
*/
group?: "IN_APP" | "EMAIL" | "DIGEST" | "DELAY" | "THROTTLE" | "SMS" | "CHAT" | "PUSH" | "SKIP" | "LAYOUT";
/**
* Properties of the UI Schema
*/
properties?: {
[k: string]: UiSchemaProperty;
};
}
export interface UiSchemaProperty {
/**
* Placeholder for the UI Schema Property
*/
placeholder?:
| string
| number
| boolean
| {
[k: string]: unknown;
}
| (
| string
| number
| boolean
| {
[k: string]: unknown;
}
)[];
/**
* Component type for the UI Schema Property
*/
component:
| "EMAIL_EDITOR_SELECT"
| "LAYOUT_SELECT"
| "BLOCK_EDITOR"
| "EMAIL_BODY"
| "TEXT_FULL_LINE"
| "TEXT_INLINE_LABEL"
| "IN_APP_BODY"
| "IN_APP_AVATAR"
| "IN_APP_PRIMARY_SUBJECT"
| "IN_APP_BUTTON_DROPDOWN"
| "IN_APP_DISABLE_SANITIZATION_SWITCH"
| "DISABLE_SANITIZATION_SWITCH"
| "URL_TEXT_BOX"
| "DIGEST_AMOUNT"
| "DIGEST_UNIT"
| "DIGEST_TYPE"
| "DIGEST_KEY"
| "DIGEST_CRON"
| "DELAY_AMOUNT"
| "DELAY_UNIT"
| "DELAY_TYPE"
| "DELAY_CRON"
| "THROTTLE_TYPE"
| "THROTTLE_WINDOW"
| "THROTTLE_UNIT"
| "THROTTLE_DYNAMIC_KEY"
| "THROTTLE_THRESHOLD"
| "THROTTLE_KEY"
| "EXTEND_TO_SCHEDULE"
| "SMS_BODY"
| "CHAT_BODY"
| "PUSH_BODY"
| "PUSH_SUBJECT"
| "QUERY_EDITOR"
| "DATA"
| "LAYOUT_EMAIL";
/**
* Properties of the UI Schema
*/
properties?: {
[k: string]: UiSchemaProperty1;
};
}
export interface UiSchemaProperty1 {
/**
* Placeholder for the UI Schema Property
*/
placeholder?:
| string
| number
| boolean
| {
[k: string]: unknown;
}
| (
| string
| number
| boolean
| {
[k: string]: unknown;
}
)[];
/**
* Component type for the UI Schema Property
*/
component:
| "EMAIL_EDITOR_SELECT"
| "LAYOUT_SELECT"
| "BLOCK_EDITOR"
| "EMAIL_BODY"
| "TEXT_FULL_LINE"
| "TEXT_INLINE_LABEL"
| "IN_APP_BODY"
| "IN_APP_AVATAR"
| "IN_APP_PRIMARY_SUBJECT"
| "IN_APP_BUTTON_DROPDOWN"
| "IN_APP_DISABLE_SANITIZATION_SWITCH"
| "DISABLE_SANITIZATION_SWITCH"
| "URL_TEXT_BOX"
| "DIGEST_AMOUNT"
| "DIGEST_UNIT"
| "DIGEST_TYPE"
| "DIGEST_KEY"
| "DIGEST_CRON"
| "DELAY_AMOUNT"
| "DELAY_UNIT"
| "DELAY_TYPE"
| "DELAY_CRON"
| "THROTTLE_TYPE"
| "THROTTLE_WINDOW"
| "THROTTLE_UNIT"
| "THROTTLE_DYNAMIC_KEY"
| "THROTTLE_THRESHOLD"
| "THROTTLE_KEY"
| "EXTEND_TO_SCHEDULE"
| "SMS_BODY"
| "CHAT_BODY"
| "PUSH_BODY"
| "PUSH_SUBJECT"
| "QUERY_EDITOR"
| "DATA"
| "LAYOUT_EMAIL";
/**
* Properties of the UI Schema
*/
properties?: {
[k: string]: UiSchemaProperty1;
};
}
export interface LayoutControlValuesDto {
/**
* Email layout controls
*/
email?: EmailControlsDto;
}
export interface EmailControlsDto {
/**
* Body of the layout.
*/
body: string;
/**
* Editor type of the layout.
*/
editorType: "html" | "block";
}
curl -X GET "https://api.novu.co/v2/layouts?limit=0&offset=0&orderDirection=ASC&orderBy=createdAt&query=string" \
-H "idempotency-key: string" \
-H "Authorization: <token>"
{
"layouts": [
{
"_id": "string",
"layoutId": "string",
"slug": "string",
"name": "string",
"isDefault": true,
"isTranslationEnabled": true,
"updatedAt": "string",
"updatedBy": {
"_id": "string",
"firstName": "string",
"lastName": "string",
"externalId": "string"
},
"createdAt": "string",
"origin": "novu-cloud",
"type": "REGULAR",
"variables": {},
"controls": {
"dataSchema": {},
"uiSchema": {
"group": "IN_APP",
"properties": {
"property1": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {
"property1": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {}
},
"property2": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {}
}
}
},
"property2": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {
"property1": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {}
},
"property2": {
"placeholder": "string",
"component": "EMAIL_EDITOR_SELECT",
"properties": {}
}
}
}
}
},
"values": {
"email": {
"body": "string",
"editorType": "html"
}
}
}
}
],
"totalCount": 0
}