{
  "openapi": "3.1.0",
  "info": {
    "title": "API nechima",
    "version": "2026-11-10",
    "summary": "Le mobile des dirigeants d'entreprises françaises, dans vos outils.",
    "description": "Recherche en langage naturel ou par critères, comptage, fiche par SIREN, déblocage des mobiles et des e-mails de dirigeants. JSON, authentification Bearer par clé d'espace (Réglages → API). Les erreurs ont un `code` stable et un `doc_url`.",
    "contact": {
      "name": "nechima",
      "url": "https://nechima.io/developpeurs"
    }
  },
  "servers": [
    {
      "url": "https://nechima.io/api/public/v1"
    }
  ],
  "security": [
    {
      "cle": []
    }
  ],
  "paths": {
    "/recherche": {
      "post": {
        "operationId": "rechercher",
        "summary": "Recherche en langage naturel",
        "description": "Décrivez votre cible ou ce que vous vendez, en français. nechima la traduit en critères (la même lecture que dans l'app), compte les sociétés et les dirigeants joignables, et renvoie les premières fiches, masquées. Avec `recherche_id`, la phrase affine la recherche précédente. Gratuit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "demande"
                ],
                "additionalProperties": false,
                "properties": {
                  "demande": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 500,
                    "examples": [
                      "les PME du BTP de 10 à 99 salariés dans le Rhône"
                    ]
                  },
                  "recherche_id": {
                    "type": "string",
                    "description": "Recherche à affiner."
                  },
                  "limite": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50,
                    "default": 10,
                    "description": "Fiches renvoyées (0 : comptage seul)."
                  },
                  "curseur": {
                    "type": "string",
                    "description": "`curseur_suivant` d'une page précédente."
                  },
                  "exclure_debloques": {
                    "type": "boolean",
                    "description": "Écarter les dirigeants déjà débloqués par l'espace."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Résultat, ou question quand la phrase ne décrit pas encore une cible.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Recherche"
                    },
                    {
                      "$ref": "#/components/schemas/Question"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable, comprehension_unavailable, api_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/recherche/criteres": {
      "post": {
        "operationId": "rechercherParCriteres",
        "summary": "Recherche par critères",
        "description": "Les critères dans la grammaire nechima : ET entre familles, OU dans une famille. Gratuit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "criteres"
                ],
                "additionalProperties": false,
                "properties": {
                  "criteres": {
                    "$ref": "#/components/schemas/Criteres"
                  },
                  "limite": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50,
                    "default": 20
                  },
                  "curseur": {
                    "type": "string"
                  },
                  "tri": {
                    "type": "string",
                    "enum": [
                      "pertinence",
                      "recent",
                      "effectif"
                    ]
                  },
                  "exclure_debloques": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Totaux et fiches masquées.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recherche"
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/comptage": {
      "post": {
        "operationId": "compter",
        "summary": "Comptage",
        "description": "Combien de sociétés et de dirigeants joignables pour ces critères, avec une répartition sur 1 ou 2 axes. Gratuit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "criteres"
                ],
                "additionalProperties": false,
                "properties": {
                  "criteres": {
                    "$ref": "#/components/schemas/Criteres"
                  },
                  "ventiler_par": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 2,
                    "items": {
                      "type": "string",
                      "enum": [
                        "dep",
                        "effectif",
                        "naf_div",
                        "age_dir",
                        "anciennete",
                        "cj",
                        "densite"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Totaux.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comptage"
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/societes/{siren}": {
      "get": {
        "operationId": "societe",
        "summary": "Fiche d'une société par SIREN",
        "description": "La société et ses dirigeants joignables. Coordonnées masquées, en clair pour ceux que l'espace a déjà débloqués. Gratuit.",
        "parameters": [
          {
            "name": "siren",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{9}$"
            },
            "example": "812345678"
          }
        ],
        "responses": {
          "200": {
            "description": "La société.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Societe"
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "404": {
            "description": "not_found, company_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/deblocages": {
      "post": {
        "operationId": "debloquer",
        "summary": "Débloquer un ou plusieurs dirigeants",
        "description": "Rend le mobile et l'e-mail en clair. 1 crédit par dirigeant joignable ; un dirigeant déjà débloqué par l'espace est gratuit ; sans mobile, jamais facturé. Les plafonds du membre qui a créé la clé s'appliquent. Envoyez `Idempotency-Key` : le même appel rejoué rend la même réponse sans nouveau débit (24 h).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Identifiant unique de l'opération (UUID conseillé)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contact_ids"
                ],
                "additionalProperties": false,
                "properties": {
                  "contact_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string"
                    },
                    "description": "`contact_id` des fiches."
                  },
                  "crm_connexion_id": {
                    "type": "string",
                    "description": "Connexion CRM où envoyer ce déblocage (voir GET /crm/connexions)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contacts en clair, crédits dépensés, solde.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deblocage"
                }
              }
            }
          },
          "400": {
            "description": "invalid_json, invalid, batch_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits, card_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_conflict, conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "operationId": "contacts",
        "summary": "Contacts débloqués",
        "description": "Les dirigeants débloqués par l'espace, en clair, les plus récents d'abord.",
        "parameters": [
          {
            "name": "limite",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "curseur",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depuis",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Débloqués depuis cette date (AAAA-MM-JJ)."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filtre texte (société, dirigeant, ville, SIREN)."
          }
        ],
        "responses": {
          "200": {
            "description": "Une page de contacts.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "objet": {
                      "const": "liste"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "curseur_suivant": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "422": {
            "description": "validation_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/solde": {
      "get": {
        "operationId": "solde",
        "summary": "Solde de crédits",
        "description": "Crédits de l'espace et ce que le créateur de la clé peut encore débloquer.",
        "responses": {
          "200": {
            "description": "Le solde.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Solde"
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    },
    "/crm/connexions": {
      "get": {
        "operationId": "connexionsCrm",
        "summary": "Connexions CRM de l'espace",
        "description": "Pour choisir `crm_connexion_id` d'un déblocage (plusieurs portails HubSpot, par exemple).",
        "responses": {
          "200": {
            "description": "Les connexions.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Appels permis par minute pour cette clé.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Appels restants dans la minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Secondes avant que la fenêtre se libère.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "Identifiant de l'appel (à donner au support).",
                "schema": {
                  "type": "string"
                }
              },
              "Nechima-Version": {
                "description": "Version de l'API.",
                "schema": {
                  "type": "string",
                  "const": "2026-11-10"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "objet": {
                      "const": "liste"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConnexionCrm"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing_key, invalid_key, key_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "403": {
            "description": "key_owner_inactive, plan_required, forbidden, channel_not_allowed, workspace_not_verified, member_monthly_limit, member_daily_limit, member_bulk_limit, account_blocked, member_suspended, kyc_cap_reached, email_not_verified, team_trial_ended, member_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, loop_detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Erreur"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cle": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "nch_<public>_<secret>",
        "description": "Clé créée dans nechima → Réglages → API. Montrée une seule fois."
      }
    },
    "schemas": {
      "Erreur": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "doc_url",
              "request_id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "authentication_error",
                  "permission_error",
                  "invalid_request_error",
                  "payment_error",
                  "rate_limit_error",
                  "api_error"
                ]
              },
              "code": {
                "type": "string",
                "enum": [
                  "missing_key",
                  "invalid_key",
                  "key_revoked",
                  "key_owner_inactive",
                  "plan_required",
                  "forbidden",
                  "service_unavailable",
                  "channel_not_allowed",
                  "workspace_not_verified",
                  "member_monthly_limit",
                  "member_daily_limit",
                  "member_bulk_limit",
                  "account_blocked",
                  "member_suspended",
                  "kyc_cap_reached",
                  "insufficient_credits",
                  "card_required",
                  "email_not_verified",
                  "team_trial_ended",
                  "member_cap",
                  "validation_error",
                  "invalid_json",
                  "invalid",
                  "batch_too_large",
                  "payload_too_large",
                  "not_found",
                  "company_not_found",
                  "method_not_allowed",
                  "idempotency_conflict",
                  "conflict",
                  "rate_limited",
                  "loop_detected",
                  "comprehension_unavailable",
                  "api_disabled",
                  "internal"
                ]
              },
              "message": {
                "type": "string",
                "description": "Phrase en français, lisible par un humain."
              },
              "param": {
                "type": "string",
                "description": "Champ fautif, quand il y en a un."
              },
              "action_url": {
                "type": "string",
                "description": "Où régler le problème dans nechima."
              },
              "doc_url": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              }
            }
          }
        }
      },
      "Criteres": {
        "type": "object",
        "description": "Grammaire nechima : ET entre familles, OU dans une famille. `<famille>_x` retire des valeurs. Un seul niveau géographique (dep, commune, cp ou rayon).",
        "additionalProperties": false,
        "properties": {
          "dep": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "69"
              ]
            ]
          },
          "commune": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Code INSEE (69123 = Lyon)."
          },
          "cp": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rayon": {
            "type": "object",
            "properties": {
              "commune": {
                "type": "string"
              },
              "km": {
                "type": "number",
                "maximum": 200
              }
            }
          },
          "naf": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Code NAF à 5 caractères (10.71C)."
          },
          "naf_div": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Division NAF à 2 chiffres (43 = travaux de construction spécialisés)."
          },
          "naf_x": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "effectif": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tranches INSEE : 00, 01, 02, 03, 11, 12, 21, 22, 31, 32, 41, 42, 51, 52."
          },
          "effectif_x": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cj": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Forme juridique (5710 SAS, 5499 SARL, 1000 EI…)."
          },
          "cj_x": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cat_ent": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "PME",
                "ETI",
                "GE"
              ]
            }
          },
          "anciennete": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "anciennete_min": {
            "type": "integer"
          },
          "anciennete_max": {
            "type": "integer"
          },
          "age_dir": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "age_dir_min": {
            "type": "integer"
          },
          "age_dir_max": {
            "type": "integer"
          },
          "densite": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "has_email": {
            "type": "boolean"
          }
        }
      },
      "Fiche": {
        "type": "object",
        "properties": {
          "contact_id": {
            "type": "string",
            "description": "À passer à POST /deblocages."
          },
          "dirigeant_id": {
            "type": "string"
          },
          "dirigeant": {
            "type": "string"
          },
          "fonction": {
            "type": [
              "string",
              "null"
            ]
          },
          "age_dirigeant": {
            "type": [
              "string",
              "null"
            ]
          },
          "societe": {
            "type": "string"
          },
          "siren": {
            "type": "string"
          },
          "ville": {
            "type": [
              "string",
              "null"
            ]
          },
          "code_postal": {
            "type": [
              "string",
              "null"
            ]
          },
          "activite": {
            "type": [
              "string",
              "null"
            ]
          },
          "naf": {
            "type": [
              "string",
              "null"
            ]
          },
          "effectif": {
            "type": [
              "string",
              "null"
            ]
          },
          "creee_le": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile_disponible": {
            "type": "boolean"
          },
          "email_disponible": {
            "type": "boolean"
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ],
            "description": "Masqué (« 06 •• •• •• 12 ») tant que non débloqué."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "deja_debloque": {
            "type": "boolean"
          },
          "exemple": {
            "type": "boolean",
            "description": "Fiche d'exemple sous un total réel."
          }
        }
      },
      "Recherche": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "recherche"
          },
          "recherche_id": {
            "type": "string"
          },
          "titre": {
            "type": "string"
          },
          "libelle": {
            "type": "string"
          },
          "explication": {
            "type": [
              "string",
              "null"
            ]
          },
          "criteres": {
            "$ref": "#/components/schemas/Criteres"
          },
          "total_societes": {
            "type": "integer"
          },
          "total_dirigeants": {
            "type": "integer",
            "description": "Dirigeants joignables (mobiles uniques)."
          },
          "source_totaux": {
            "type": "string",
            "enum": [
              "comptage",
              "demo"
            ]
          },
          "fiches_exemples": {
            "type": "boolean"
          },
          "fiches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fiche"
            }
          },
          "curseur_suivant": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "libelle": {
                  "type": "string"
                },
                "criteres": {
                  "$ref": "#/components/schemas/Criteres"
                },
                "total_societes": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "Question": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "question"
          },
          "question": {
            "type": "string"
          },
          "societe": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Comptage": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "comptage"
          },
          "titre": {
            "type": "string"
          },
          "libelle": {
            "type": "string"
          },
          "criteres": {
            "$ref": "#/components/schemas/Criteres"
          },
          "total_societes": {
            "type": "integer"
          },
          "total_dirigeants": {
            "type": "integer"
          },
          "source_totaux": {
            "type": "string",
            "enum": [
              "comptage",
              "demo"
            ]
          },
          "repartition": {
            "type": "object"
          }
        }
      },
      "Societe": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "societe"
          },
          "siren": {
            "type": "string"
          },
          "societe": {
            "type": "string"
          },
          "raison_sociale": {
            "type": "string"
          },
          "ville": {
            "type": [
              "string",
              "null"
            ]
          },
          "code_postal": {
            "type": [
              "string",
              "null"
            ]
          },
          "departement": {
            "type": [
              "string",
              "null"
            ]
          },
          "activite": {
            "type": [
              "string",
              "null"
            ]
          },
          "naf": {
            "type": [
              "string",
              "null"
            ]
          },
          "effectif": {
            "type": [
              "string",
              "null"
            ]
          },
          "forme_juridique": {
            "type": [
              "string",
              "null"
            ]
          },
          "creee_le": {
            "type": [
              "string",
              "null"
            ]
          },
          "site": {
            "type": [
              "string",
              "null"
            ]
          },
          "dirigeants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fiche"
            }
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "contact_id": {
            "type": "string"
          },
          "dirigeant_id": {
            "type": "string"
          },
          "dirigeant": {
            "type": "string"
          },
          "fonction": {
            "type": [
              "string",
              "null"
            ]
          },
          "societe": {
            "type": "string"
          },
          "siren": {
            "type": "string"
          },
          "ville": {
            "type": [
              "string",
              "null"
            ]
          },
          "activite": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "debloque_le": {
            "type": "string",
            "format": "date-time"
          },
          "debloque_par": {
            "type": "string"
          },
          "canal": {
            "type": "string"
          },
          "credits": {
            "type": "integer"
          }
        }
      },
      "Deblocage": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "deblocage"
          },
          "id": {
            "type": "string"
          },
          "credits_depenses": {
            "type": "integer"
          },
          "solde_apres": {
            "type": "integer"
          },
          "contacts": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Contact"
                },
                {
                  "type": "object",
                  "properties": {
                    "nouveau": {
                      "type": "boolean",
                      "description": "Faux : déjà débloqué par l'espace, gratuit."
                    }
                  }
                }
              ]
            }
          },
          "exclus": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "contact_id": {
                  "type": "string"
                },
                "raison": {
                  "type": "string",
                  "enum": [
                    "sans_mobile",
                    "doublon",
                    "introuvable"
                  ]
                }
              }
            }
          },
          "crm": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "connexion_id": {
                "type": "string"
              },
              "nom": {
                "type": "string"
              }
            }
          }
        }
      },
      "Solde": {
        "type": "object",
        "properties": {
          "objet": {
            "const": "solde"
          },
          "credits_disponibles": {
            "type": "integer"
          },
          "inclus": {
            "type": "integer"
          },
          "achetes": {
            "type": "integer"
          },
          "consommes_ce_mois": {
            "type": "integer"
          },
          "allocation_mensuelle": {
            "type": "integer"
          },
          "prochaine_expiration": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "credits": {
                "type": "integer"
              },
              "le": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "plafond_utilisateur": {
            "type": "object",
            "properties": {
              "mensuel_restant": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "jour_restant": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "max_par_deblocage": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "formule": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "nom": {
                "type": "string"
              }
            }
          }
        }
      },
      "ConnexionCrm": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "nom": {
            "type": "string"
          },
          "crm": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "reel",
              "test"
            ]
          },
          "statut": {
            "type": "string"
          },
          "envoi": {
            "type": "string",
            "enum": [
              "auto",
              "manuel"
            ]
          },
          "par_defaut": {
            "type": "boolean"
          }
        }
      }
    }
  }
}