> ## 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.

# Criar entidade legal

> Uma pessoa jurídica do tenant, para ser parte de um projeto: nome, país, registro (guardado como hash com chave e mascarado) e o e-mail do encarregado, para onde vão os links e os códigos de aprovação.



## OpenAPI

````yaml openapi/pt/control.json POST /v1/legal-entities
openapi: 3.1.0
info:
  title: API de controle da Niadra
  version: '1'
  description: >-
    Tenants, projetos, fontes, chaves, pessoas, configuração e uso. Nunca recebe
    conteúdo de cliente.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/legal-entities:
    post:
      tags:
        - accounts
      summary: Criar entidade legal
      description: >-
        Uma empresa registrada uma vez por país e número de registro; o mesmo
        número com o mesmo encarregado responde a entidade já registrada, com
        outro encarregado 409.


        **Autenticação.** Token de pessoa emitido pelo controle (`Authorization:
        Bearer <JWT>`), com o papel que a operação pede.
      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: Resposta de sucesso.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      security:
        - personToken: []
components:
  schemas:
    LegalEntityCreate:
      additionalProperties: false
      properties:
        country:
          pattern: ^[A-Z]{2}$
          title: Country
          type: string
        dpo_email:
          description: >-
            Para onde vão os links e os códigos de aprovação. Lacrado; nunca é
            mostrado de volta.
          maxLength: 256
          minLength: 1
          title: Dpo Email
          type: string
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        registry:
          description: >-
            O número de registro da empresa no país dela, guardado como hash com
            chave e mascarado.
          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: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      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

````