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

# Trigger force run

> Use when you need to run a scheduled export immediately (e.g. on-demand report or catch-up). Supports optional custom time range.



## OpenAPI

````yaml /api-reference/openapi.json post /tasks/scheduled/{id}/run
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /tasks/scheduled/{id}/run:
    post:
      tags:
        - Scheduled Tasks
      summary: Trigger force run
      description: >-
        Use when you need to run a scheduled export immediately (e.g. on-demand
        report or catch-up). Supports optional custom time range.
      operationId: triggerScheduledTaskRun
      parameters:
        - name: id
          in: path
          description: Scheduled Task ID
          required: true
          schema:
            type: string
      requestBody:
        description: Optional start and end time for custom range
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerForceRunRequest'
        required: false
      responses:
        '200':
          description: Returns workflow details and time range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerForceRunResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TriggerForceRunRequest:
      type: object
      properties:
        end_time:
          type: string
          format: date-time
        start_time:
          type: string
          format: date-time
    TriggerForceRunResponse:
      type: object
      properties:
        end_time:
          type: string
          format: date-time
        message:
          type: string
        mode:
          type: string
          description: '"custom" or "automatic"'
        start_time:
          type: string
          format: date-time
        workflow_id:
          type: string
    errors.ErrorResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - not_found
            - already_exists
            - version_conflict
            - validation_error
            - invalid_operation
            - permission_denied
            - http_client_error
            - database_error
            - system_error
            - internal_error
            - service_unavailable
        details:
          type: object
          additionalProperties:
            type: object
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````