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

# Create a new port

> Creates a new port in the specified model



## OpenAPI

````yaml post /api/models/{modelId}/ports
openapi: 3.0.0
info:
  title: Dalus Public API Documentation
  version: 1.0.0
  description: Public API documentation for Dalus application
servers:
  - url: http://localhost:3000
    description: Dalus API Server
security:
  - bearerAuth: []
tags:
  - name: models
    description: AI model management endpoints
  - name: models/requirements
    description: Requirements management for models
  - name: models/actions
    description: Action management for models
  - name: models/parts
    description: Part management for models
  - name: models/states
    description: State management for models
  - name: models/transitions
    description: Transition relationship management for models
  - name: models/signals
    description: Signal relationship management for models
  - name: models/interfaces
    description: Interface relationship management for models
  - name: models/ports
    description: Port management for models
paths:
  /api/models/{modelId}/ports:
    post:
      tags:
        - models/ports
      summary: Create a new port
      description: Creates a new port in the specified model
      parameters:
        - name: modelId
          in: path
          required: true
          description: ID of the model
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - label
                - partId
              properties:
                label:
                  type: string
                  description: Label of the port
                partId:
                  type: string
                  description: ID of the part this port belongs to
                constraints:
                  type: array
                  items:
                    type: string
                  description: Constraints on the port
      responses:
        '201':
          description: Port created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Port'
        '401':
          description: Not authenticated
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Model not found
        '500':
          description: Server error
components:
  schemas:
    Port:
      type: object
      properties:
        label:
          type: string
          description: The label of the part
        constraints:
          type: array
          items:
            type: string
          description: The constraints on the port
        notes:
          type: string
          description: Additional notes about the port
      required:
        - label
        - constraints
      description: A port belonging to a part in the model
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````