Update a context

Update the data of an existing context. type and id are required fields, data is required. Only the data field is updated, the rest of the context is not affected. If the context does not exist, it returns the 404 response

PATCH
/v2/contexts/{type}/{id}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
dataRequiredobject

Custom data to associate with this context. Replaces existing data.

Path Parameters

idRequiredstring

Context ID

typeRequiredstring

Context type

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

typeRequiredstring
idRequiredstring
dataRequiredobject
createdAtRequiredstring
updatedAtRequiredstring
export interface Response {
  type: string;
  id: string;
  data: {};
  createdAt: string;
  updatedAt: string;
}
 
curl -X PATCH "https://api.novu.co/v2/contexts/string/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "tenantName": "Acme Corp",
      "region": "us-east-1",
      "settings": {
        "theme": "dark"
      }
    }
  }'
{
  "type": "string",
  "id": "string",
  "data": {},
  "createdAt": "string",
  "updatedAt": "string"
}

On this page

No Headings
Edit this page on GitHub