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

# Toggle shareable flag on an agent

PATCH https://api.voicebip.com/v1/agents/{agent_id}/shareable
Content-Type: application/json

Enable or disable the "try my agent" shareable link for an agent.
When shareable is true, anyone can test-call the agent from a browser
via the public WebRTC endpoint without signing up.
Rate limited to 10 concurrent calls and 50 calls/day per agent.

Reference: https://docs.voicebip.com/api/agents/toggle-agent-shareable

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.voicebip.com` (Production, default)
- `https://sandbox.voicebip.com` (Sandbox)

## Request

### Path parameters

- `agent_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `shareable` (boolean, required) — Set to true to enable the shareable link, false to disable

## Response

### 200

Shareable flag updated

- `agent_id` (string, optional)
- `workspace_id` (string, optional)
- `display_name` (string, optional)
- `description` (string, optional)
- `language` (string, optional)
- `ai_provider` (string, optional)
- `ai_model` (string, optional)
- `tts_voice` (string, optional) — The voice the agent speaks with. This is a `voice_id` from `GET /v1/voice/models` (e.g. `aura-asteria-en`). Null/absent means the platform-default voice.
- `system_prompt` (string, optional)
- `webhook_url` (string, optional)
- `greeting_text` (string, optional) — Custom greeting played via TTS when a call connects. If null, a default greeting is used.
- `greeting_audio_url` (string, optional) — The source URL of a hosted WAV played as the greeting instead of greeting_text. Set via UpdateAgent; validated and stored at save time. The system-managed storage key is never returned.
- `tool_definitions` (string, optional, default: []) — JSON array of OpenAI-compatible function/tool definitions. The AI can invoke these tools during voice calls. Built-in tools: hang_up, transfer_call, hold_call, resume_call. Custom tools are dispatched to the agent's webhook_url. Defaults to "[]".
- `shareable` (boolean, optional) — When true, enables a public 'try my agent' link for browser-based test calls.
- `knowledge_base_id` (string, optional) — Attached knowledge base (RAG). When set, hosted-AI turns answer from this KB's documents. Empty/absent = none.
- `call_window_start` (string, optional, default: 08:00) — Earliest permitted outbound call time (HH:MM, 24hr). CBN compliance.
- `call_window_end` (string, optional, default: 20:00) — Latest permitted outbound call time (HH:MM, 24hr). CBN compliance.
- `call_window_timezone` (string, optional, default: Africa/Lagos) — IANA timezone for call window evaluation.
- `pre_call_announcement` (string, optional) — CBN requirement: spoken announcement at start of call identifying the sponsoring institution.
- `recording_enabled` (boolean, optional) — Whether call recording is enabled for this agent. Workspace-level recording must also be enabled via POST /v1/workspace/recording for calls to be recorded.
- `consent_required` (boolean, optional) — When true (default), the caller hears a consent prompt before recording starts. When false, recording begins immediately. Only disable if you have an independent legal basis under NDPR.
- `screening_enabled` (boolean, optional) — BYOM only. When true, inbound calls trigger a synchronous `call.screening` webhook (to the agent's `webhook_url`) BEFORE the greeting so you can allow/reject the caller and optionally override the greeting. See the [BYOM guide](/guides/byom).
- `screening_fail_closed` (boolean, optional) — Screening failure policy. false (default) = fail-open (allow the call if the screening webhook errors/times out); true = fail-closed (reject).
- `status` (enum, optional)
  - Allowed values: `active`, `suspended`
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

## Errors

### 400 Toggle Agent Shareable Request Bad Request Error

Bad request

- `error_code` (enum, required)
  - Allowed values: `NOT_FOUND`, `ALREADY_EXISTS`, `INVALID_ARGUMENT`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RATE_LIMITED`, `INTERNAL`, `UNAVAILABLE`, `QUOTA_EXCEEDED`, `NUMBER_UNAVAILABLE`, `CALL_FAILED`, `MESSAGE_FAILED`, `WEBHOOK_FAILED`, `AI_PROVIDER_ERROR`, `CALL_WINDOW_RESTRICTED`, `INVALID_REQUEST`, `INVALID_PLAN`, `NO_OP`, `NO_ACTIVE_SUBSCRIPTION`, `WORKSPACE_NOT_FOUND`, `TIER_SWITCH_UNSUPPORTED`, `INSUFFICIENT_BALANCE`, `WORKSPACE_BLOCKED`, `TIER_SWITCH_TOO_FREQUENT`, `CHANNEL_MISMATCH`, `OPT_OUT_ENFORCED`, `UPSTREAM_ERROR`, `REQUEST_BODY_TOO_LARGE`, `INVALID_BODY`, `AI_ERROR`, `ADMIN_DISABLED`, `STORE_UNAVAILABLE`, `ADMIN_DB_UNAVAILABLE`, `MISSING_ACTOR`, `ACTOR_TOO_LONG`, `MISSING_FIELD`, `INVALID_JSON`, `INVALID_AMOUNT`, `INVALID_INCLUDED_QTY`, `INVALID_CURRENCY`, `INVALID_PROFILE`, `INVALID_RESOURCE`, `INVALID_UNIT`, `INVALID_TIER`, `INVALID_EFFECTIVE_FROM`, `NOTES_TOO_LONG`, `INVALID_LIMIT`, `LIST_FAILED`, `UPSERT_FAILED`, `WORKSPACE_OVERRIDE_DISABLED`, `WORKSPACE_OVERRIDE_UNCONFIRMED`, `MISSING_WORKSPACE_HEADER`, `INVALID_PASSWORD`, `INVALID_EMAIL`, `INVALID_CREDENTIALS`, `EMAIL_EXISTS`, `EMAIL_NOT_VERIFIED`, `WEAK_PASSWORD`, `MISSING_COMPANY`, `MISSING_TOKEN`, `INVALID_TOKEN`, `TOO_MANY_ATTEMPTS`
- `message` (string, required)
- `request_id` (string, required)
- `documentation_url` (string, optional)

### 404 Toggle Agent Shareable Request Not Found Error

Not found

- `error_code` (enum, required)
  - Allowed values: `NOT_FOUND`, `ALREADY_EXISTS`, `INVALID_ARGUMENT`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RATE_LIMITED`, `INTERNAL`, `UNAVAILABLE`, `QUOTA_EXCEEDED`, `NUMBER_UNAVAILABLE`, `CALL_FAILED`, `MESSAGE_FAILED`, `WEBHOOK_FAILED`, `AI_PROVIDER_ERROR`, `CALL_WINDOW_RESTRICTED`, `INVALID_REQUEST`, `INVALID_PLAN`, `NO_OP`, `NO_ACTIVE_SUBSCRIPTION`, `WORKSPACE_NOT_FOUND`, `TIER_SWITCH_UNSUPPORTED`, `INSUFFICIENT_BALANCE`, `WORKSPACE_BLOCKED`, `TIER_SWITCH_TOO_FREQUENT`, `CHANNEL_MISMATCH`, `OPT_OUT_ENFORCED`, `UPSTREAM_ERROR`, `REQUEST_BODY_TOO_LARGE`, `INVALID_BODY`, `AI_ERROR`, `ADMIN_DISABLED`, `STORE_UNAVAILABLE`, `ADMIN_DB_UNAVAILABLE`, `MISSING_ACTOR`, `ACTOR_TOO_LONG`, `MISSING_FIELD`, `INVALID_JSON`, `INVALID_AMOUNT`, `INVALID_INCLUDED_QTY`, `INVALID_CURRENCY`, `INVALID_PROFILE`, `INVALID_RESOURCE`, `INVALID_UNIT`, `INVALID_TIER`, `INVALID_EFFECTIVE_FROM`, `NOTES_TOO_LONG`, `INVALID_LIMIT`, `LIST_FAILED`, `UPSERT_FAILED`, `WORKSPACE_OVERRIDE_DISABLED`, `WORKSPACE_OVERRIDE_UNCONFIRMED`, `MISSING_WORKSPACE_HEADER`, `INVALID_PASSWORD`, `INVALID_EMAIL`, `INVALID_CREDENTIALS`, `EMAIL_EXISTS`, `EMAIL_NOT_VERIFIED`, `WEAK_PASSWORD`, `MISSING_COMPANY`, `MISSING_TOKEN`, `INVALID_TOKEN`, `TOO_MANY_ATTEMPTS`
- `message` (string, required)
- `request_id` (string, required)
- `documentation_url` (string, optional)

## Examples

**Request**

```json
{
  "shareable": true
}
```

**Response**

```json
{
  "agent_id": "agent_id",
  "workspace_id": "workspace_id",
  "display_name": "display_name",
  "description": "description",
  "language": "language",
  "ai_provider": "ai_provider",
  "ai_model": "ai_model",
  "tts_voice": "tts_voice",
  "system_prompt": "system_prompt",
  "webhook_url": "webhook_url",
  "greeting_text": "greeting_text",
  "greeting_audio_url": "greeting_audio_url",
  "tool_definitions": "[{\"type\":\"function\",\"function\":{\"name\":\"hang_up\",\"description\":\"End the call gracefully\",\"parameters\":{\"type\":\"object\",\"properties\":{},\"required\":[]}}}]",
  "shareable": true,
  "knowledge_base_id": "knowledge_base_id",
  "call_window_start": "08:00",
  "call_window_end": "20:00",
  "call_window_timezone": "Africa/Lagos",
  "pre_call_announcement": "pre_call_announcement",
  "recording_enabled": true,
  "consent_required": true,
  "screening_enabled": true,
  "screening_fail_closed": true,
  "status": "active",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.voicebip.com/v1/agents/agent_id/shareable"

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

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

print(response.json())
```

```javascript
const url = 'https://api.voicebip.com/v1/agents/agent_id/shareable';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"shareable":true}'
};

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.voicebip.com/v1/agents/agent_id/shareable"

	payload := strings.NewReader("{\n  \"shareable\": true\n}")

	req, _ := http.NewRequest("PATCH", 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.voicebip.com/v1/agents/agent_id/shareable")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"shareable\": true\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.patch("https://api.voicebip.com/v1/agents/agent_id/shareable")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"shareable\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.voicebip.com/v1/agents/agent_id/shareable', [
  'body' => '{
  "shareable": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.voicebip.com/v1/agents/agent_id/shareable");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"shareable\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voicebip.com/v1/agents/agent_id/shareable")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```