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

# Create an agent from existing skills



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/agents
openapi: 3.1.0
info:
  title: n:lead Scheduling Bridge — Internal API
  version: 0.4.0
  description: >-
    Internal API of the n:lead scheduling bridge: the process endpoints that
    drive the day-ahead pipeline (aggregate, publish the open position, submit
    schedules, generate forecasts, orchestrate), the operator console endpoints,
    and the read-only operator-app endpoints under /v1/mobile. The process and
    console endpoints require the process API key, /v1/mobile a device key of
    the mobile scope; not for customer use.
servers:
  - url: https://{host}
    description: Deployed service
    variables:
      host:
        default: api.energy.nlead.ch
        description: >-
          The service hostname - n:lead provides it (see the Base URL on the API
          introduction page)
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/process/agents:
    post:
      summary: Create an agent from existing skills
      operationId: post_agent_v1_process_agents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Post Agent V1 Process Agents Post
        '409':
          description: The slug exists.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    AgentCreateRequest:
      properties:
        slug:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{1,40}$
          title: Slug
        name:
          type: string
          maxLength: 80
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 200
          title: Description
          default: ''
        goal:
          type: string
          maxLength: 2000
          title: Goal
          default: ''
        skills:
          items:
            type: string
          type: array
          minItems: 1
          title: Skills
        rules:
          type: string
          maxLength: 20000
          title: Rules
          default: ''
        autonomy:
          type: string
          enum:
            - propose
            - act_with_approval
            - act
          title: Autonomy
          default: propose
        enabled:
          type: boolean
          title: Enabled
          default: true
        triggers:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Triggers
        behaviour:
          additionalProperties: true
          type: object
          title: Behaviour
        order:
          type: integer
          maximum: 1000
          minimum: 0
          title: Order
          default: 200
      type: object
      required:
        - slug
        - name
        - skills
      title: AgentCreateRequest
      description: A new agent from existing skills.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.