Retrieve a layout

Fetches details of a specific layout by its unique identifier layoutId

GET
/v2/layouts/{layoutId}

Authorization

Authorization<token>

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

In: header

Path Parameters

layoutIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_idRequiredstring

Unique internal identifier of the layout

layoutIdRequiredstring

Unique identifier for the layout

slugRequiredobject

Slug of the layout

nameRequiredstring

Name of the layout

isDefaultRequiredboolean

Whether the layout is the default layout

updatedAtRequiredstring

Last updated timestamp

updatedByobject

User who last updated the layout

createdAtRequiredstring

Creation timestamp

originRequiredstring

Origin of the layout

Value in: "novu-cloud" | "novu-cloud-v1" | "external"
typeRequiredstring

Type of the layout

Value in: "REGULAR" | "ECHO" | "BRIDGE"
variablesobject | null

The variables JSON Schema for the layout

controlsRequiredobject

Controls metadata for the layout

export interface Response {
  /**
   * Unique internal identifier of the layout
   */
  _id: string;
  /**
   * Unique identifier for the layout
   */
  layoutId: string;
  /**
   * Slug of the layout
   */
  slug: {};
  /**
   * Name of the layout
   */
  name: string;
  /**
   * Whether the layout is the default layout
   */
  isDefault: 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?: {} | 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" | "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_KEY"
    | "DIGEST_CRON"
    | "DELAY_TYPE"
    | "DELAY_AMOUNT"
    | "DELAY_UNIT"
    | "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_KEY"
    | "DIGEST_CRON"
    | "DELAY_TYPE"
    | "DELAY_AMOUNT"
    | "DELAY_UNIT"
    | "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/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "_id": "string",
  "layoutId": "string",
  "slug": {},
  "name": "string",
  "isDefault": true,
  "updatedAt": "string",
  "updatedBy": {
    "_id": "string",
    "firstName": "string",
    "lastName": {},
    "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"
      }
    }
  }
}

On this page

No Headings
Edit this page on GitHub