---
title: "Partially update event subscription"
method: PATCH
path: "/event-subscriptions/{subscriptionId}"
tags: ["eventSubscriptions"]
---

# Partially update event subscription

`PATCH /event-subscriptions/{subscriptionId}`

Use this method to partially update an event subscription. Structure your request to follow the [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) standard.  

To update an event subscription, you need its subscriptionId. Our gateway returned the subscriptionId in the id field in the response of the [Create Event Subscription](https://docs.payroc.com/api/schema/notifications/event-subscriptions/create) method.  

**Note:** If you don't have the subscriptionId, use our [List Event Subscriptions](https://docs.payroc.com/api/schema/notifications/event-subscriptions/list) method to search for the subscription.  

You can update the following properties of an event subscription:  
- **eventTypes** - Subscribe to new events or remove events that you are subscribed to.  
- **notifications** - Information about your endpoint and who we email if we can't contact your endpoint.  
- **enabled** - Turn on or turn off notifications for the subscription.

## Path parameters

- `subscriptionId` integer, required

## Headers

- `Authorization` string, required
- `Idempotency-Key` string, uuid, required

## Request body

- PatchDocument[] — A JSON Patch document as defined by RFC 6902.
  - union — A JSON Patch operation as defined by RFC 6902.
    - object — A Patch Add Operation.
      - `op` 'add', required — Discriminator value: add
      - `path` string, required — Location where you want to add the value. The format for this value is JSON Pointer.
      - `value` unknown, required
    - object — A Patch Remove Operation.
      - `op` 'remove', required — Discriminator value: remove
      - `path` string, required — Location of the value that you want to remove. The format for this value is JSON Pointer.
    - object — A Patch Replace Operation.
      - `op` 'replace', required — Discriminator value: replace
      - `path` string, required — Location of the value that you want to replace. The format for this value is JSON Pointer.
      - `value` unknown, required
    - object — A Patch Move Operation.
      - `op` 'move', required — Discriminator value: move
      - `from` string, required — Location of the value that you want to move. The format for this value is JSON Pointer.
      - `path` string, required — Location where you want to move the value to. The format for this value is JSON Pointer.
    - object — A Patch Copy Operation.
      - `op` 'copy', required — Discriminator value: copy
      - `from` string, required — Location of the value that you want to copy. The format for this value is JSON Pointer.
      - `path` string, required — Location where you want to copy the value to. The format for this value is JSON Pointer.
    - object — A Patch Test Operation.
      - `op` 'test', required — Discriminator value: test
      - `path` string, required — Location of the value that you want to test. The format for this value is JSON Pointer.
      - `value` unknown, required

## Response `200`

Successful request. We updated the event subscription.

- EventSubscription
  - `id` integer — Unique identifier that we assigned to the event subscription.
  - `enabled` boolean, required — Indicates if we should notify you when the event occurs. The value is one of the following: - `true` - We notify you when the event occurs. - `false` - We don't notify you when the event occurs.
  - `status` 'registered' | 'suspended' | 'failed' — Status of the subscription. We return one of the following values: - `registered` - You have set up the subscription, and we will notify you when an event occurs. - `suspended` - We have deactivated the event subscription, and we won't notify you when an event occurs. - `failed` - We couldn't contact your URI endpoint. We email the supportEmailAddress.
  - `eventTypes` string[], required — Array of events that you want to subscribe to. For a list of events, go to [Events List](https://docs.payroc.com/knowledge/events/events-list).
  - `notifications` Notification[], required — Array of polymorphic notification objects that contain information about how we contact you when an event occurs.
    - `type` 'webhook', required — Discriminator value: webhook
    - `uri` string, required — Public endpoint that we send notifications to.
    - `secret` string, required — String that we send with a notification so that you can ensure it is a valid notification from our gateway. We include the value in the Payroc-Secret header parameter in the webhook call. **Note:** In the response, we truncate the secret to the last 16 characters and mask the first 10 characters.
    - `supportEmailAddress` string, required — Email address of the person or team that we contact if we can't deliver notifications.
  - `metadata` EventSubscriptionMetadata — Object that you can send to include custom data in the request. For more information about how to use metadata, go to [Metadata](https://docs.payroc.com/api/metadata).

## Other responses

- `400` — Validation error
- `401` — Identity could not be verified
- `404` — Resource not found
- `406` — Not acceptable
- `409` — Conflict
- `500` — An error has occured

---

[API](https://skmtc.dev/payroc/apis/schema.md) · [All operations](https://skmtc.dev/payroc/apis/schema/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/payroc/schema/revisions/1d9d3e305945/schema)
