Skip to main content
PUT
/
v2
/
layouts
/
{layoutId}
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();

$updateLayoutDto = new Components\UpdateLayoutDto(
    name: '<value>',
);

$response = $sdk->layouts->update(
    layoutId: '<id>',
    updateLayoutDto: $updateLayoutDto

);

if ($response->layoutResponseDto !== null) {
    // handle response
}
{
  "_id": "<string>",
  "layoutId": "<string>",
  "slug": "<string>",
  "name": "<string>",
  "isDefault": true,
  "isTranslationEnabled": true,
  "updatedAt": "<string>",
  "createdAt": "<string>",
  "controls": {
    "values": {
      "email": {
        "body": "<string>"
      }
    },
    "dataSchema": {},
    "uiSchema": {
      "properties": {}
    }
  },
  "updatedBy": {
    "_id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "externalId": "<string>"
  },
  "variables": {}
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

layoutId
string
required

Body

application/json

Layout update details

name
string
required

Name of the layout

isTranslationEnabled
boolean
default:false

Enable or disable translations for this layout

controlValues
object

Control values for the layout. Omit to leave unchanged, or set to null to clear stored control values.

Response

OK

_id
string
required

Unique internal identifier of the layout

layoutId
string
required

Unique identifier for the layout

slug
string
required

Slug of the layout

name
string
required

Name of the layout

isDefault
boolean
required

Whether the layout is the default layout

isTranslationEnabled
boolean
required

Whether the layout translations are enabled

updatedAt
string
required

Last updated timestamp

createdAt
string
required

Creation timestamp

origin
enum<string>
required

Origin of the layout

Available options:
novu-cloud,
novu-cloud-v1,
external
type
enum<string>
required

Type of the layout

Available options:
REGULAR,
ECHO,
BRIDGE
controls
object
required

Controls metadata for the layout

updatedBy
object

User who last updated the layout

variables
object

The variables JSON Schema for the layout