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

# Import a crew from YAML

> Create a crew from a YAML file exported from this or another
deployment. The new crew is private and yours. Its agents are registry
references, so each one must exist in this registry and be one you may
use; otherwise the import is refused and nothing is created.



## OpenAPI

````yaml post /api/crew-templates/import
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/import:
    post:
      tags:
        - Crew templates
      summary: Import a crew from YAML
      description: |-
        Create a crew from a YAML file exported from this or another
        deployment. The new crew is private and yours. Its agents are registry
        references, so each one must exist in this registry and be one you may
        use; otherwise the import is refused and nothing is created.
      operationId: import_template_api_crew_templates_import_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/api__routers__crew_templates_router__ImportRequest
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewTemplateResponse'
        '422':
          description: Not a crew file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    api__routers__crew_templates_router__ImportRequest:
      properties:
        yaml:
          type: string
          title: Yaml
          description: The file's text, as `GET /{id}/export` wrote it.
      type: object
      required:
        - yaml
      title: ImportRequest
      description: A crew to create from a YAML file.
    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.
        current_version:
          type: integer
          title: Current Version
          description: The version new runs of this crew use.
          default: 1
        version_saved_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Saved At
          description: When the current version was saved (`ISO 8601`).
        affected_schedules:
          items:
            type: string
          type: array
          title: Affected Schedules
          description: >-
            On a save that made a new version: ids of the schedules that will
            run it from now on.
      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
    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.
        defaults:
          anyOf:
            - $ref: '#/components/schemas/CrewDefaults'
            - type: 'null'
          description: Limits and approval rules the crew's tasks follow by default.
      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.
    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.
        name:
          type: string
          maxLength: 200
          title: Name
          description: Short name shown for the task.
          default: ''
        tools:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tools
          description: >-
            Names of the tools this task may call, a subset of its agent's
            tools. Null means every tool the agent has. A task can narrow what
            its agent may use, never widen it.
        approval:
          additionalProperties:
            type: string
            enum:
              - auto
              - ask
          type: object
          title: Approval
          description: >-
            Tool name to `ask` (a person approves each call) or `auto`. A tool
            not listed follows the crew default.
        max_execution_time:
          anyOf:
            - type: integer
              maximum: 86400
              minimum: 1
            - type: 'null'
          title: Max Execution Time
          description: Seconds this task may run. Null follows the crew default.
        max_tool_calls:
          anyOf:
            - type: integer
              maximum: 10000
              minimum: 1
            - type: 'null'
          title: Max Tool Calls
          description: Tool calls this task may make. Null follows the crew default.
        output_format:
          type: string
          enum:
            - text
            - json
          title: Output Format
          description: Whether the task's output is text or JSON.
          default: text
        human_checkpoint:
          type: boolean
          title: Human Checkpoint
          description: Wait for a person to approve before this task starts.
          default: false
      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.
    CrewDefaults:
      properties:
        max_execution_time:
          anyOf:
            - type: integer
              maximum: 86400
              minimum: 1
            - type: 'null'
          title: Max Execution Time
          description: Seconds one task may run.
        max_tool_calls:
          anyOf:
            - type: integer
              maximum: 10000
              minimum: 1
            - type: 'null'
          title: Max Tool Calls
          description: Tool calls one task may make.
        max_iterations:
          anyOf:
            - type: integer
              maximum: 1000
              minimum: 1
            - type: 'null'
          title: Max Iterations
          description: Agent steps one task may take.
        approval_tools:
          items:
            type: string
          type: array
          title: Approval Tools
          description: Tools that need a person's approval in every task.
        notify_on_failure:
          type: boolean
          title: Notify On Failure
          description: Tell the run's owner when a run fails.
          default: true
      type: object
      title: CrewDefaults
      description: Limits and rules every task of a crew follows unless it sets its own.
    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.