API

Witnio Documentation API.

Tout ce qui suit communique avec la même API de plan de contrôle que celle utilisée par le tableau de bord.

Démarrage rapide

1. Sign up and get a bearer token:

curl -X POST https://api.witnio.com/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "a-strong-password", "full_name": "Your Name", "tenant_name": "Your Org"}'

1b. If your tenant requires MFA for tenant users (on by default), enroll TOTP before step 2:

curl -X POST https://api.witnio.com/api/v1/auth/mfa/enroll -H "Authorization: Bearer <ACCESS_TOKEN>"
curl -X POST https://api.witnio.com/api/v1/auth/mfa/verify \
  -H "Authorization: Bearer <ACCESS_TOKEN>" -H "Content-Type: application/json" \
  -d '{"code": "123456"}'

2. Create an API key, then use it as X-API-Key from here on:

curl -X POST https://api.witnio.com/api/v1/api-keys \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name": "CI pipeline"}'

3. Create an OTP/SMS check with forwarding (the "Number for QA" use case):

curl -X POST https://api.witnio.com/api/v1/monitor/checks \
  -H "X-API-Key: <YOUR_KEY>" -H "Content-Type: application/json" \
  -d '{
    "name": "Signup OTP - CR", "check_type": "otp_sms",
    "target": "+50688990011", "country_code": "CR",
    "frequency_minutes": 15,
    "authorized_senders_json": ["YourApp", "+18445551234"],
    "forward_webhook_url": "https://yourapp.com/hooks/otp"
  }'

4. Read checks, QA runs and compliance reports:

curl https://api.witnio.com/api/v1/monitor/checks -H "X-API-Key: <YOUR_KEY>"
curl https://api.witnio.com/api/v1/qa/runs?limit=5 -H "X-API-Key: <YOUR_KEY>"
curl https://api.witnio.com/api/v1/compliance/reports -H "X-API-Key: <YOUR_KEY>"

Every error response is JSON: {"detail": "..."} with a matching HTTP status code. Rate limits: 600 requests/minute per caller by default, 20/minute on expensive routes, with Retry-After and X-RateLimit-* headers.

Référence complète

Collection Postman

Importez la collection pour explorer chaque endpoint avec des exemples de requêtes.

Télécharger la collection Postman