# Update Subscription

This endpoint updates an existing webhook subscription. You can change the url, the subscribed events, or the status (enabled/disabled).

The request body requires an UpdateSubscriptionRequest object. It returns a 202 Accepted response with the updated Subscription object.

Endpoint: PATCH /api/v1/subscriptions/{subscription_id}/
Version: Version: aec57205
Security: CodeBearer

## Path parameters:

  - `subscription_id` (string, required)

## Request fields (application/json):

  - `description` (any)
    A description of the webhook's intended use.

  - `events` (any)

  - `url` (any)
    The webhook URL to invoke.

  - `shared_secret` (any)
    The shared secret used by the Partner API to sign requests made to the webhook. The shared secret needs to be minimum 16 characters long.

  - `retry_policy` (any)
    - `retry_on_status_codes` (array, required)
      Denotes on which status codes Jiko will retry the webhook call, e.g. 502 or 503.
    - `backoff_coefficient` (number, required)
    - `maximum_attempts` (integer, required)
    - `initial_interval_seconds` (number, required)
    - `maximum_interval_seconds` (number, required)

  - `status` (any)

## Response 202 fields (application/json):

  - `description` (string)
    A description of the webhook's intended use.

  - `events` (array, required)
    Which types of events this webhook should be invoked for.

  - `url` (string, required)
    The webhook URL to invoke.

  - `retry_policy` (any)
    The retry policy to use if Jiko encounters HTTP errors when calling subscription URLs.
    - `retry_on_status_codes` (array, required)
      Denotes on which status codes Jiko will retry the webhook call, e.g. 502 or 503.
    - `backoff_coefficient` (number, required)
    - `maximum_attempts` (integer, required)
    - `initial_interval_seconds` (number, required)
    - `maximum_interval_seconds` (number, required)

  - `id` (string, required)

  - `time_created` (string, required)

  - `updated_at` (string, required)

  - `status` (string, required)
    Enum: "enabled", "disabled"

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array, required)

  - `detail.msg` (string, required)

  - `detail.type` (string, required)

  - `detail.input` (any)

  - `detail.ctx` (object)


