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

# Create an Organization

> Use this endpoint to create an Organization. You can create multiple Organizations, but they must be added one at a time.



## OpenAPI

````yaml /en/openapi/v3-current/ledger.yaml post /v1/organizations
openapi: 3.1.0
info:
  title: Midaz Ledger API
  description: >-
    Complete API reference for Midaz Ledger services including organization
    management, ledger operations, assets, segments, portfolios, accounts,
    account types, transactions, operations, balances, operation routes,
    transaction routes, and metadata indexes.
  version: 3.7.1
servers:
  - url: https://ledger.sandbox.lerian.net
security: []
tags:
  - name: Organizations API
  - name: Ledgers API
  - name: Assets API
  - name: Segments API
  - name: Portfolios API
  - name: Account Types API
  - name: Accounts API
  - name: Balances API
  - name: Transactions API
  - name: Operations API
  - name: Operation Routes API
  - name: Transaction Routes API
  - name: Metadata Indexes API
paths:
  /v1/organizations:
    post:
      tags:
        - Organizations API
      summary: Create an Organization
      description: >-
        Use this endpoint to create an Organization. You can create multiple
        Organizations, but they must be added one at a time.
      parameters:
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrganizationRequest'
            example:
              legalName: Lerian Studio
              doingBusinessAs: Lerian Studio
              legalDocument: '123456789'
              status:
                code: ACTIVE
                description: Organization is fully verified and operational.
              address:
                line1: Avenida Paulista, 1234 - Centro
                line2: CJ 123
                zipCode: '04696040'
                city: São Paulo
                state: SP
                country: BR
              metadata:
                segment: fintech
                riskTier: low
                registrationSource: onboarding-portal
      responses:
        '201':
          description: >-
            Indicates that the resource was successfully created and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrganizationResponse'
              example:
                id: 019c96a0-0a98-7287-9a31-786e0809c769
                parentOrganizationId: null
                legalName: Lerian Studio
                doingBusinessAs: Lerian Studio
                legalDocument: '123456789'
                address:
                  line1: Avenida Paulista, 1234 - Centro
                  line2: CJ 123
                  zipCode: '04696040'
                  city: São Paulo
                  state: SP
                  country: BR
                status:
                  code: ACTIVE
                  description: ACTIVE
                createdAt: '2026-02-25T21:06:36.824Z'
                updatedAt: '2026-02-25T21:06:36.824Z'
                deletedAt: null
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0009:
                  $ref: '#/components/examples/Error0009'
                Error0032:
                  $ref: '#/components/examples/Error0032'
                Error0047:
                  $ref: '#/components/examples/Error0047'
                Error0050:
                  $ref: '#/components/examples/Error0050'
                Error0051:
                  $ref: '#/components/examples/Error0051'
                Error0053:
                  $ref: '#/components/examples/Error0053'
                Error0067:
                  $ref: '#/components/examples/Error0067'
                Error0094:
                  $ref: '#/components/examples/Error0094'
          headers: {}
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0041:
                  $ref: '#/components/examples/Error0041'
                Error0042:
                  $ref: '#/components/examples/Error0042'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0043:
                  $ref: '#/components/examples/Error0043'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0039:
                  $ref: '#/components/examples/Error0039'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
                Error0046:
                  $ref: '#/components/examples/Error0046'
      security: []
components:
  parameters:
    ContentType:
      name: Content-Type
      in: header
      description: >-
        The type of media of the resource. Recommended value is
        `application/json`.
      required: false
      example: application/json
      schema:
        type: string
    Authorization:
      name: Authorization
      in: header
      description: >-
        The authorization token. **This header is required if your environment
        has Access Manager enabled**.
      required: false
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: A unique identifier used to trace and track each request.
      required: false
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
  schemas:
    CreateOrganizationRequest:
      type: object
      properties:
        legalName:
          type: string
          description: The legal name of the Organization.
          maxLength: 256
        parentOrganizationId:
          type:
            - string
            - 'null'
          description: The unique identifier of the parent Organization.
          format: uuid
        doingBusinessAs:
          type:
            - string
            - 'null'
          maxLength: 256
          description: The trade name of the Organization.
        legalDocument:
          type: string
          description: >-
            Official tax ID, company registration number, or other legal
            identification.
          maxLength: 256
          example: '123456789012345'
        status:
          $ref: '#/components/schemas/StatusOrganizationRequest'
        address:
          $ref: '#/components/schemas/AddressOrganization'
        metadata:
          $ref: '#/components/schemas/Metadata'
      required:
        - legalName
        - legalDocument
    CreateOrganizationResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the Organization.
        legalName:
          type: string
          description: The legal name of the Organization.
          maxLength: 256
        parentOrganizationId:
          type:
            - string
            - 'null'
          description: The unique identifier of the parent Organization.
          format: uuid
        doingBusinessAs:
          type:
            - string
            - 'null'
          maxLength: 256
          description: The trade name of the Organization.
        legalDocument:
          type: string
          description: >-
            Official tax ID, company registration number, or other legal
            identification.
          maxLength: 256
          example: '123456789012345'
        status: 70bec501-51af-4fd1-8992-733c7588474a
        address:
          $ref: '#/components/schemas/AddressOrganization'
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          type: string
          format: date-time
          description: Timestamp of creation (UTC).
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of last update (UTC).
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of soft deletion, if applicable (UTC).
    ErrorFormat:
      type: object
      description: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
        fields:
          type: object
          additionalProperties: true
          description: Additional information about the fields that caused the error.
    StatusOrganizationRequest:
      type: object
      description: >-
        An object containing information about the status. **Important**: If not
        provided, the default status will be 'ACTIVE'.
      properties:
        code:
          type: string
          maxLength: 100
          description: The name of the status.
        description:
          type:
            - string
            - 'null'
          maxLength: 256
          description: The description of the status.
      StatusOrganization:
        type: object
        description: An object containing information about the status.
        properties:
          code:
            type: string
            maxLength: 100
            description: The name of the status.
          description:
            type:
              - string
              - 'null'
            maxLength: 256
            description: The description of the status.
    AddressOrganization:
      type: object
      required:
        - line1
        - zipCode
        - city
        - state
        - country
      description: An object containing information about the address of the Organization.
      properties:
        line1:
          type: string
          description: >-
            The first line of the address. Usually used to inform the name of
            the street and the number of the building.
        line2:
          type: string
          description: >-
            The second line of the address. Usually used to inform about any
            complements such as the number of the apartment.
        zipCode:
          type: string
          description: The postal code (only numbers).
        city:
          type: string
          description: The name of the city where the Organization is established.
        state:
          type: string
          description: >-
            The two-letter abbreviation that represents the State where the
            Organization is.
        country:
          description: >-
            The two-letter code (ISO 3166-1 alpha2) that represents the country
            where the Organization is.
          type: string
        description:
          type: string
          maxLength: 100
          description: >-
            A descriptive label for the address (e.g., "Home", "Office",
            "Billing").
    Metadata:
      type: object
      additionalProperties:
        type: string
      description: >-
        An object containing key-value pairs to add as metadata, where the field
        `name` is the key and the field `value` is the value. For example, to
        add a Cost Center, use 'costCenter': 'BR_11101997'.
  examples:
    Error0009:
      summary: Missing Fields in Request
      value:
        code: '0009'
        title: Missing Fields in Request
        message: >-
          Your request is missing one or more required fields. Please refer to
          the documentation to ensure all necessary fields are included in your
          request.
        fields:
          metadataKey: metadataKey is a required field
    Error0032:
      value:
        code: '0032'
        title: Invalid Country Code
        message: >-
          The provided country code in the 'address.country' field does not
          conform to the ISO-3166 alpha-2 standard. Please provide a valid
          alpha-2 country code.
      summary: Invalid Country Code
    Error0047:
      summary: Bad Request
      value:
        code: '0047'
        title: Bad Request
        message: >-
          The server could not understand the request due to malformed syntax.
          Please check the listed fields and try again.
    Error0050:
      value:
        code: '0050'
        title: Invalid Metadata
        message: >-
          One or more metadata entries are invalid. Please ensure metadata keys
          and values follow the allowed format.
      summary: Invalid Metadata
    Error0051:
      value:
        code: '0051'
        title: Invalid Metadata Key
        message: >-
          A metadata key contains unsupported characters or exceeds length
          limits. Please correct the key and try again.
      summary: Invalid Metadata Key
    Error0053:
      value:
        code: '0053'
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields as per the documentation. The unexpected fields are
          listed in the fields object.
        fields:
          '{{field}}': '{{value}}'
      summary: Unexpected Fields in the Request
    Error0067:
      value:
        code: '0067'
        title: Invalid Metadata Nesting
        message: >-
          The metadata object cannot contain nested values. Please ensure that
          the value {{value}} is not nested and try again.
      summary: Invalid Metadata Nesting
    Error0094:
      value:
        code: '0094'
        title: Invalid Request Body
        message: >-
          The request body is invalid or could not be parsed. Please check JSON
          structure and field types.
      summary: Invalid Request Body
    Error0041:
      summary: Token Missing
      value:
        code: '0041'
        title: Token Missing
        message: >-
          A valid token must be provided in the request header. Please include a
          token and try again.
    Error0042:
      summary: Invalid Token
      value:
        code: '0042'
        title: Invalid Token
        message: >-
          The provided token is expired, invalid or malformed. Please provide a
          valid token and try again.
    Error0043:
      summary: Insufficient Privileges
      value:
        code: '0043'
        title: Insufficient Privileges
        message: >-
          You do not have the necessary permissions to perform this action.
          Please contact your administrator if you believe this is an error.
    Error0039:
      summary: Parent Organization ID Not Found
      value:
        code: '0039'
        title: Parent Organization ID Not Found
        message: >-
          The provided parent organization ID does not exist in our records.
          Please verify the parent organization ID and try again.

````