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

# Run custom crew

> Run a custom crew from a full CrewConfig inline.

The custom crew returns a `correlation_id` that you can also poll using `GET /api/events/{cid}`
for real-time progress or `GET /api/crews/results/{cid}` for the
final result.



## OpenAPI

````yaml post /api/crews/run/custom
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/crews/run/custom:
    post:
      tags:
        - Crews
      summary: Run custom crew
      description: >-
        Run a custom crew from a full CrewConfig inline.


        The custom crew returns a `correlation_id` that you can also poll using
        `GET /api/events/{cid}`

        for real-time progress or `GET /api/crews/results/{cid}` for the

        final result.
      operationId: run_custom_crew_api_crews_run_custom_post
      parameters:
        - name: x-correlation-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Correlation-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrewRunCustomRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewRunResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    CrewRunCustomRequest:
      properties:
        crew_config:
          $ref: '#/components/schemas/CrewConfig'
        task_input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Input
      type: object
      required:
        - crew_config
      title: CrewRunCustomRequest
      description: 'Advanced mode: run a custom crew from a full CrewConfig.'
    CrewRunResponse:
      properties:
        correlation_id:
          type: string
          title: Correlation Id
        status:
          $ref: '#/components/schemas/CrewRunStatusEnum'
          default: pending
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      required:
        - correlation_id
      title: CrewRunResponse
      description: Response returned after a crew run starts.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CrewConfig:
      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
      type: object
      required:
        - agents
        - tasks
      title: CrewConfig
      description: Configuration model for a CrewAI crew with agents and tasks.
    CrewRunStatusEnum:
      type: string
      enum:
        - pending
        - running
        - completed
        - failed
      title: CrewRunStatusEnum
    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 unique identifier for the agent.
        role:
          type: string
          title: Role
          description: The agent's role or job title within the crew.
        goal:
          type: string
          title: Goal
          description: The primary objective the agent should achieve.
        backstory:
          type: string
          title: Backstory
          description: Background context that shapes the agent's behavior.
        verbose:
          type: boolean
          title: Verbose
          description: Whether to enable detailed logging output.
          default: false
        allow_delegation:
          type: boolean
          title: Allow Delegation
          description: Whether the agent can delegate tasks to others.
          default: false
        tools:
          items:
            type: string
          type: array
          title: Tools
          description: >-
            Explicit tool ids to grant this agent, drawn from the unified tool
            catalog (GET /api/tools/catalog). Combined with tool_categories as a
            union. When both are empty the agent receives the default crew
            toolset (backward compatible).
        tool_categories:
          items:
            type: string
          type: array
          title: Tool Categories
          description: >-
            Catalog category keys whose tools should all be granted to this
            agent (e.g. "trino", "data_quality").
        use_default_mcps:
          type: boolean
          title: Use Default Mcps
          description: Whether to automatically load tools from MCP servers.
          default: true
      type: object
      required:
        - role
        - goal
        - backstory
      title: AgentConfig
      description: Configuration model for a CrewAI agent with role, goals, and tools.
    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: ''
        tools:
          items:
            type: string
          type: array
          title: Tools
          description: List of additional tool names specific to this task.
      type: object
      required:
        - description
      title: TaskConfig
      description: >-
        Configuration model for a CrewAI task with description and agent
        assignment.
  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

````