> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.goautolane.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.goautolane.com/_mcp/server.

# Update webhook configuration

PUT https://api.goautolane.com/dd/v1/webhooks
Content-Type: application/json

Update the URL, subscribed events, or rotate the signing secret. Any update re-enables a disabled webhook and resets the failure counter. At least one field must be provided.

Reference: https://docs.goautolane.com/direct-delivery/api-reference/webhooks/update

## Authentication

- `Authorization` header (bearer token, required) — Autolane Platform API key. Org-scoped with granular permissions. Deliveries endpoints additionally require an `x-retailer-id` header containing the site UUID from the Autolane Portal; webhooks endpoints do not.

## Request

### Body (application/json)

This endpoint expects a WebhookUpdateRequest.

- `url` (string, optional) — Updated HTTPS webhook URL.
- `events` (list of enum, optional) — Updated event subscriptions.
  - Allowed values: `pickup_status.changed`, `tracking_link.created`, `pickup.vehicle_location.changed`
- `rotate_secret` (boolean, optional) — Set to `true` to generate a new signing secret. The new secret is returned in the response.

## Response

### 200

Updated webhook. If secret was rotated, the new secret is returned in full.

- `success` (boolean, required)
- `data` (WebhookResponse, required)

## Errors

### 400 Bad Request Error

Validation error or no fields provided

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 401 Unauthorized Error

Invalid or missing API key

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 403 Forbidden Error

Missing permission, wrong-environment key, unmapped organization, or organization type not permitted

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 404 Not Found Error

No webhook registered

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 500 Internal Server Error

Internal server error

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

## Types

### WebhookResponse

- `id` (double, required) — Webhook endpoint ID
- `url` (string, required) — Webhook URL
- `events` (list of enum, required) — Subscribed events
  - Allowed values: `pickup_status.changed`, `tracking_link.created`, `pickup.vehicle_location.changed`
- `display_name` (string, required, nullable) — Optional human-readable label set via the portal. `null` for legacy endpoints registered before the field was introduced (2026-05-26).
- `secret` (string, required) — Signing secret. Shown in full only on creation and secret rotation. Masked as `alwh_****...` otherwise.
- `is_active` (boolean, required) — Whether the webhook is active
- `consecutive_failures` (double, required) — Number of consecutive delivery failures
- `last_delivered_at` (datetime, required, nullable) — Last successful delivery timestamp
- `created_at` (datetime, required) — When the webhook was registered
- `updated_at` (datetime, required) — Last updated timestamp

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "success": true,
  "data": {
    "id": 1,
    "url": "https://retailer.com/webhooks/autolane",
    "events": [
      "pickup_status.changed"
    ],
    "display_name": "Production hook",
    "secret": "alwh_****...",
    "is_active": true,
    "consecutive_failures": 0,
    "last_delivered_at": "2026-04-10T12:00:00Z",
    "created_at": "2026-04-10T10:00:00Z",
    "updated_at": "2026-04-10T10:00:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.goautolane.com/dd/v1/webhooks"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.goautolane.com/dd/v1/webhooks';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.goautolane.com/dd/v1/webhooks"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.goautolane.com/dd/v1/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.goautolane.com/dd/v1/webhooks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.goautolane.com/dd/v1/webhooks', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.goautolane.com/dd/v1/webhooks");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.goautolane.com/dd/v1/webhooks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```