Update topic by key

PATCH
/v2/topics/{topicKey}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
nameRequiredstring

The display name for the topic

Path Parameters

topicKeyRequiredstring

The key identifier of the topic

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_idRequiredstring

The identifier of the topic

keyRequiredstring

The unique key of the topic

namestring

The name of the topic

createdAtstring

The date the topic was created

updatedAtstring

The date the topic was last updated

export interface Response {
  /**
   * The identifier of the topic
   */
  _id: string;
  /**
   * The unique key of the topic
   */
  key: string;
  /**
   * The name of the topic
   */
  name?: string;
  /**
   * The date the topic was created
   */
  createdAt?: string;
  /**
   * The date the topic was last updated
   */
  updatedAt?: string;
}
 
curl -X PATCH "https://api.novu.co/v2/topics/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Topic Name"
  }'
{
  "_id": "64da692e9a94fb2e6449ad06",
  "key": "product-updates",
  "name": "Product Updates",
  "createdAt": "2023-08-15T00:00:00.000Z",
  "updatedAt": "2023-08-15T00:00:00.000Z"
}