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

# Toggle workflow status (not imported apps)

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Toggles a workflow between `active` and `inactive`, based on whichever it currently is.

Pass `status=active` or `status=inactive` to set a specific status. Repeating the same target also finishes any pending hook policy synchronization after a failed request.

If you omit `status`, this flips the current status; two calls in a row land you back where you started.

For ordinary workflows, pausing removes the schedule and stops the trigger. For before-action workflows (hooks), pausing turns the rule off: the protected app operation proceeds as if no hook existed until the hook is active again.

Starting a workflow again requires a plan that includes workflows, but pausing doesn't, so a workspace that has lost the capability can still stop a workflow it can no longer start.

Archived workflows cannot be toggled. Restore one first with [Restore workflow (not imported apps)](/api-reference/restore-workflow-not-imported-apps).

Toggling in either direction, including pausing, is only allowed from the app's main branch.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/workflows/{workflow_id}/toggle-status
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/workflows/{workflow_id}/toggle-status:
    post:
      summary: Toggle workflow status (not imported apps)
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Toggles a workflow between `active` and `inactive`, based on whichever
        it currently is.


        Pass `status=active` or `status=inactive` to set a specific status.
        Repeating the same target also finishes any pending hook policy
        synchronization after a failed request.


        If you omit `status`, this flips the current status; two calls in a row
        land you back where you started.


        For ordinary workflows, pausing removes the schedule and stops the
        trigger. For before-action workflows (hooks), pausing turns the rule
        off: the protected app operation proceeds as if no hook existed until
        the hook is active again.


        Starting a workflow again requires a plan that includes workflows, but
        pausing doesn't, so a workspace that has lost the capability can still
        stop a workflow it can no longer start.


        Archived workflows cannot be toggled. Restore one first with [Restore
        workflow (not imported
        apps)](/api-reference/restore-workflow-not-imported-apps).


        Toggling in either direction, including pausing, is only allowed from
        the app's main branch.
      operationId: >-
        toggle_workflow_status_api_apps__app_id__workflows__workflow_id__toggle_status_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose workflows you want to work with.
            title: App Id
          description: ID of the app whose workflows you want to work with.
          example: 6820f3a4e7b91d003c45a1f2
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the workflow, as returned in `id` by [List
              workflows](/api-reference/list-workflows).
            title: Workflow Id
          description: >-
            ID of the workflow, as returned in `id` by [List
            workflows](/api-reference/list-workflows).
          example: 68b1c0d4e7b91d003c45a1f2
        - name: status
          in: query
          required: false
          schema:
            enum:
              - active
              - inactive
            type: string
            description: >-
              Set this status instead of toggling. Repeat the same value to
              safely retry a hook status change.
            title: Status
          description: >-
            Set this status instead of toggling. Repeat the same value to safely
            retry a hook status change.
          example: inactive
      responses:
        '200':
          description: The workflow's new status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToggleStatusResponse'
        '400':
          description: The workflow is archived, so it cannot be toggled.
        '401':
          description: Missing or invalid credentials.
        '402':
          description: >-
            This workspace's plan does not include workflows. Upgrade to Builder
            or above.
        '403':
          description: >-
            You don't have access to this app, the app does not exist, or the
            app still runs the older automations engine instead of workflows. A
            missing app and an app you cannot reach are deliberately the same
            answer.
        '404':
          description: There is no workflow with this ID on this app.
        '409':
          description: >-
            The app is on a branch other than main. Imported apps return
            `dev_loop_managed`: workflows are not supported for this app type.
        '422':
          description: The status could not be changed. The body says why.
        '429':
          description: >-
            Rate limit exceeded. The base limit is 20 requests per minute. See
            [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
      security:
        - PersonalAccessTokenAuth:
            - full_access
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    ToggleStatusResponse:
      properties:
        workflow_id:
          type: string
          title: Workflow Id
          description: ID of the workflow.
          example: 68b1c0d4e7b91d003c45a1f2
        status:
          type: string
          title: Status
          description: >-
            The status the workflow actually landed in, which is not always the
            one you asked for.
          example: active
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: >-
            Why a restored workflow did not come back active, written for a
            person to read. This is `null` when you toggled the status yourself.
          example: The schedule already ended, so the workflow stayed inactive.
      type: object
      required:
        - workflow_id
        - status
      title: ToggleStatusResponse
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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