> ## Documentation Index
> Fetch the complete documentation index at: https://myco-29fc6df6-sweetmantech-myc-3925-docs-document-the-apiar.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Task

> Update an existing scheduled task. Only the id field is required; any additional fields you include will be updated on the task. The response shape matches the GET endpoint (an array containing the updated task).



## OpenAPI

````yaml PATCH /api/tasks
openapi: 3.1.0
info:
  title: Recoup API
  description: >-
    API documentation for the Recoup platform - an AI agent platform for the
    music industry
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://recoup-api.vercel.app
security:
  - apiKeyAuth: []
paths:
  /api/tasks:
    patch:
      description: >-
        Update an existing scheduled task. Only the id field is required; any
        additional fields you include will be updated on the task. The response
        shape matches the GET endpoint (an array containing the updated task).
      requestBody:
        description: Task fields to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
      responses:
        '200':
          description: Task updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TasksResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateTaskRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: UUID of the task to update
          example: aade2bce-55c7-468e-a606-c4e76fb2ea2a
        title:
          type: string
          description: New descriptive title of the task
          example: Weekly Genre Pulse Check (Updated)
        prompt:
          type: string
          description: New instruction/prompt executed by the task
          example: >-
            Execute this weekly genre analysis workflow and email a summary to
            the team.
        schedule:
          type: string
          description: New cron expression defining when the task runs
          example: 0 10 * * 4
        account_id:
          type: string
          format: uuid
          description: New UUID of the associated account
          example: 848cd58d-700f-4b38-ab4c-d9f52a1b2c3d
        artist_account_id:
          type: string
          format: uuid
          description: New UUID of the associated artist account
          example: 1873859c-dd37-4e9a-9bac-80d35a1b2c3d
        enabled:
          type: boolean
          nullable: true
          description: Whether the task is enabled. Can be true, false, or null.
          example: true
    TasksResponse:
      type: object
      required:
        - status
        - tasks
      properties:
        status:
          type: string
          enum:
            - success
            - error
          description: Status of the request
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
          description: Array of task objects
        error:
          type: string
          description: Error message (only present if status is error)
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    Task:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the task
        title:
          type: string
          description: Descriptive title or name of the task
        prompt:
          type: string
          description: Detailed instruction or prompt for task execution
        schedule:
          type: string
          description: >-
            Cron expression defining when the task should execute (e.g., '0 10 *
            * *')
        account_id:
          type: string
          format: uuid
          description: Unique identifier for the associated account
        artist_account_id:
          type: string
          format: uuid
          description: Unique identifier for the associated artist account
        enabled:
          type: boolean
          nullable: true
          description: Whether the task is enabled. Defaults to true.
        trigger_schedule_id:
          type: string
          nullable: true
          description: Identifier for the trigger schedule associated with this task
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Recoup API key. [Learn more](/quickstart#api-keys).

````