Skip to main content
PATCH
/
v2
/
topics
/
{topicKey}
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();

$updateTopicRequestDto = new Components\UpdateTopicRequestDto(
    name: 'Updated Topic Name',
);

$response = $sdk->topics->update(
    topicKey: '<value>',
    updateTopicRequestDto: $updateTopicRequestDto

);

if ($response->topicResponseDto !== null) {
    // handle response
}
{
  "_id": "64da692e9a94fb2e6449ad06",
  "key": "product-updates",
  "name": "Product Updates",
  "createdAt": "2023-08-15T00:00:00.000Z",
  "updatedAt": "2023-08-15T00:00:00.000Z"
}

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

topicKey
string
required

The key identifier of the topic

Body

application/json
name
string
required

The display name for the topic

Example:

"Updated Topic Name"

Response

OK

_id
string
required

The identifier of the topic

Example:

"64da692e9a94fb2e6449ad06"

key
string
required

The unique key of the topic

Example:

"product-updates"

name
string

The name of the topic

Example:

"Product Updates"

createdAt
string

The date the topic was created

Example:

"2023-08-15T00:00:00.000Z"

updatedAt
string

The date the topic was last updated

Example:

"2023-08-15T00:00:00.000Z"