Skip to content
Documentation

Build with Mittis.

A REST API with JSON in and JSON out. Base URL https://api.mittis.ai/v1.

Webhooks

Mittis POSTs JSON events to your endpoint. Each request has an x-mittis-signature header in the form t=<unix>,v1=<hex>. The signature is an HMAC-SHA256 of {t}.{rawBody} using your endpoint secret. Reject anything older than five minutes.

Node · verify a signature
import { createHmac, timingSafeEqual } from 'node:crypto';

export function verify(secret, header, rawBody) {
  const { t, v1 } = Object.fromEntries(header.split(',').map(p => p.split('=')));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}

Event types

SMSmessage.receivedA customer replied
SMSmessage.statusDelivery state changed
CALLcall.ringingInbound call started ringing
CALLcall.completedAnswered call ended
CALLcall.missedNobody answered
CALLcall.transcriptFinal transcript is ready
EMAILemail.deliveredAccepted by the recipient's server
EMAILemail.openedRecipient opened it
EMAILemail.bouncedHard or soft bounce

Send your first message
in five minutes.

Create a key, verify a number, and make one request.