> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hookstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update endpoint

Update an endpoint's URL, description, status, filter types, rate limit, or expiry.

` PATCH /applications/{appId}/endpoints/{id} `

Update endpoint

Update an endpoint's URL, description, status, filter types, rate limit, or expiry.

## Servers

- ` https://hookstream.io/v1 ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` apiKey `: ` apiKey `

  - Credential: ` X-API-Key ` in ` header `

  - API key (format: hs_live_<64hex> or hs_test_<64hex>)

### Alternative 2

- ` cookieAuth `: ` apiKey `

  - Credential: ` better-auth.session_token ` in ` cookie `

  - Session cookie (browser auth)

## Parameters

### ` appId ` (path, required)

Application ID

- ` value `: type ` string ` — Application ID

  - minLength: ` 1 `

### ` id ` (path, required)

Resource ID

- ` value `: type ` string ` — Resource ID

  - minLength: ` 1 `

## Request body (required)

Content type: ` application/json `

Request body

- ` value `: type ` object `

  - ` url `: type ` string ` — Updated URL

  - ` description `: type ` string ` — Updated description

  - ` status `: type ` string ` — Status: active or disabled

  - ` filter_types `: type ` array `; nullable — Updated filter types

    - ` array item `: type ` string `

  - ` rate_limit_per_second `: type ` number `; nullable — Updated rate limit

  - ` expires_at `: type ` string `; nullable — Updated expiry

## Responses

### ` 200 ` — Updated endpoint

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` endpoint `

  - ` endpoint `: type ` object `

    - Required fields: ` id `, ` org_id `, ` env_id `, ` application_id `, ` url `, ` description `, ` signing_algorithm `, ` status `, ` filter_types `, ` rate_limit_per_second `, ` expires_at `, ` created_at `, ` updated_at `

    - ` id `: type ` string `

    - ` org_id `: type ` string `

    - ` env_id `: type ` string `

    - ` application_id `: type ` string `

    - ` url `: type ` string `

    - ` description `: type ` string `; nullable

    - ` signing_algorithm `: type ` string `

    - ` status `: type ` string `

    - ` filter_types `: type ` string `; nullable

    - ` rate_limit_per_second `: type ` integer `; nullable

    - ` expires_at `: type ` string `; nullable

    - ` created_at `: type ` string `

    - ` updated_at `: type ` string `

### ` 400 ` — No fields to update

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string ` — Error message

### ` 401 ` — Unauthorized

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string ` — Error message

## Request examples

### cURL

```curl
curl -X PATCH 'https://hookstream.io/v1/applications/string/endpoints/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "string",
  "description": "string",
  "status": "string",
  "filter_types": [
    "string"
  ],
  "rate_limit_per_second": 0,
  "expires_at": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://hookstream.io/v1/applications/string/endpoints/string', {
  method: 'PATCH',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "url": "string",
    "description": "string",
    "status": "string",
    "filter_types": [
      "string"
    ],
    "rate_limit_per_second": 0,
    "expires_at": "string"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.patch('https://hookstream.io/v1/applications/string/endpoints/string', headers=headers, json={
  "url": "string",
  "description": "string",
  "status": "string",
  "filter_types": [
    "string"
  ],
  "rate_limit_per_second": 0,
  "expires_at": "string"
})
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "url": "string",
  "description": "string",
  "status": "string",
  "filter_types": [
    "string"
  ],
  "rate_limit_per_second": 0,
  "expires_at": "string"
}`)
	req, _ := http.NewRequest("PATCH", "https://hookstream.io/v1/applications/string/endpoints/string", body)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
	req.Header.Set("Content-Type", "application/json")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
```