> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Invia evento webhook di test

POST https://api.elevenlabs.io/v1/workspace/webhooks/{webhook_id}/test
Content-Type: application/json

Invia una sola volta al webhook un evento di esempio del tipo specificato e restituisce il codice di stato dell'endpoint, il tempo di risposta, il tipo di contenuto e la dimensione della risposta. Gli eventi di test sono firmati come quelli reali, non vengono mai ritentati e condividono con le riconsegne un limite di 10 per webhook al minuto.

Reference: https://elevenlabs.io/docs/api-reference/webhooks/test

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `webhook_id` (string, required) — L'ID del webhook.

### Body (application/json)

This endpoint expects a Body_Send_test_webhook_event_v1_workspace_webhooks__webhook_id__test_post.

- `webhook_type` (enum, required) — Il tipo di evento di cui inviare un esempio.
  - Allowed values: `project_conversion_status`, `chapter_conversion_status`, `post_call_transcription`, `post_call_transcription_otel`, `post_call_audio`, `post_call_unredacted_transcription`, `post_call_unredacted_transcription_otel`, `post_call_unredacted_audio`, `post_call_analysis`, `call_initiation_failure`, `conversation_initiation_client_data`, `answering_machine_detection`, `voice_removal_notice`, `voice_removal_notice_withdrawn`, `voice_removed`, `speech_to_text_transcription`, `webhook_error`, `speech_to_text_batch`, `agent_qa_evaluation_completed`, `convai_alerting_notification`, `flows_generation`, `flows_template_run`, `dubbing_project_ready`, `dubbing_project_failed`, `dubbing_language_completed`, `dubbing_language_failed`, `support_ticket_message_added`

## Response

### 200

Risposta riuscita

- `delivery_id` (string, required) — L'ID di consegna, inviato anche nell'header ElevenLabs-Webhook-Delivery-Id.
- `outcome` (enum, required) — Ciò che è accaduto a questo tentativo.
  - Allowed values: `delivered`, `failed_retry_scheduled`, `failed_exhausted`, `failed_no_retry`, `failed_retry_error`, `dropped_queue_full`, `dropped_payload_too_large`, `skipped_disabled`, `not_sent_configuration`
- `response_code` (integer, required, nullable) — Lo stato HTTP restituito dal tuo endpoint, se ha risposto.
- `latency_ms` (integer, required, nullable) — Tempo impiegato dal tuo endpoint per rispondere, in millisecondi.
- `response_content_type` (string, required, nullable) — Il Content-Type con cui ha risposto il tuo endpoint, se ha risposto.
- `response_body_bytes` (integer, required, nullable) — La dimensione in byte del body della risposta del tuo endpoint, se ha risposto. Il body stesso non viene mai archiviato né restituito.
- `failure_origin` (string, required, nullable) — Origine dell'errore: recipient, configuration, external_transport o timeout.

## Errors

### 422 Unprocessable Entity Error

Errore di convalida

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "webhook_type": "project_conversion_status"
}
```

**Response**

```json
{
  "delivery_id": "string",
  "outcome": "delivered",
  "response_code": 1,
  "latency_ms": 1,
  "response_content_type": "string",
  "response_body_bytes": 1,
  "failure_origin": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test"

payload = { "webhook_type": "project_conversion_status" }
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"webhook_type":"project_conversion_status"}'
};

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.elevenlabs.io/v1/workspace/webhooks/webhook_id/test"

	payload := strings.NewReader("{\n  \"webhook_type\": \"project_conversion_status\"\n}")

	req, _ := http.NewRequest("POST", 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.elevenlabs.io/v1/workspace/webhooks/webhook_id/test")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"webhook_type\": \"project_conversion_status\"\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.post("https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test")
  .header("Content-Type", "application/json")
  .body("{\n  \"webhook_type\": \"project_conversion_status\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test', [
  'body' => '{
  "webhook_type": "project_conversion_status"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"webhook_type\": \"project_conversion_status\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["webhook_type": "project_conversion_status"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/workspace/webhooks/webhook_id/test")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```