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

# Update Provider Priority Configuration

PUT https://api.etera.dev/restaurant/booking/providers/{restaurantId}/priority
Content-Type: application/json


        **🎯 Configure Provider Priority & Routing**

        Update the provider priority configuration for a restaurant. This controls which booking providers are used, in what order, and under what conditions.

        ## ⚙️ **Configuration Options**

        ### **Provider Priority**
        Set the order in which providers are attempted:
        1. **Primary Providers** (priority 1-3): First choice providers
        2. **Secondary Providers** (priority 4-6): Backup providers
        3. **Fallback Providers** (priority 7+): Emergency backup only

        ### **Conditional Routing**
        - **Time-Based**: Use different providers for lunch vs dinner
        - **Party Size**: Route large groups to specific providers
        - **Availability**: Switch providers based on current performance

        ### **Fallback Strategies**
        - **Priority**: Strict order based on priority numbers
        - **Round Robin**: Distribute load evenly across providers
        - **Least Busy**: Route to provider with best current performance

        ## 🎯 **Best Practices**

        - **Primary Provider**: Choose most reliable for main traffic
        - **VAPI AI Calling**: Use as fallback for restaurants without online booking
        - **Load Distribution**: Use round-robin for high-volume restaurants
        - **Time Slots**: Route dinner reservations to fastest providers

        ## 🔄 **Dynamic Adjustments**

        The system can automatically adjust priorities based on:
        - Provider performance metrics
        - Real-time availability
        - Cost optimization goals
        - Customer satisfaction scores
      

Reference: https://docs.etera.dev/restaurant/booking/restaurant-booking-api/providers/put-providers-by-restaurant-id-priority

## Servers

- `https://api.etera.dev/restaurant/booking` (Production, default)
- `https://api-stage.etera.dev/restaurant/booking` (Staging)
- `https://api-dev.etera.dev/restaurant/booking` (Development)

## Request

### Path parameters

- `restaurantId` (string, required) — Unique identifier for the restaurant

### Body (application/json)

This endpoint expects an object.

- `restaurantId` (string, required) — Restaurant identifier (must match path parameter)
- `providers` (list of ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaProvidersItems, required) — Provider priority configuration
- `defaultProvider` (ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaDefaultProvider, required) — Default provider to use
- `fallbackStrategy` (ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaFallbackStrategy, required) — Strategy for provider fallback

## Response

### 200

Provider priority configuration updated successfully

- `success` (boolean, optional)
- `message` (string, optional)
- `restaurantId` (string, optional)
- `updatedConfig` (ProvidersRestaurantIdPriorityPutResponsesContentApplicationJsonSchemaUpdatedConfig, optional) — The updated configuration
- `timestamp` (datetime, optional)

## Errors

### 400 Bad Request Error

Invalid configuration

- `success` (boolean, optional)
- `error` (string, optional)
- `details` (ProvidersRestaurantIdPriorityPutResponsesContentApplicationJsonSchemaDetails, optional)

## Types

### ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaProvidersItems

- `type` (ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaProvidersItemsType, required) — Provider type
- `priority` (double, required) — Provider priority (1 = highest)
- `enabled` (boolean, required) — Whether this provider is enabled
- `fallbackOnly` (boolean, optional, default: false) — Use only as fallback provider
- `timeSlots` (list of string, optional) — Specific time ranges this provider handles
- `maxPartySize` (double, optional) — Maximum party size this provider can handle

### ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaDefaultProvider

Default provider to use

- "opentable"
- "vapi"
- "tablecheck"

### ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaFallbackStrategy

Strategy for provider fallback

- "priority"
- "round_robin"
- "least_busy"

### ProvidersRestaurantIdPriorityPutResponsesContentApplicationJsonSchemaUpdatedConfig

The updated configuration

### ProvidersRestaurantIdPriorityPutResponsesContentApplicationJsonSchemaDetails

- `field` (string, optional)
- `message` (string, optional)

### ProvidersRestaurantIdPriorityPutRequestBodyContentApplicationJsonSchemaProvidersItemsType

Provider type

- "opentable"
- "vapi"
- "tablecheck"

## Examples

**Request**

```json
{
  "restaurantId": "rest_abc123",
  "providers": [
    {
      "type": "opentable",
      "priority": 1,
      "enabled": true
    }
  ],
  "defaultProvider": "vapi",
  "fallbackStrategy": "priority"
}
```

**Response**

```json
{
  "success": true,
  "message": "Provider priority configuration updated successfully",
  "restaurantId": "rest_abc123",
  "updatedConfig": {},
  "timestamp": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.etera.dev/restaurant/booking/providers/rest_abc123/priority"

payload = {
    "restaurantId": "rest_abc123",
    "providers": [
        {
            "type": "opentable",
            "priority": 1,
            "enabled": True
        }
    ],
    "defaultProvider": "vapi",
    "fallbackStrategy": "priority"
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.etera.dev/restaurant/booking/providers/rest_abc123/priority';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"restaurantId":"rest_abc123","providers":[{"type":"opentable","priority":1,"enabled":true}],"defaultProvider":"vapi","fallbackStrategy":"priority"}'
};

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.etera.dev/restaurant/booking/providers/rest_abc123/priority"

	payload := strings.NewReader("{\n  \"restaurantId\": \"rest_abc123\",\n  \"providers\": [\n    {\n      \"type\": \"opentable\",\n      \"priority\": 1,\n      \"enabled\": true\n    }\n  ],\n  \"defaultProvider\": \"vapi\",\n  \"fallbackStrategy\": \"priority\"\n}")

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

	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.etera.dev/restaurant/booking/providers/rest_abc123/priority")

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

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"restaurantId\": \"rest_abc123\",\n  \"providers\": [\n    {\n      \"type\": \"opentable\",\n      \"priority\": 1,\n      \"enabled\": true\n    }\n  ],\n  \"defaultProvider\": \"vapi\",\n  \"fallbackStrategy\": \"priority\"\n}"

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.etera.dev/restaurant/booking/providers/rest_abc123/priority")
  .header("Content-Type", "application/json")
  .body("{\n  \"restaurantId\": \"rest_abc123\",\n  \"providers\": [\n    {\n      \"type\": \"opentable\",\n      \"priority\": 1,\n      \"enabled\": true\n    }\n  ],\n  \"defaultProvider\": \"vapi\",\n  \"fallbackStrategy\": \"priority\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.etera.dev/restaurant/booking/providers/rest_abc123/priority', [
  'body' => '{
  "restaurantId": "rest_abc123",
  "providers": [
    {
      "type": "opentable",
      "priority": 1,
      "enabled": true
    }
  ],
  "defaultProvider": "vapi",
  "fallbackStrategy": "priority"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.etera.dev/restaurant/booking/providers/rest_abc123/priority");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"restaurantId\": \"rest_abc123\",\n  \"providers\": [\n    {\n      \"type\": \"opentable\",\n      \"priority\": 1,\n      \"enabled\": true\n    }\n  ],\n  \"defaultProvider\": \"vapi\",\n  \"fallbackStrategy\": \"priority\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "restaurantId": "rest_abc123",
  "providers": [
    [
      "type": "opentable",
      "priority": 1,
      "enabled": true
    ]
  ],
  "defaultProvider": "vapi",
  "fallbackStrategy": "priority"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/restaurant/booking/providers/rest_abc123/priority")! 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()
```