Skip to main content
POST
/
webhooks
Crear webhook
curl --request POST \
  --url https://api.linahealthcareplatform.com/api/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "secret": "<string>"
}
'
import requests

url = "https://api.linahealthcareplatform.com/api/v1/webhooks"

payload = {
"url": "<string>",
"events": ["<string>"],
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], secret: '<string>'})
};

fetch('https://api.linahealthcareplatform.com/api/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.linahealthcareplatform.com/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'events' => [
'<string>'
],
'secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.linahealthcareplatform.com/api/v1/webhooks"

payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"secret\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", 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(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.linahealthcareplatform.com/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"secret\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"secret\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "wh_abc123",
  "url": "https://tu-servidor.com/webhooks/lina",
  "events": ["form.completed", "call.ended", "credits.low"],
  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "status": "active",
  "createdAt": "2026-05-14T10:00:00Z"
}

Body

url
string
required
URL HTTPS de tu endpoint que recibirá los eventos.
events
string[]
required
Lista de eventos a los que suscribirte. Valores: patient.created, form.completed, call.ended, conversation.ended, credits.low, schedule.sent.
secret
string
Clave secreta para firmar los webhooks con HMAC-SHA256. Si se omite, se genera automáticamente.
{
  "id": "wh_abc123",
  "url": "https://tu-servidor.com/webhooks/lina",
  "events": ["form.completed", "call.ended", "credits.low"],
  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "status": "active",
  "createdAt": "2026-05-14T10:00:00Z"
}
id
string
Identificador único del webhook con prefijo wh_.
secret
string
Clave secreta para verificar firmas. Solo se muestra en esta respuesta. Consulta la guía de webhooks para implementar la verificación.
status
string
Estado del webhook: active o disabled.

Authorizations

Authorization
string
header
required

Token JWT obtenido via POST /auth/token

Body

application/json
url
string<uri>
required
events
string[]
required
secret
string

Response

201 - application/json

Webhook creado

id
string
url
string
events
string[]
secret
string
status
string
createdAt
string<date-time>