> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a legal entity

> A legal person of the tenant, to be a party of a project: name, country, registry number (kept as a keyed hash and masked) and the DPO e-mail, where approval links and codes go.



## OpenAPI

````yaml openapi/en/control.json POST /v1/legal-entities
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/legal-entities:
    post:
      tags:
        - accounts
      summary: Create a legal entity
      description: >-
        A company registered once per country and registry number; the same
        number with the same DPO answers

        the entity already registered, with another DPO 409.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: create_legal_entity_v1_legal_entities_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegalEntityCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    LegalEntityCreate:
      additionalProperties: false
      properties:
        country:
          pattern: ^[A-Z]{2}$
          title: Country
          type: string
        dpo_email:
          description: Where approval links and codes go. Sealed; never shown back.
          maxLength: 256
          minLength: 1
          title: Dpo Email
          type: string
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        registry:
          description: >-
            The company's registry number (a CNPJ in Brazil), kept as a keyed
            hash and masked.
          maxLength: 256
          minLength: 1
          title: Registry
          type: string
      required:
        - name
        - registry
        - country
        - dpo_email
      title: LegalEntityCreate
      type: object
    LegalEntity:
      additionalProperties: false
      properties:
        country:
          title: Country
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        entity_id:
          format: uuid
          title: Entity Id
          type: string
        name:
          title: Name
          type: string
        registry_masked:
          title: Registry Masked
          type: string
      required:
        - entity_id
        - name
        - registry_masked
        - country
        - created_at
      title: LegalEntity
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````