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

# Create broker

> Creates a broker within the specified brokerage firm. You must provide the target brokerage firm id in the path and the broker details in the request body. The caller must have sufficient permissions within the brokerage firm.



## OpenAPI

````yaml /openapi.json post /brokerage-firms/{brokerageFirmId}/brokers
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /brokerage-firms/{brokerageFirmId}/brokers:
    post:
      tags:
        - brokerage-firms
      summary: Create broker
      description: >-
        Creates a broker within the specified brokerage firm. You must provide
        the target brokerage firm id in the path and the broker details in the
        request body. The caller must have sufficient permissions within the
        brokerage firm.
      operationId: BrokerController_createBroker
      parameters:
        - name: brokerageFirmId
          required: true
          in: path
          description: Brokerage firm id
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Broker payload including the target user id and optional profile/role
          fields
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBrokerInputBody'
      responses:
        '200':
          description: Broker created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBrokerOutput'
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/UserNotFoundErrorDto'
                  - $ref: '#/components/schemas/BrokerageFirmNotFoundErrorDto'
              examples:
                USER_NOT_FOUND:
                  $ref: '#/components/schemas/UserNotFoundErrorDto'
                BROKERAGE_FIRM_NOT_FOUND:
                  $ref: '#/components/schemas/BrokerageFirmNotFoundErrorDto'
          description: ''
components:
  schemas:
    CreateBrokerInputBody:
      type: object
      properties:
        firstName:
          type: string
          description: First name
        lastName:
          type: string
          description: Last name
        brokerRole:
          type: string
        brokerUserId:
          type: string
          description: User id
      required:
        - firstName
        - lastName
        - brokerUserId
    CreateBrokerOutput:
      type: object
      properties: {}
    UserNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - USER_NOT_FOUND
        message:
          type: string
          example: No user found for user id {userId}
        details:
          $ref: '#/components/schemas/UserNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    BrokerageFirmNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - BROKERAGE_FIRM_NOT_FOUND
        message:
          type: string
          example: No brokerage firm found for brokerage firm id {brokerageFirmId}
        details:
          $ref: '#/components/schemas/BrokerageFirmNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    UserNotFoundDetailsDto:
      type: object
      properties:
        userId:
          type: string
        source:
          type: string
      required:
        - userId
        - source
    BrokerageFirmNotFoundDetailsDto:
      type: object
      properties:
        brokerageFirmId:
          type: string
        source:
          type: string
        policyId:
          type: string
      required:
        - brokerageFirmId

````