Create Webhook

<div style={{ border: "2px solid #1a1a1a", padding: "20px", backgroundColor: "#252e33", margin: "20px 0", borderRadius: "20px", color: "#cccccc" }} id="create-webhook">
    <h2 style={{ color: "#cccccc" }}>πŸ”” Add a Webhook</h2>
    <p style={{ color: "#cccccc" }}>
        Create a new webhook to receive notifications when transcriptions are complete.
    </p>
    <h3 style={{ color: "#cccccc" }}>Endpoint</h3>
    <p style={{ color: "#cccccc" }}><code>POST https://api.tor.app/developer/integrations/webhooks</code></p>
    <h3 style={{ color: "#cccccc" }}>POST Body Parameters</h3>
    <ul style={{ color: "#cccccc" }}>
        <li><strong>url</strong> (string, required): The web address where notifications are sent.</li>
        <li><strong>export_format</strong> (string, optional): Choose the transcript format: <code>Txt</code>, <code>Json</code>, or <code>Csv</code>. Default: <code>Txt</code>.</li>
        <li><strong>include_timestamps</strong> (boolean, optional): Set to <code>true</code> to add timestamps. Default: <code>false</code>.</li>
        <li><strong>include_speaker_names</strong> (boolean, optional): Set to <code>true</code> to include speaker names. Default: <code>false</code>.</li>
        <li><strong>merge_same_speaker_segments</strong> (boolean, optional): Set to <code>true</code> to combine parts by the same speaker. Default: <code>false</code>.</li>
        <li><strong>is_single_paragraph</strong> (boolean, optional): Set to <code>true</code> for one big paragraph. Default: <code>false</code>.</li>
        <li><strong>paragraph_size</strong> (integer, optional): Lines per paragraph (if not single paragraph). Suggested: 1, 2, 4, or 8. Default: 1.</li>
        <li><strong>folder_id</strong> (string, optional): Send notifications only for transcriptions in this folder. Default: none.</li>
    </ul>
    <h3 style={{ color: "#cccccc" }}>Responses</h3>
    <details>
        <summary style={{ borderLeft: "5px solid #28a745", padding: "10px", backgroundColor: "#d4edda", marginBottom: "10px", borderRadius: "5px" }}><strong>201 Created</strong></summary>
        <pre style={{ backgroundColor: "#1a1a1a", padding: "10px", borderRadius: "10px", color: "#cccccc" }}>
<code>{
    "message": "Webhook registered.",
    "webhookType": "wh 2025-05-02 12:34:56"
}</code>
        </pre>
    </details>
    <details>
        <summary style={{ borderLeft: "5px solid #dc3545", padding: "10px", backgroundColor: "#f8d7da", marginBottom: "10px", borderRadius: "5px" }}><strong>400 Bad Request</strong></summary>
        <pre style={{ backgroundColor: "#1a1a1a", padding: "10px", borderRadius: "10px", color: "#cccccc" }}>
<code>"Invalid or missing webhook URL."</code>
        </pre>
    </details>
    <details>
        <summary style={{ borderLeft: "5px solid #dc3545", padding: "10px", backgroundColor: "#f8d7da", marginBottom: "10px", borderRadius: "5px" }}><strong>409 Conflict</strong></summary>
        <pre style={{ backgroundColor: "#1a1a1a", padding: "10px", borderRadius: "10px", color: "#cccccc" }}>
<code>"Webhook already exists."</code>
        </pre>
    </details>
    <details>
        <summary style={{ borderLeft: "5px solid #dc3545", padding: "10px", backgroundColor: "#f8d7da", marginBottom: "10px", borderRadius: "5px" }}><strong>500 Internal Server Error</strong></summary>
        <pre style={{ backgroundColor: "#1a1a1a", padding: "10px", borderRadius: "10px", color: "#cccccc" }}>
<code>"Failed to register webhook."</code>
        </pre>
    </details>
    <h3 style={{ color: "#cccccc" }}>Notes</h3>
    <ul style={{ color: "#cccccc" }}>
        <li>Save the <code>webhookType</code> to manage the webhook later.</li>
        <li>Notifications sent to the <code>url</code> include details like file ID and name.</li>
    </ul>
</div>