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

# Create a task

> Creates a new task and returns its id.



## OpenAPI

````yaml POST /tasks/add
openapi: 3.1.0
info:
  title: Megaseo API
  version: 1.0.0
servers:
  - url: https://api-v2.megaseo.net/web
    description: Production
security: []
paths:
  /tasks/add:
    post:
      tags:
        - tasks
      summary: Add Task
      operationId: add_task_tasks_add_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddTaskRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddTaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AddTaskRequest:
      properties:
        access_token:
          type: string
          title: Access Token
        task_type_id:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Task Type Id
        name:
          type: string
          maxLength: 32
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 1024
          minLength: 1
          title: Description
        verification_description:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Verification Description
        keyword:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Keyword
        prompt:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Prompt
        link:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Link
        control_type:
          type: string
          enum:
            - report
            - computer_vision
          title: Control Type
        need_screenshot:
          type: boolean
          title: Need Screenshot
          default: false
        is_copyable:
          type: boolean
          title: Is Copyable
          default: false
        price_per_execution:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: >-
                ^(?!^[-+.]*$)[+-]?0*(?:\d{0,8}|(?=[\d.]{1,11}0*$)\d{0,8}\.\d{0,2}0*$)
          title: Price Per Execution
        executions_limit:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Executions Limit
        hour_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Hour Limit
          default: 0
        day_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Day Limit
          default: 0
        reservation_time:
          type: integer
          maximum: 2147483647
          minimum: 1
          title: Reservation Time
          default: 1
      type: object
      required:
        - access_token
        - task_type_id
        - name
        - description
        - control_type
        - price_per_execution
        - executions_limit
      title: AddTaskRequest
    AddTaskResponse:
      properties:
        id:
          type: integer
          title: Id
      type: object
      required:
        - id
      title: AddTaskResponse
    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

````

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