Skip to main content
GET
/
v2
/
layouts
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Operations;

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

$request = new Operations\LayoutsControllerListRequest(
    limit: 10,
    offset: 0,
);

$response = $sdk->layouts->list(
    request: $request
);

if ($response->listLayoutResponseDto !== null) {
    // handle response
}
{
  "layouts": [
    {
      "_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": {}
    }
  ],
  "totalCount": 123
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Query Parameters

limit
number

Number of items to return per page

offset
number

Number of items to skip before starting to return results

orderDirection
enum<string>

Direction of sorting

Available options:
ASC,
DESC
orderBy
enum<string>

Field to sort the results by

Available options:
createdAt,
updatedAt,
name
query
string

Search query to filter layouts

Response

OK

layouts
object[]
required

List of layouts

totalCount
number
required

Total number of layouts