# Update an endpoint (/docs/api-reference/hooks-endpoints/update-hook-endpoint)

Changes the URL, description, filter types, rate limit, metadata or `enabled`. Enabling it again clears a failure streak. The secret stays the same (see roll secret).

`PATCH https://api.coss.com/v1/hooks/applications/{application}/endpoints/{endpoint_id}`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Path parameters

- `application` (string, required): The application's `id` (`happ_…`) or your `uid` for it.
- `endpoint_id` (string, required): The endpoint's id.

## Request body

- `url` (string, at most 2048 characters): Where deliveries are sent.
- `description` (string | null, at most 256 characters): Your note about it. `null` removes it.
- `filter_types` (string[], at most 250 items): Event types delivered to this endpoint (existing, unarchived ones). An empty array means every type, including ones added later.
- `rate_limit_per_second` (integer | null, 1-1000): At most this many requests per second to this endpoint.
- `metadata` (map of string): Your own key-value pairs (at most 16; keys up to 40 characters, values up to 500).
- `enabled` (boolean): `false` disables it with `disabled_reason: manual`; `true` enables it again and clears the reason.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.hooks.endpoints.update("customer_8812", "hep_01k7c8m4q2f3e9v6t5r1n0p8yz", {
  enabled: false,
});
```

HTTP:

```sh
curl -X PATCH "https://api.coss.com/v1/hooks/applications/customer_8812/endpoints/hep_01k7c8m4q2f3e9v6t5r1n0p8yz" \
  -H "Authorization: Bearer $COSS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": false
}'
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.hooks.endpoints.update(
    application="customer_8812",
    endpoint_id="hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    enabled=False,
)
```

Go:

```go
import (
	"context"

	coss "github.com/cosscom/coss-go"
	cossclient "github.com/cosscom/coss-go/client"
	hooks "github.com/cosscom/coss-go/hooks"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &hooks.UpdateHookEndpointRequest{
    Application: "customer_8812",
    EndpointID: "hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    Enabled: coss.Bool(
        false,
    ),
}
client.Hooks.Endpoints.Update(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.hooks.endpoints.update(
  application: "customer_8812",
  endpoint_id: "hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
  enabled: false
)
```

PHP:

```php
<?php

use Coss\Coss;
use Coss\Hooks\Endpoints\Requests\UpdateHookEndpointRequest;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->hooks->endpoints->update(
    'customer_8812',
    'hep_01k7c8m4q2f3e9v6t5r1n0p8yz',
    new UpdateHookEndpointRequest([
        'enabled' => false,
    ]),
);
```

Java:

```java
import com.coss.Coss;
import com.coss.resources.hooks.endpoints.requests.UpdateHookEndpointRequest;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.hooks().endpoints().update(
    "customer_8812",
    "hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    UpdateHookEndpointRequest
        .builder()
        .enabled(false)
        .build()
);
```

.NET:

```csharp
using Coss;
using Coss.Hooks;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.Hooks.Endpoints.UpdateAsync(
    new UpdateHookEndpointRequest
    {
        Application = "customer_8812",
        EndpointId = "hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
        Enabled = false,
    }
);
```

## Response 200

The endpoint.

- `object` ("hook_endpoint", required)
- `id` (string, required)
- `application_id` (string, required): The id of the application it belongs to.
- `url` (string, required): Where deliveries are sent.
- `description` (string | null, required): Your note about it. `null`: none.
- `filter_types` (string[], required): Only these event types are delivered. Empty: every type.
- `rate_limit_per_second` (integer | null, required): At most this many requests per second to this endpoint. `null`: no limit of its own.
- `enabled` (boolean, required): Whether new messages are delivered to it.
- `disabled_reason` ("manual" | "failing" | null, required): `manual`: disabled by you or its user. `failing`: its deliveries failed every attempt for five days, so coss.com disabled it. `null` while enabled.
- `disabled_at` (string | null, required, date-time): When it was disabled. `null`: it's enabled.
- `failing_since` (string | null, required, date-time): When its current run of failed deliveries began; cleared by the next success. `null` while healthy.
- `previous_secret_expires_at` (string | null, required, date-time): After a secret roll, requests are also signed with the previous secret until then.
- `metadata` (map of string, required): Your own key-value pairs.
- `created_at` (string, required, date-time)
- `updated_at` (string, required, date-time)

Example:

```json
{
  "object": "hook_endpoint",
  "id": "hep_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "application_id": "happ_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "url": "https://example.com/webhooks",
  "description": "Production",
  "filter_types": [
    "invoice.paid"
  ],
  "rate_limit_per_second": null,
  "enabled": true,
  "disabled_reason": null,
  "disabled_at": null,
  "failing_since": null,
  "previous_secret_expires_at": null,
  "metadata": {},
  "created_at": "2026-01-15T09:30:00.000Z",
  "updated_at": "2026-01-15T09:30:00.000Z"
}
```

## Errors

- `400`: The body is not valid JSON (`invalid_json`). Also when the `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `404`: No such application, or no endpoint with this id in it (`application_not_found`, `not_found`).
- `413`: The request body is larger than 5 MB (`payload_too_large`).
- `415`: The body is not sent as `application/json` (`unsupported_media_type`).
- `422`: The body failed validation (`validation_error`, `invalid_url`, `unknown_event_type`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).