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

# Accept an agent update

> Pin one of the template's agents to a newer approved version. A newer
version is never applied on its own; this is how the owner takes it.



## OpenAPI

````yaml post /api/crew-templates/{template_id}/accept-update
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/crew-templates/{template_id}/accept-update:
    post:
      tags:
        - Crew templates
      summary: Accept an agent update
      description: |-
        Pin one of the template's agents to a newer approved version. A newer
        version is never applied on its own; this is how the owner takes it.
      operationId: accept_update_api_crew_templates__template_id__accept_update_post
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the crew template.
            title: Template Id
          description: ID of the crew template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewTemplateResponse'
        '403':
          description: Only the template's owner can accept updates.
        '404':
          description: Template or agent not found.
        '409':
          description: Not a newer approved version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    AcceptUpdateRequest:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
          description: The registry agent or context pack to move.
        version:
          type: string
          title: Version
          description: The approved version to pin instead.
      type: object
      required:
        - artifact_id
        - version
      title: AcceptUpdateRequest
      description: >-
        Move a template's pinned agent or context pack to another approved
        version.
    CrewTemplateResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique ID for the template.
        name:
          type: string
          title: Name
          description: Human-readable name for the template.
        description:
          type: string
          title: Description
          description: What the template does.
        crew_config:
          $ref: '#/components/schemas/CrewConfig-Output'
          description: The crew configuration saved in this template.
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Tags for categorizing the template.
        variables:
          items:
            $ref: '#/components/schemas/TemplateVariable'
          type: array
          title: Variables
          description: >-
            Declared inputs the template's tasks reference as `{placeholders}`.
            Empty for a free-form template.
        is_shared:
          type: boolean
          title: Is Shared
          description: >-
            True if every user can see this template, false if only its creator
            can.
        created_by:
          type: string
          title: Created By
          description: Keycloak username of whoever created the template.
        updated_by:
          type: string
          title: Updated By
          description: Keycloak username of whoever last updated the template.
        created_at:
          type: string
          title: Created At
          description: >-
            Creation time of the template. Represented as an `ISO 8601`
            timestamp.
        updated_at:
          type: string
          title: Updated At
          description: >-
            Last update time of the template. Represented as an `ISO 8601`
            timestamp.
        pins:
          items:
            $ref: '#/components/schemas/TemplatePin'
          type: array
          title: Pins
          description: >-
            The registry versions this template pins, with whether a newer
            approved version is available and anything that stops it running.
        lint_warnings:
          items:
            type: string
          type: array
          title: Lint Warnings
          description: >-
            Authoring-time warnings about drift between the declared variables
            and the ``{placeholders}`` referenced by tasks. Surfaced on create
            or update. Usually empty on read.
      type: object
      required:
        - id
        - name
        - description
        - crew_config
        - tags
        - is_shared
        - created_by
        - updated_by
        - created_at
        - updated_at
      title: CrewTemplateResponse
      description: Response model for a crew template returned from the API.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CrewConfig-Output:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Optional unique identifier for the crew.
        agents:
          items:
            $ref: '#/components/schemas/AgentConfig'
          type: array
          title: Agents
          description: List of agent configurations that make up the crew.
        tasks:
          items:
            $ref: '#/components/schemas/TaskConfig'
          type: array
          title: Tasks
          description: List of task configurations the crew executes.
        verbose:
          type: boolean
          title: Verbose
          description: Whether to enable detailed logging output.
          default: false
        process:
          type: string
          title: Process
          description: Execution process type for tasks.
          default: sequential
        layout:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Layout
          description: Positions of the crew builder's canvas nodes. Presentation only.
        context_packs:
          items:
            $ref: '#/components/schemas/shared__models__crew_models__PackRef'
          type: array
          maxItems: 10
          title: Context Packs
          description: >-
            Context packs every agent in the crew loads, pinned. A shared crew
            may use only Global packs.
        repository:
          anyOf:
            - $ref: '#/components/schemas/RepositoryEnvelope'
            - type: 'null'
          description: >-
            Repositories this crew may read, and what a run may do with them
            without asking. Null means no repository access at all.
      type: object
      required:
        - agents
        - tasks
      title: CrewConfig
      description: Configuration model for a CrewAI crew with agents and tasks.
    TemplateVariable:
      properties:
        name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          title: Name
          description: >-
            The ``{placeholder}`` key in task descriptions. ``snake_case``, must
            be a valid Python identifier.
        label:
          type: string
          maxLength: 200
          minLength: 1
          title: Label
          description: Human-readable label rendered in the run form.
        description:
          type: string
          maxLength: 2000
          title: Description
          description: Optional help text shown under the form field.
          default: ''
        type:
          type: string
          enum:
            - string
            - text
            - number
            - integer
            - boolean
            - select
            - multi_select
            - domain
            - dataset
            - table
            - tag
            - glossary_term
            - document
          title: Type
          description: Drives the portal widget and backend coercion.
          default: string
        required:
          type: boolean
          title: Required
          description: When True, run requests must supply a value.
          default: true
        default:
          anyOf:
            - {}
            - type: 'null'
          title: Default
          description: >-
            Optional default value applied when the runner omits this variable.
            Coerced to the declared ``type``.
        choices:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Choices
          description: Allowed values for ``select`` / ``multi_select`` types.
        min_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Min Length
        max_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Length
        min_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Value
        max_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Value
        sensitive:
          type: boolean
          title: Sensitive
          description: >-
            When ``True``, portal masks the input as a password field and the
            backend redacts the value from any logged run record.
          default: false
        group:
          anyOf:
            - type: string
            - type: 'null'
          title: Group
          description: Optional bucket name. The portal renders fields in grouped sections.
        show_if:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Show If
          description: >-
            Optional conditional visibility. The portal hides the field unless
            every named variable currently has the listed value. For example,
            ``{"federated": true}``.
      type: object
      required:
        - name
        - label
      title: TemplateVariable
      description: |-
        One declared input on a user-saved crew template.

        Variables are the contract between the template author and the
        runner: the author lists the ``{placeholder}`` keys their tasks
        reference and the metadata the portal needs to render a form.
        The runner supplies values, which the backend validates against
        this spec before kicking off the crew.
    TemplatePin:
      properties:
        agent_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Index
          description: The crew agent this pin is, or None for its tools and skills.
        artifact_id:
          type: string
          title: Artifact Id
        kind:
          type: string
          title: Kind
          description: '`agent`, `tool`, `skill` or `context_pack`.'
        name:
          type: string
          title: Name
        scope:
          type: string
          title: Scope
          description: '`tenant` (Global) or `personal`.'
        pinned_version:
          type: string
          title: Pinned Version
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: The pinned version's status.
        latest_approved_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Approved Version
        update_available:
          type: boolean
          title: Update Available
          default: false
        blocked_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Blocked Reason
          description: Why this pin stops the crew from running, if it does.
      type: object
      required:
        - artifact_id
        - kind
        - name
        - scope
        - pinned_version
      title: TemplatePin
      description: One registry version a crew template uses.
    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
    AgentConfig:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Optional identifier for the agent within the crew.
        ref:
          anyOf:
            - $ref: '#/components/schemas/AgentRef'
            - type: 'null'
          description: >-
            The registry agent version this crew runs. Required. A newer
            approved version is offered as an update, never applied on its own.
        role:
          type: string
          title: Role
          description: The pinned agent's role. Display only.
          default: ''
        goal:
          type: string
          title: Goal
          description: The pinned agent's goal. Display only.
          default: ''
        backstory:
          type: string
          title: Backstory
          description: The pinned agent's backstory. Display only.
          default: ''
      type: object
      title: AgentConfig
      description: |-
        One agent of a crew: a pinned registry agent version.

        Crews are built only from registry agents (``ref``). Role, goal and
        backstory are filled from the pinned version in responses, for
        display; values sent in a request are ignored.
    TaskConfig:
      properties:
        description:
          type: string
          title: Description
          description: Detailed description of what the task should accomplish.
        agent_index:
          type: integer
          title: Agent Index
          description: Index of the agent in the crew's agent list to handle this task.
          default: 0
        expected_output:
          type: string
          title: Expected Output
          description: Description of the expected task output format.
          default: ''
        context:
          items:
            type: integer
          type: array
          title: Context
          description: >-
            Indexes of earlier tasks whose output this task receives as context.
            Each must be lower than this task's own index.
      type: object
      required:
        - description
      title: TaskConfig
      description: >-
        Configuration model for a CrewAI task with description and agent
        assignment.
    shared__models__crew_models__PackRef:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
          description: The registry context pack's artifact ID.
        version:
          type: string
          title: Version
          description: The exact version to load, e.g. `2.1.0`.
        token_budget:
          anyOf:
            - type: integer
              minimum: 100
            - type: 'null'
          title: Token Budget
          description: Lower the pack's own token budget for this crew. Never higher.
      type: object
      required:
        - artifact_id
        - version
      title: PackRef
      description: A pinned context pack on a crew, applied to every agent in it.
    RepositoryEnvelope:
      properties:
        repos:
          items:
            $ref: '#/components/schemas/RepositoryRef'
          type: array
          maxItems: 10
          title: Repos
          description: >-
            The repositories this crew may read, each pinned to a reviewed
            registry version. Empty means no repository access.
        branch_prefix:
          type: string
          maxLength: 40
          title: Branch Prefix
          description: >-
            Every branch a proposal creates starts with this. The rest of the
            name is generated, never taken from a model.
          default: nx1/
        max_files:
          type: integer
          maximum: 50
          minimum: 1
          title: Max Files
          description: Most files one proposal may touch.
          default: 5
        max_lines:
          type: integer
          maximum: 5000
          minimum: 1
          title: Max Lines
          description: Most changed lines one proposal may carry.
          default: 200
        may_open_pr:
          type: boolean
          title: May Open Pr
          description: >-
            Once a person approves a proposal, open a pull request for it. Off
            leaves the approved patch on a branch.
          default: true
        may_comment:
          type: boolean
          title: May Comment
          description: >-
            Comment on an existing pull request. Outward-facing even though it
            changes no code, so it is off unless asked for.
          default: false
      type: object
      title: RepositoryEnvelope
      description: |-
        What a run may do with a repository without asking anyone.

        The ceiling is a stored proposal: a patch a person then approves. The
        envelope only narrows how large that patch may be and whether a pull
        request may follow from it. It cannot widen anything — merging,
        force-pushing, deleting a branch, changing CI configuration and
        triggering a pipeline have no tool at all, so no setting here reaches
        them.

        Anything outside these bounds is refused at the tool and reported to
        the run, rather than silently trimmed: a patch cut down to fit the
        caps is not the change the agent meant to make.
    AgentRef:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
          description: The registry agent's artifact ID.
        version:
          type: string
          title: Version
          description: The exact version to run, e.g. `1.4.2`.
      type: object
      required:
        - artifact_id
        - version
      title: AgentRef
      description: A pinned registry agent version.
    RepositoryRef:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
          description: The registry code repository's artifact ID.
        version:
          type: string
          title: Version
          description: The exact version to use, e.g. `1.2.0`.
      type: object
      required:
        - artifact_id
        - version
      title: RepositoryRef
      description: A pinned `code_repo` registry version a crew may read.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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