Ir para o conteúdo

API e webhooks

Crie uma chave em Settings → Agents. Uma chave age como você em um espaço de trabalho. Proprietários e administradores gerenciam os webhooks no mesmo lugar.

Versão atualizada em

Autenticação

Envie a chave como Authorization: Bearer rk_…. O CORS está aberto, então a API também funciona a partir de uma extensão de navegador ou de um script pequeno.

Listar vídeos

GET /api/v1/videos retorna os vídeos que o proprietário da chave pode ver nesse espaço de trabalho.

curl 'https://vertov.app/api/v1/videos' \
  -H 'Authorization: Bearer rk_your_key'

{ "videos": [{ "id": "k3J9x", "url": "https://vertov.app/k3J9x", "title": "Homepage walkthrough",
  "duration": 94, "status": "ready", "createdAt": "2026-11-01T10:12:00Z", "owner": "Priya", "snippet": "..." }] }

Enviar um vídeo

POST /api/v1/videos com o arquivo como corpo da requisição. A resposta traz o link de compartilhamento; o vídeo já pode ser reproduzido assim que a resposta chega.

curl -X POST 'https://vertov.app/api/v1/videos?title=What%20I%20changed' \
  -H 'Authorization: Bearer rk_your_key' \
  -H 'Content-Type: video/webm' \
  --data-binary @recording.webm

Webhooks

Cada evento é um POST com corpo JSON. Responda com qualquer código 2xx em até 8 segundos. As entregas são feitas uma única vez, sem novas tentativas automáticas; trate-as como um sinal rápido e liste os vídeos se precisar se atualizar. Os endpoints precisam ser endereços https públicos.

EventoEnviado quandoCampos de data
video.readyUma gravação, um envio ou uma importação terminou e já pode ser reproduzido.id, url, title, duration
video.viewedAlguém que não é o proprietário abriu um vídeo (uma vez por espectador e por vídeo).id, url, title, country, referrer
comment.createdUm espectador conectado ou um convidado identificado pelo nome comentou.id, videoId, url, author, text, timestamp
POST https://your-server.example/hooks/vertov
webhook-id: msg_2f9c0a...
webhook-timestamp: 1793527920
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2/3+hk0qlyF3RcE=

{
  "type": "video.ready",
  "timestamp": "2026-11-01T10:12:00.000Z",
  "data": { "id": "k3J9x", "url": "https://vertov.app/k3J9x", "title": "Homepage walkthrough", "duration": 94 }
}

Verificar a assinatura

As requisições seguem o esquema Standard Webhooks, então qualquer uma das bibliotecas dele funciona com o seu secret whsec_…. A assinatura é o HMAC-SHA256 em base64 de webhook-id.webhook-timestamp.body, usando o secret decodificado como chave. Confira com o corpo bruto e rejeite timestamps antigos.

import { createHmac, timingSafeEqual } from "node:crypto"

// rawBody must be the exact request body string, before any JSON parsing.
export function verify(secret, headers, rawBody) {
  const id = headers["webhook-id"]
  const timestamp = headers["webhook-timestamp"]
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false // replay window

  const key = Buffer.from(secret.replace("whsec_", ""), "base64")
  const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest("base64")

  return headers["webhook-signature"].split(" ").some((entry) => {
    const [version, signature] = entry.split(",")
    return version === "v1" && signature.length === expected.length && timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
  })
}
Commands and recent recordings
Actions
Go to
↑ ↓ Select↵ OpenEsc Close