---
raw: true
search:
  tags:
    - Activity
    - PATCH
seo:
  description: >-
    Updates a webhook's URL, subscribed events, or status. Secrets rotate only…
    Reference for the PATCH /v1/webhooks/{webhookId} endpoint in the Spacefast
    API.
sidebar:
  label: Update a webhook
  badge: PATCH
title: Update a webhook
type: openapi-operation
---
Updates a webhook's URL, subscribed events, or status. Secrets rotate only via the rotate operation. A webhook declared in a system-space manifest is configured there, not here.

`PATCH /v1/webhooks/{webhookId}`

**Request body** (`application/json`, required)

- `url` (string<uri>)
- `events` (string[])
- `status` (string)

Request body example:

```json
{
  "url": "http://example.com",
  "events": [
    "string"
  ],
  "status": "active"
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "url": "http://example.com",
    "events": [
      "string"
    ],
    "status": "active",
    "secret": "string",
    "secretPreview": "string",
    "previousSecretExpiresAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
```
