Hira Documentation
FR EN
Essai gratuit

Référence de l'API

Chaque route, ses champs et un exemple.

Toutes les routes sont sous https://hira.localtechstudio.com/api/v1 et demandent l'en-tête Authorization: Bearer pk_live_…. La spécification complète, lisible par vos outils, est disponible en OpenAPI 3.1.

Messages#

GET/messages

Historique d'une conversation (connectionId + to E.164, curseur after)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/messages \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/messages

Envoyer un message (un seul champ de contenu ; types : text, image, video, document, audio, template, product, productList, …)

Corps de la requête

ChampType
connectionId *string
to *string
E.164
textstring
imageobject
documentobject
audioobject
templateobject
buttonsobject
listobject
ctaobject
smartobject
Texte libre si fenêtre 24 h ouverte, sinon template
otpobject
flowobject
callPermissionRequestobject
reactionobject
rawobject

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/messages \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"con_01H…","to":"+237600000000","text":"Bonjour"}'

Réponses

  • 200 Accepté par Meta
  • 409 Connexion inactive
  • 422 Données invalides ou refus Graph
  • 402 Quota ou abonnement : error.code = plan_limit_numbers | plan_limit_messages | plan_limit_media | subscription_past_due
GET/messages/{id}

Statut d'un message

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/messages/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Numéros connectés#

POST/connect-links

Créer un lien de connexion à usage unique (clé partenaire requise). externalRef et expiresInMinutes sont optionnels (60 par défaut, 10 080 au maximum) ; l'url n'est renvoyée qu'une fois

Corps de la requête

ChampType
externalRefstring
expiresInMinutesinteger

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/connect-links \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"externalRef":"client-4821","expiresInMinutes":60}'

Réponses

  • 201 Lien créé
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
GET/connections

Lister les numéros connectés

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/connections/{id}

Détail d'une connexion (sans token)

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 404 Introuvable
DELETE/connections/{id}

Déconnecter un numéro de la plateforme (jeton vidé, statut disconnected). La reconnexion via Embedded Signup réutilise le même enregistrement et ne consomme pas de slot supplémentaire

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/connections/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Déconnecté
  • 404 Introuvable
  • 409 Déjà déconnecté
GET/connections/{id}/catalogs

Catalogues produits Meta liés à la WABA

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections/…/catalogs \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 Connexion inactive
GET/connections/{id}/catalogs/{catalogId}/products

Produits d'un catalogue Meta

Paramètres de chemin

  • id string
  • catalogId string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections/…/catalogs/…/products \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/connections/{id}/calling

Réglages d'appel du numéro

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections/…/calling \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 Numéro inactif ou en coexistence (calling_not_supported)
PATCH/connections/{id}/calling

Modifier les réglages d'appel : activation, icône d'appel, heures d'ouverture, permission de rappel

Paramètres de chemin

  • id string

Corps de la requête

ChampType
statusENABLED | DISABLED
callIconVisibilityDEFAULT | DISABLE_ALL
callbackPermissionStatusENABLED | DISABLED
callHoursobject

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/connections/…/calling \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"status":"ENABLED","callIconVisibility":"DEFAULT","callbackPermissionStatus":"ENABLED","callHours":{"status":"ENABLED","timezoneId":"string","weeklyOperatingHours":["string"],"holidaySchedule":["string"]}}'

Réponses

  • 200 Succès
  • 409 Numéro inactif ou en coexistence (calling_not_supported)
GET/connections/{id}/call-permissions

Permission d'appel d'un client (paramètre to) et limites restantes

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/connections/…/call-permissions \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Contacts et tags#

GET/contacts

Lister les contacts (filtres companyId, tag, q, optedOut)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/contacts \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée
POST/contacts

Créer ou mettre à jour un contact par numéro (normalisé, un seul contact par numéro)

Corps de la requête

ChampType
companyIdstring
phone *string
countrystring
Pays du numéro s'il est écrit sans indicatif : code ISO ou indicatif
namestring
fieldsobject
tagsarray
consentboolean

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/contacts \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"companyId":"cmp_01H…","phone":"+237 6 99 12 34 56","name":"Awa","tags":["VIP"],"consent":true}'

Réponses

  • 201 Créé
  • 200 Mis à jour
  • 422 Numéro invalide
POST/contacts/import

Importer des contacts (rows JSON ou csv texte, 50 000 lignes max). Colonnes reconnues : numéro, nom, tags, consentement, pays (CM, SN, FR ou 237, ligne par ligne) ; les autres colonnes deviennent des champs utilisables dans les variables

Corps de la requête

ChampType
companyIdstring
rowsarray
csvstring
tagsarray
consentboolean
defaultCountryCodestring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/contacts/import \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"companyId":"string","rows":[{}],"csv":"string","tags":["string"],"consent":true,"defaultCountryCode":"string"}'

Réponses

  • 200 Résumé : created, updated, invalid, duplicates, errors
GET/contacts/{id}

Détail d'un contact

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/contacts/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
PATCH/contacts/{id}

Modifier un contact (name, fields, tags, addTags, removeTags, consent)

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/contacts/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/contacts/{id}

Supprimer un contact

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/contacts/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/contacts/{id}/opt-out

Désinscrire un contact : écarté de toute campagne, y compris en cours

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/contacts/…/opt-out \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/contacts/{id}/opt-in

Réinscrire un contact qui a redonné son consentement

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/contacts/…/opt-in \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/tags

Lister les tags et le nombre de contacts

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/tags \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Campagnes#

GET/campaigns

Lister les campagnes (filtres status, connectionId)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/campaigns \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée
POST/campaigns

Préparer une campagne (brouillon). Contenu : template (Meta) ou text (message libre 24 h : {{name}}, {{phone}}, {{ville}} ou {{field:ville}}, {{date}}, {{entreprise}}, {{numero}}…). Destinataires : recipients et/ou audience. STOP écarté ; MARKETING : consentement. Hors fenêtre → window_closed.

Corps de la requête

ChampType
connectionId *string
templateobject
tpl_… ou { name, language } (requis sans text)
textstring
Message libre personnalisé (requis sans template), max 4096
namestring
recipientsarray
audienceobject
variableMaparray
requireConsentboolean
defaultCountryCodestring
Pays des numéros sans indicatif : code ISO (CM, SN, FR) ou indicatif (237)

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"con_01H…","template":{"name":"promo","language":"fr"},"audience":{"tags":["VIP"]},"variableMap":[{"source":"name","default":"cliente"}]}'

Réponses

  • 201 Brouillon créé
  • 422 Données invalides ou liste vide
GET/campaigns/{id}

Détail de la campagne et de ses destinataires

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/campaigns/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/campaigns/{id}/preview

Vérifier avant envoi : destinataires retenus, écartés par raison, durée estimée, palier et qualité du numéro, quota

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/campaigns/…/preview \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/campaigns/{id}/launch

Lancer une campagne, ou la programmer avec scheduledAt (jusqu'à 60 jours). La liste est vérifiée contre le quota et le palier d'envoi du numéro avant le premier envoi

Paramètres de chemin

  • id string

Corps de la requête

ChampType
scheduledAtstring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/launch \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"scheduledAt":"2026-12-01T08:00:00Z"}'

Réponses

  • 202 Lancée ou programmée
  • 409 Déjà lancée
  • 422 Aucun destinataire éligible ou palier dépassé (daily_limit_exceeded)
  • 402 Quota ou abonnement : error.code = plan_limit_numbers | plan_limit_messages | plan_limit_media | subscription_past_due
POST/campaigns/{id}/pause

Mettre en pause une campagne en cours (effet immédiat)

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/pause \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 invalid_campaign_state
POST/campaigns/{id}/resume

Reprendre une campagne en pause

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/resume \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 202 Succès
  • 409 invalid_campaign_state
POST/campaigns/{id}/cancel

Annuler une campagne : les envois restants sont écartés

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/cancel \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 invalid_campaign_state
POST/campaigns/{id}/test

Envoyer un test à un numéro (compte dans le quota)

Paramètres de chemin

  • id string

Corps de la requête

ChampType
to *string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/test \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"to":"string"}'

Réponses

  • 202 Succès
  • 402 Quota ou abonnement : error.code = plan_limit_numbers | plan_limit_messages | plan_limit_media | subscription_past_due
GET/campaigns/{id}/report

Rapport : taux de livraison, lecture, réponse, clic, STOP, courbe heure par heure, causes d'échec

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/campaigns/…/report \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/campaigns/{id}/export

Export CSV de chaque destinataire et de son statut

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/campaigns/…/export \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Fichier CSV
POST/campaigns/{id}/retarget

Relancer : crée un brouillon avec ceux qui n'ont pas lu (not_read), pas répondu (not_replied) ou en échec (failed)

Paramètres de chemin

  • id string

Corps de la requête

ChampType
mode *not_read | not_replied | failed
namestring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/campaigns/…/retarget \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"mode":"not_read"}'

Réponses

  • 201 Brouillon créé
  • 422 Aucun destinataire à relancer

Automations#

GET/automations

Lister les automations (filtre connectionId)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/automations \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée
POST/automations

Créer une automation. Déclencheurs : message_received, contact_created, campaign_completed, conversation_unanswered. Actions (max 5) : send_smart, send_template, add_tag, notify_team, webhook, send_flow, assign_conversation. Conditions optionnelles : text_contains, has_tag, not_has_tag, unanswered_minutes.

Corps de la requête

ChampType
connectionId *string
name *string
enabledboolean
trigger *message_received | contact_created | campaign_completed | conversation_unanswered
conditionsarray
actions *array

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/automations \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"con_01H…","name":"Accueil","trigger":"message_received","actions":[{"type":"add_tag","tag":"a_ecrit"}]}'

Réponses

  • 201 Créée
  • 422 Données invalides
GET/automations/{id}

Détail d'une automation

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/automations/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
PATCH/automations/{id}

Modifier une automation

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/automations/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/automations/{id}

Supprimer une automation

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/automations/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/automations/{id}/runs

Historique des exécutions

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/automations/…/runs \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée

Templates et médias#

POST/templates/sync

Synchroniser les templates depuis Meta

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/templates/sync \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/templates

Lister les templates

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/templates \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/templates

Créer un template

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/templates \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 201 Succès
GET/templates/{id}

Détail d'un template

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/templates/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/templates/{id}

Supprimer un template

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/templates/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/media

Téléverser un média (multipart, champ file) ; dédupliqué, quota en octets neufs

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/media \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 201 Créé
  • 200 Déjà présent (dédupliqué)
  • 402 Quota ou abonnement : error.code = plan_limit_numbers | plan_limit_messages | plan_limit_media | subscription_past_due
POST/media/header-handle

Obtenir un header_handle pour un template

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/media/header-handle \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Webhooks#

GET/webhook-endpoints

Lister les webhooks sortants

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/webhook-endpoints \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/webhook-endpoints

Créer un webhook (secret whsec_… affiché une fois ; livraisons signées X-Wa-Signature)

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/webhook-endpoints \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/webhooks/whatsapp","scope":"account"}'

Réponses

  • 201 Succès
PATCH/webhook-endpoints/{id}

Modifier l'URL ou le filtre events d'un webhook

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/webhook-endpoints/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/webhook-endpoints/{id}

Supprimer un webhook

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/webhook-endpoints/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
GET/flow-endpoints

Lister les callbacks Flows

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/flow-endpoints \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/flow-endpoints

Créer un callback Flows

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/flow-endpoints \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 201 Succès
PATCH/flow-endpoints/{id}

Modifier l'URL d'un callback Flows

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/flow-endpoints/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/flow-endpoints/{id}

Supprimer un callback Flows

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/flow-endpoints/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Appels#

GET/calls

Lister les appels (filtres connectionId, direction, status)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/calls \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée
POST/calls

Lancer un appel sortant avec une offre SDP (permission du client requise)

Corps de la requête

ChampType
connectionId *string
to *string
E.164
sdpOffer *string
bizOpaqueCallbackDatastring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/calls \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"con_01H…","to":"+237600000000","sdpOffer":"v=0…"}'

Réponses

  • 201 Appel créé
  • 402 Quota ou abonnement : error.code = plan_limit_numbers | plan_limit_messages | plan_limit_media | subscription_past_due
GET/calls/{id}

Détail d'un appel (identifiant cal_… ou identifiant Meta wacid…)

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/calls/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 404 Introuvable
POST/calls/{id}/pre-accept

Pré-accepter un appel entrant avec la réponse SDP

Paramètres de chemin

  • id string

Corps de la requête

ChampType
sdpAnswer *string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/calls/…/pre-accept \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"sdpAnswer":"string"}'

Réponses

  • 200 Succès
  • 409 Appel déjà terminé (invalid_call_state)
POST/calls/{id}/accept

Accepter un appel entrant avec la réponse SDP

Paramètres de chemin

  • id string

Corps de la requête

ChampType
sdpAnswer *string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/calls/…/accept \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"sdpAnswer":"v=0…"}'

Réponses

  • 200 Succès
  • 409 Appel déjà terminé (invalid_call_state)
POST/calls/{id}/reject

Refuser un appel entrant

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/calls/…/reject \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 Appel déjà terminé (invalid_call_state)
POST/calls/{id}/terminate

Raccrocher un appel

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/calls/…/terminate \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 409 Appel déjà terminé (invalid_call_state)

WhatsApp Flows#

GET/flows

Lister les Flows

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/flows \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/flows

Créer un Flow

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/flows \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 201 Succès
GET/flows/{id}

Détail d'un Flow

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/flows/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
PATCH/flows/{id}

Modifier un Flow

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/flows/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
DELETE/flows/{id}

Supprimer un Flow

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/flows/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/flows/{id}/publish

Publier un Flow

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/flows/…/publish \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Entreprises et pays#

GET/companies

Lister les entreprises

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/companies \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
POST/companies

Créer une entreprise (clé partenaire). À partir de la 2ᵉ, exige la feature multi_company (plan Business)

Corps de la requête

ChampType
name *string
externalRefstring
defaultCountrystring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/companies \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","externalRef":"string","defaultCountry":"string"}'

Réponses

  • 201 Créée
  • 402 Feature ou abonnement
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
PATCH/companies/{id}

Définir le pays par défaut de l'entreprise (defaultCountry, code ISO ou indicatif, null pour revenir au défaut du service) : il sert aux numéros écrits sans indicatif

Paramètres de chemin

  • id string

Corps de la requête

ChampType
defaultCountry *string | null

Exemple

Terminal
curl -X PATCH https://hira.localtechstudio.com/api/v1/companies/… \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"defaultCountry":"string"}'

Réponses

  • 200 Succès
  • 422 Pays inconnu
GET/countries

Pays reconnus pour la normalisation des numéros (code, nom, indicatif)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/countries \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès

Clés d'accès#

GET/api-keys

Lister les clés API

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/api-keys \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Liste paginée
POST/api-keys

Créer une clé (secret en clair une seule fois, clé partenaire requise)

Corps de la requête

ChampType
scopepartner | company
companyIdstring
namestring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/api-keys \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"scope":"partner","companyId":"string","name":"string"}'

Réponses

  • 201 Clé créée
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
DELETE/api-keys/{id}

Révoquer une clé

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X DELETE https://hira.localtechstudio.com/api/v1/api-keys/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Révoquée
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
POST/api-keys/{id}/rotate

Renouveler une clé : une nouvelle clé est créée (secret en clair une seule fois) et l'ancienne reste valable 24 heures (clé partenaire requise)

Paramètres de chemin

  • id string

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/api-keys/…/rotate \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 201 Nouvelle clé
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)

Abonnement et facturation#

GET/plans

Plans et prix par devise (PROVISOIRES)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/plans \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
GET/subscription

Abonnement, limites et consommation du compte (clé partenaire)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/subscription \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Abonnement
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
GET/invoices

Lister les factures (clé partenaire)

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/invoices \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Succès
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
GET/invoices/{id}

Détail d'une facture (clé partenaire)

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/invoices/… \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Facture
  • 404 Introuvable
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
GET/invoices/{id}/pdf

PDF d'une facture payée, numérotée WA-AAAA-NNNNNN (clé partenaire)

Paramètres de chemin

  • id string

Exemple

Terminal
curl https://hira.localtechstudio.com/api/v1/invoices/…/pdf \
  -H "Authorization: Bearer pk_live_…"

Réponses

  • 200 Fichier PDF
  • 404 Introuvable
  • 409 Facture non payée : invoice_not_paid
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)
POST/billing/checkout

Démarrer un paiement. XAF/XOF/KES → pawaPay (phone international, 202). EUR/USD → Stripe Checkout (payment.checkoutUrl, 201, phone interdit). Activation à la confirmation (callback pawaPay / webhook Stripe), idempotente.

Corps de la requête

ChampType
plan *string
interval *monthly | yearly
currency *XAF | XOF | KES | EUR | USD
XAF/XOF/KES → pawaPay ; EUR/USD → Stripe
extraNumbersinteger
phonestring
Obligatoire pour XAF/XOF/KES (MSISDN international), interdit pour Stripe.
successUrlstring
cancelUrlstring

Exemple

Terminal
curl -X POST https://hira.localtechstudio.com/api/v1/billing/checkout \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"plan":"string","interval":"monthly","currency":"XAF","extraNumbers":0,"phone":"string","successUrl":"string","cancelUrl":"string"}'

Réponses

  • 201 Stripe : session Checkout créée
  • 202 pawaPay : USSD envoyé
  • 422 Devise, plan ou numéro invalide
  • 503 Fournisseur de paiement indisponible
  • 403 Clé entreprise : clé partenaire requise (partner_key_required)