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

# Create or reuse an agentic task and run it

> Creates an execution under a reusable agentic task, creating the task on first use and reusing it afterwards. This is the endpoint the Titan MCP server calls on your behalf; most integrations should use the [MCP server](/mcp/overview) rather than calling it directly. Requires executions:write plus at least one of mcp:search, mcp:fetch, mcp:crawl, or mcp:templates:run.




## OpenAPI

````yaml /openapi/task-service.yaml post /api/v1/mcp/agentic-executions
openapi: 3.0.3
info:
  title: Titan Task Service API
  description: Tasks, executions, templates, datasets, results, and media CDN.
  version: '1.0'
servers:
  - url: https://api.webscraping.titannet.io
    description: Production
security: []
tags:
  - name: Tasks
  - name: Executions
  - name: Templates
  - name: MCP
  - name: Media
paths:
  /api/v1/mcp/agentic-executions:
    post:
      tags:
        - MCP
      summary: Create or reuse an agentic task and run it
      description: >
        Creates an execution under a reusable agentic task, creating the task on
        first use and reusing it afterwards. This is the endpoint the Titan MCP
        server calls on your behalf; most integrations should use the [MCP
        server](/mcp/overview) rather than calling it directly. Requires
        executions:write plus at least one of mcp:search, mcp:fetch, mcp:crawl,
        or mcp:templates:run.
      operationId: postMCPAgenticExecution
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPAgenticExecutionRequest'
      responses:
        '202':
          description: Accepted; the execution is queued.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MCPAgenticExecutionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Missing the scope for the requested capability
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    MCPAgenticExecutionRequest:
      type: object
      required:
        - task
        - mcp_capability
        - agent_template_slug
      properties:
        task:
          $ref: '#/components/schemas/CreateTaskRequest'
        execution:
          $ref: '#/components/schemas/RunTaskRequest'
        mcp_capability:
          type: string
          description: Agent capability behind the call.
          enum:
            - search
            - fetch
            - crawl
            - template
        agent_template_slug:
          type: string
          description: Curated template slug the agent is running.
          example: titan-brave-search-v1
        target_platform:
          type: string
          description: Platform the run targets.
          example: brave
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
        data: {}
    MCPAgenticExecutionResponse:
      type: object
      properties:
        task_id:
          type: string
          format: uuid
        execution_id:
          type: string
          format: uuid
        created_task:
          type: boolean
          description: >-
            True when this call created the backing agentic task, false when it
            reused an existing one.
        task:
          type: object
        execution:
          type: object
    ErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    CreateTaskRequest:
      type: object
      required:
        - name
        - objective
        - execution_type
      properties:
        name:
          type: string
        objective:
          type: string
        execution_type:
          type: string
          enum:
            - single
            - scheduled
        urls:
          type: array
          items:
            type: string
            format: uri
        output_schema:
          type: object
        schedule:
          type: string
          description: Cron expression. Required when `execution_type` is `scheduled`.
          example: 0 6 * * 1
        platform_url:
          type: string
        keywords:
          type: string
        tags:
          type: array
          items:
            type: string
        proxy_locations:
          type: array
          items:
            type: string
        template_id:
          type: string
          format: uuid
        template_slug:
          type: string
        script_id:
          type: string
        script_version:
          type: string
        owner_required:
          type: boolean
          default: false
          description: >-
            Route every execution of this task to a worker node owned by the
            same user. Titan skips shared IP, subnet, and domain rate-limit
            controls for owner-pinned executions.
        action_type:
          type: string
          enum:
            - search
            - crawl
            - scrape
            - api_call
        input_source:
          type: string
          enum:
            - static_urls
            - previous_step
            - task_url_inventory
        limits:
          type: object
        payload: {}
        secret_payload: {}
        retry_policy:
          type: object
        execution_plan:
          type: object
    RunTaskRequest:
      type: object
      properties:
        execution_id:
          type: string
          format: uuid
          description: >-
            Reserved for the MCP integration, which generates the execution
            identifier before creating the run. Omit it in your own calls.
        script_id:
          type: string
        script_version:
          type: string
        payload: {}
        secret_payload: {}
        execution_plan:
          type: object
        owner_required:
          type: boolean
          description: >-
            Override the task's owner-pinning for this run only. See
            `CreateTaskRequest.owner_required`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````