> ## 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.

# Change an agent's definition (a new version)

> Only the fields given change. Skills must exist in the registry;
triggers are ``schedule`` (``every_minutes``, 0 = every orchestrator
run, or ``cron`` with ``timezone``), ``event`` (``type``, ``where``),
``deadline`` (``clock``, ``lead_minutes``) or ``manual``.



## OpenAPI

````yaml /setup/internal-openapi.json put /v1/process/agents/{slug}
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/{slug}:
    put:
      summary: Change an agent's definition (a new version)
      description: |-
        Only the fields given change. Skills must exist in the registry;
        triggers are ``schedule`` (``every_minutes``, 0 = every orchestrator
        run, or ``cron`` with ``timezone``), ``event`` (``type``, ``where``),
        ``deadline`` (``clock``, ``lead_minutes``) or ``manual``.
      operationId: put_agent_v1_process_agents__slug__put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentChangeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Put Agent V1 Process Agents  Slug  Put
        '404':
          description: No such agent.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    AgentChangeRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 80
              minLength: 1
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Description
        goal:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Goal
        skills:
          anyOf:
            - items:
                type: string
              type: array
              minItems: 1
            - type: 'null'
          title: Skills
        rules:
          anyOf:
            - type: string
              maxLength: 20000
            - type: 'null'
          title: Rules
        autonomy:
          anyOf:
            - type: string
              enum:
                - propose
                - act_with_approval
                - act
            - type: 'null'
          title: Autonomy
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        triggers:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Triggers
        behaviour:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Behaviour
        order:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 0
            - type: 'null'
          title: Order
      type: object
      title: AgentChangeRequest
      description: |-
        What an operator may change on an agent's definition; every field
        optional, the rest stays. Validated as a whole definition.
    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.