# create_company

Créer une société

## Rôle

Mêmes règles que l'UI : dédup (doublon fort → refus), champs custom validés. Réponse : la société + `duplicateWarning` éventuel.

## Accès

Scope principal : `companies:write`. Le scope ne remplace pas les gardes de visibilité, d'organisation, de module ni les scopes complémentaires des gestes composés.

[Catalogue complet](/documentation/mcp-reference/) · [Approbations](/documentation/approbations/)

## Paramètres

Le schéma ci-dessous est produit par la fonction qui enregistre les outils, y compris `idempotency_key` lorsqu'elle s'applique. Consultez les objets imbriqués dans le schéma complet.
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 200
    },
    "ownerId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "sector": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "maxLength": 80
        }
      ]
    },
    "parentCompanyId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "siret": {
      "type": [
        "null",
        "string"
      ]
    },
    "vatNumber": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ]
    },
    "website": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "maxLength": 200
        }
      ]
    },
    "linkedin": {
      "type": [
        "null",
        "string"
      ]
    },
    "x": {
      "type": [
        "null",
        "string"
      ]
    },
    "instagram": {
      "type": [
        "null",
        "string"
      ]
    },
    "billingAddress": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "maxLength": 300
        }
      ]
    },
    "customFields": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 80
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 2000
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "externalCodes": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "null"
          },
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9._-]+$"
          }
        ]
      }
    },
    "relations": {
      "description": "#494 : natures de relation (clés de la liste d'organisation, GET /company-relations) ; remplace la liste, [] retire tout",
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
      }
    },
    "idempotency_key": {
      "description": "Clé d'idempotence (recommandée) : rejouer la MÊME mutation avec la même clé renvoie la réponse originale sans ré-exécuter - TTL 24 h",
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}
```


Voir les schémas complets dans /documentation/mcp.json.
