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

# Create Agent With Documents

> Create a new agent with document uploads (integrated with External Factory).

This endpoint allows creating an agent and uploading knowledge base documents in one request.
Uses the integrated CreateAgentUseCase with file support.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json post /agents/multipart
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /agents/multipart:
    post:
      tags:
        - agents
      summary: Create Agent With Documents
      description: >-
        Create a new agent with document uploads (integrated with External
        Factory).


        This endpoint allows creating an agent and uploading knowledge base
        documents in one request.

        Uses the integrated CreateAgentUseCase with file support.
      operationId: create_agent_with_documents_agents_multipart_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_create_agent_with_documents_agents_multipart_post
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_create_agent_with_documents_agents_multipart_post:
      properties:
        agent_data:
          type: string
          title: Agent Data
          description: JSON string of AgentCreate model
        files:
          items:
            type: string
            contentMediaType: application/octet-stream
          type: array
          title: Files
          default: []
      type: object
      required:
        - agent_data
      title: Body_create_agent_with_documents_agents_multipart_post
    AgentCreateResponse:
      properties:
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        version:
          type: integer
          title: Version
        livekit:
          additionalProperties: true
          type: object
          title: Livekit
        embed:
          additionalProperties:
            type: string
          type: object
          title: Embed
        sip:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Sip
        capabilities:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Capabilities
        tools:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Tools
          default: []
        workflow:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Workflow
        client_messages:
          items:
            type: string
          type: array
          title: Client Messages
          default:
            - conversation-update
            - tool-calls
            - transcript.partial
            - transcript.final
      type: object
      required:
        - agent_id
        - version
        - livekit
        - embed
      title: AgentCreateResponse
      description: Agent creation response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````