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

# Set action availability

> Requires actions:write. Prefer mode=off (unavailable), playground (Playground only), or active (live and Playground). Never combine mode with active/playgroundOnly/allowInPlayground. Legacy switches remain accepted; old HTTP live-only configurations read as legacy_live_only until explicitly changed. Collection and Sheets require current revision; HTTP has no revision. Availability is separate from draft publication, business scope and HTTP test consent. Versioned families preserve immutable versions; unsupported switches are rejected.



## OpenAPI

````yaml /openapi.json patch /actions/{actionId}/state
openapi: 3.0.3
info:
  title: Visito M2M API
  version: 1.0.0
  description: >-
    Tenant-scoped server-to-server API for channels, conversations, commerce,
    custom AI tools, and WhatsApp templates. Send operations are asynchronous
    and return queued acknowledgements. Expansion adds conversation controls,
    knowledge, sales opportunities, delivery status, reporting, and signed
    webhooks.
servers:
  - url: https://platform-api.visitoai.com/m2m/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Channels
  - name: Conversations
  - name: Commerce
  - name: Custom tools
  - name: WhatsApp templates
  - name: Properties
  - name: Knowledge
  - name: Sales CRM
  - name: Delivery
  - name: Reporting
  - name: Webhooks
paths:
  /actions/{actionId}/state:
    patch:
      tags:
        - Actions
      summary: Set action availability
      description: >-
        Requires actions:write. Prefer mode=off (unavailable), playground
        (Playground only), or active (live and Playground). Never combine mode
        with active/playgroundOnly/allowInPlayground. Legacy switches remain
        accepted; old HTTP live-only configurations read as legacy_live_only
        until explicitly changed. Collection and Sheets require current
        revision; HTTP has no revision. Availability is separate from draft
        publication, business scope and HTTP test consent. Versioned families
        preserve immutable versions; unsupported switches are rejected.
      operationId: setActionState
      parameters:
        - name: actionId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetActionStateRequest'
      responses:
        '200':
          description: Successful action operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionConfigurationResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  schemas:
    SetActionStateRequest:
      type: object
      additionalProperties: false
      properties:
        revision:
          type: integer
          minimum: 1
        active:
          type: boolean
        playgroundOnly:
          type: boolean
        allowInPlayground:
          type: boolean
        mode:
          type: string
          enum:
            - 'off'
            - playground
            - active
          description: >-
            off: unavailable; playground: Playground only; active: live channels
            and Playground. Do not combine mode with legacy state fields.
      anyOf:
        - required:
            - active
        - required:
            - playgroundOnly
        - required:
            - allowInPlayground
        - required:
            - mode
      not:
        anyOf:
          - required:
              - mode
              - active
          - required:
              - mode
              - playgroundOnly
          - required:
              - mode
              - allowInPlayground
    ActionConfigurationResponse:
      type: object
      additionalProperties: false
      properties:
        action:
          $ref: '#/components/schemas/ActionConfiguration'
      required:
        - action
    ActionConfiguration:
      oneOf:
        - type: object
          additionalProperties: false
          properties:
            actionId:
              type: string
            family:
              type: string
              enum:
                - http
            revision:
              type: integer
              minimum: 1
              nullable: true
            supportedOperations:
              type: array
              items:
                type: string
                enum:
                  - configuration
                  - update
                  - state
                  - lifecycle
                  - delete
                  - test
            state:
              $ref: '#/components/schemas/ActionState'
            configuration:
              $ref: '#/components/schemas/Tool'
          required:
            - actionId
            - family
            - revision
            - supportedOperations
            - state
            - configuration
        - type: object
          additionalProperties: false
          properties:
            actionId:
              type: string
            family:
              type: string
              enum:
                - collection
            revision:
              type: integer
              minimum: 1
              nullable: true
            supportedOperations:
              type: array
              items:
                type: string
                enum:
                  - configuration
                  - update
                  - state
                  - lifecycle
                  - delete
                  - test
            state:
              $ref: '#/components/schemas/ActionState'
            configuration:
              $ref: '#/components/schemas/CollectionConfiguration'
            signingSecret:
              type: string
              description: >-
                One-time secret returned only by a mutation that creates a
                signing key; never on reads.
          required:
            - actionId
            - family
            - revision
            - supportedOperations
            - state
            - configuration
        - type: object
          additionalProperties: false
          properties:
            actionId:
              type: string
            family:
              type: string
              enum:
                - sheets
            revision:
              type: integer
              minimum: 1
              nullable: true
            supportedOperations:
              type: array
              items:
                type: string
                enum:
                  - configuration
                  - update
                  - state
                  - lifecycle
                  - delete
                  - test
            state:
              $ref: '#/components/schemas/ActionState'
            configuration:
              $ref: '#/components/schemas/SheetsConfiguration'
          required:
            - actionId
            - family
            - revision
            - supportedOperations
            - state
            - configuration
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: M2M_AUTH_INSUFFICIENT_SCOPE
            message:
              type: string
            details:
              type: object
              additionalProperties: true
      example:
        error:
          code: M2M_AUTH_INSUFFICIENT_SCOPE
          message: M2M credential does not have required scope.
          details:
            requiredScopes:
              - conversations:write
            missingScopes:
              - conversations:write
    ActionState:
      type: object
      additionalProperties: false
      properties:
        active:
          type: boolean
        playgroundOnly:
          type: boolean
        status:
          type: string
          enum:
            - draft
            - published
            - paused
            - archived
        allowInPlayground:
          type: boolean
        mode:
          type: string
          enum:
            - 'off'
            - playground
            - active
            - legacy_live_only
          description: >-
            Computed availability. legacy_live_only preserves existing HTTP live
            access without Playground access until explicitly changed.
      required:
        - active
    Tool:
      type: object
      required:
        - toolId
        - tenantId
        - name
        - description
        - parameters
        - endpoint
        - auth
        - active
        - readOnly
        - allowInPlayground
        - propertyIds
        - createdAt
        - updatedAt
      properties:
        toolId:
          type: string
        tenantId:
          type: string
        name:
          type: string
        description:
          type: string
        parameters:
          type: object
          additionalProperties: true
        endpoint:
          $ref: '#/components/schemas/ToolEndpoint'
        auth:
          type: object
          required:
            - type
            - configured
          properties:
            type:
              type: string
              enum:
                - none
                - bearer
                - api_key
            headerName:
              type: string
            secretLastFour:
              type: string
            configured:
              type: boolean
        active:
          type: boolean
        readOnly:
          type: boolean
        allowInPlayground:
          type: boolean
        propertyIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        mode:
          type: string
          enum:
            - 'off'
            - playground
            - active
            - legacy_live_only
          description: >-
            Computed availability. legacy_live_only preserves existing HTTP live
            access without Playground access until explicitly changed.
        playgroundOnly:
          type: boolean
        configurationVersion:
          type: string
          nullable: true
          description: >-
            Current configuration timestamp. Confirm this exact version for each
            write-capable direct HTTP test.
        scopeMode:
          type: string
          enum:
            - tenant
            - businesses
          description: >-
            tenant applies throughout this workspace and requires empty
            propertyIds; businesses uses explicitly selected active business
            IDs. Omission preserves legacy scope semantics. Scope is not an
            execution permission.
    CollectionConfiguration:
      type: object
      additionalProperties: false
      properties:
        actionId:
          type: string
        revision:
          type: integer
          minimum: 1
        version:
          type: integer
          minimum: 0
        status:
          type: string
          enum:
            - draft
            - published
            - paused
            - archived
        active:
          type: boolean
        playgroundOnly:
          type: boolean
        draft:
          $ref: '#/components/schemas/CollectionDefinition'
        published:
          $ref: '#/components/schemas/CollectionDefinition'
        webhookUrl:
          type: string
        hasBearer:
          type: boolean
        mode:
          type: string
          enum:
            - 'off'
            - playground
            - active
          description: >-
            Computed availability. legacy_live_only preserves existing HTTP live
            access without Playground access until explicitly changed.
      required:
        - actionId
        - revision
        - version
        - status
        - active
        - playgroundOnly
        - draft
        - webhookUrl
        - hasBearer
    SheetsConfiguration:
      type: object
      additionalProperties: false
      properties:
        actionId:
          type: string
        revision:
          type: integer
          minimum: 1
        version:
          type: integer
          minimum: 1
        active:
          type: boolean
        playgroundOnly:
          type: boolean
        definition:
          $ref: '#/components/schemas/SheetsDefinition'
        mode:
          type: string
          enum:
            - 'off'
            - playground
            - active
          description: >-
            Computed availability. legacy_live_only preserves existing HTTP live
            access without Playground access until explicitly changed.
        operations:
          type: array
          maxItems: 3
          items:
            type: object
            additionalProperties: false
            properties:
              name:
                type: string
              readOnly:
                type: boolean
              inputSchema:
                type: object
                additionalProperties: true
            required:
              - name
              - readOnly
              - inputSchema
      required:
        - actionId
        - revision
        - version
        - active
        - playgroundOnly
        - definition
    ToolEndpoint:
      type: object
      required:
        - url
        - method
      properties:
        url:
          type: string
          format: uri
        method:
          type: string
          enum:
            - GET
            - POST
        timeoutMs:
          type: integer
          minimum: 500
          maximum: 30000
      additionalProperties: false
    CollectionDefinition:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        whenToUse:
          type: string
          maxLength: 1000
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ActionField'
          maxItems: 20
        propertyIds:
          type: array
          items:
            type: string
            maxLength: 120
            minLength: 1
          maxItems: 50
          uniqueItems: true
        scopeMode:
          type: string
          enum:
            - tenant
            - businesses
          description: >-
            tenant applies throughout this workspace and requires empty
            propertyIds; businesses uses explicitly selected active business
            IDs. Omission preserves legacy scope semantics. Scope is not an
            execution permission.
      required:
        - name
        - whenToUse
        - fields
        - propertyIds
    SheetsDefinition:
      oneOf:
        - $ref: '#/components/schemas/LegacySheetsDefinition'
        - $ref: '#/components/schemas/SheetsPermissionDefinition'
    ActionField:
      type: object
      additionalProperties: false
      properties:
        key:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          maxLength: 48
        description:
          type: string
          maxLength: 300
        type:
          type: string
          enum:
            - text
            - email
            - phone
            - date
            - number
            - integer
            - boolean
            - single-select
            - multi-select
        required:
          type: boolean
        choices:
          type: array
          items:
            type: string
            maxLength: 80
          maxItems: 30
      required:
        - key
        - description
        - type
        - required
    LegacySheetsDefinition:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        whenToUse:
          type: string
          maxLength: 1000
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ActionField'
          maxItems: 20
        propertyIds:
          type: array
          items:
            type: string
            maxLength: 120
            minLength: 1
          maxItems: 50
          uniqueItems: true
        production:
          $ref: '#/components/schemas/SheetsTarget'
        test:
          $ref: '#/components/schemas/SheetsTarget'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/SheetsStep'
          minItems: 1
          maxItems: 5
        scopeMode:
          type: string
          enum:
            - tenant
            - businesses
          description: >-
            tenant applies throughout this workspace and requires empty
            propertyIds; businesses uses explicitly selected active business
            IDs. Omission preserves legacy scope semantics. Scope is not an
            execution permission.
        schemaVersion:
          type: integer
          enum:
            - 1
        executionPolicy:
          type: string
          enum:
            - legacy
      required:
        - name
        - whenToUse
        - fields
        - propertyIds
        - production
        - test
        - steps
    SheetsPermissionDefinition:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        whenToUse:
          type: string
          maxLength: 1000
        scopeMode:
          type: string
          enum:
            - tenant
            - businesses
          description: >-
            tenant applies throughout this workspace and requires empty
            propertyIds; businesses uses explicitly selected active business
            IDs. Omission preserves legacy scope semantics. Scope is not an
            execution permission.
        propertyIds:
          type: array
          items:
            type: string
            maxLength: 120
            minLength: 1
          maxItems: 50
          uniqueItems: true
        schemaVersion:
          type: integer
          enum:
            - 2
        executionPolicy:
          type: string
          enum:
            - columns
        production:
          $ref: '#/components/schemas/SheetsPermissionTarget'
        test:
          $ref: '#/components/schemas/SheetsPermissionTarget'
        columns:
          type: array
          items:
            $ref: '#/components/schemas/SheetsPermissionColumn'
          minItems: 1
          maxItems: 30
        identifyingColumns:
          type: array
          items:
            type: string
          maxItems: 5
          uniqueItems: true
        recordId:
          oneOf:
            - type: object
              additionalProperties: false
              properties:
                columnId:
                  type: string
                generation:
                  type: string
                  enum:
                    - input
                    - visito
              required:
                - columnId
                - generation
            - type: object
              additionalProperties: false
              properties:
                generation:
                  type: string
                  enum:
                    - columns
                columnIds:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 5
                  uniqueItems: true
              required:
                - generation
                - columnIds
      required:
        - schemaVersion
        - name
        - whenToUse
        - propertyIds
        - production
        - columns
        - identifyingColumns
    SheetsTarget:
      type: object
      additionalProperties: false
      properties:
        connectionId:
          type: string
          minLength: 1
          maxLength: 160
        spreadsheetId:
          type: string
          minLength: 1
          maxLength: 160
        tabs:
          type: object
          minProperties: 1
          maxProperties: 5
          additionalProperties:
            type: object
            additionalProperties: false
            properties:
              sheetId:
                type: integer
                minimum: 0
              keyColumn:
                type: string
                minLength: 1
                maxLength: 160
              columns:
                type: array
                items:
                  type: string
                  minLength: 1
                  maxLength: 160
                minItems: 1
                maxItems: 30
                uniqueItems: true
            required:
              - sheetId
              - keyColumn
              - columns
      required:
        - connectionId
        - spreadsheetId
        - tabs
    SheetsStep:
      type: object
      additionalProperties: false
      properties:
        operation:
          type: string
          enum:
            - add
            - update
        tab:
          type: string
        ownership:
          type: string
          enum:
            - conversation
            - constrained
        selector:
          type: object
          additionalProperties: false
          properties:
            column:
              type: string
            equals:
              $ref: '#/components/schemas/SheetsBinding'
            from:
              type: string
            until:
              type: string
          required:
            - column
        expected:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              column:
                $ref: '#/components/schemas/SheetsColumn'
              value:
                $ref: '#/components/schemas/SheetsValue'
            required:
              - column
              - value
          maxItems: 30
        changes:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              column:
                $ref: '#/components/schemas/SheetsColumn'
              value:
                $ref: '#/components/schemas/SheetsBinding'
            required:
              - column
              - value
          minItems: 1
          maxItems: 30
      required:
        - operation
        - tab
        - changes
    SheetsPermissionTarget:
      type: object
      additionalProperties: false
      properties:
        connectionId:
          type: string
          minLength: 1
          maxLength: 160
        spreadsheetId:
          type: string
          minLength: 1
          maxLength: 160
        sheetId:
          type: integer
          minimum: 0
        headerRow:
          type: integer
          enum:
            - 1
      required:
        - connectionId
        - spreadsheetId
        - sheetId
    SheetsPermissionColumn:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          maxLength: 48
        header:
          type: string
          minLength: 1
          maxLength: 160
        type:
          type: string
          enum:
            - text
            - email
            - phone
            - date
            - number
            - integer
            - boolean
            - single-select
        permissions:
          type: object
          additionalProperties: false
          properties:
            read:
              type: boolean
            update:
              type: boolean
            create:
              type: boolean
          required:
            - read
            - update
            - create
        requiredOnCreate:
          type: boolean
        valueSource:
          type: string
          enum:
            - input
            - sheet
        choices:
          type: array
          items:
            type: string
            maxLength: 80
          maxItems: 30
          uniqueItems: true
      required:
        - id
        - header
        - type
        - permissions
        - requiredOnCreate
        - valueSource
    SheetsBinding:
      oneOf:
        - type: object
          additionalProperties: false
          properties:
            input:
              type: string
          required:
            - input
        - type: object
          additionalProperties: false
          properties:
            value:
              $ref: '#/components/schemas/SheetsValue'
          required:
            - value
        - type: object
          additionalProperties: false
          properties:
            generated:
              type: boolean
              enum:
                - true
          required:
            - generated
    SheetsColumn:
      oneOf:
        - type: string
        - type: object
          additionalProperties: false
          properties:
            input:
              type: string
            choices:
              type: object
              additionalProperties:
                type: string
          required:
            - input
            - choices
    SheetsValue:
      oneOf:
        - type: string
          maxLength: 1000
        - type: number
        - type: boolean
  responses:
    Error:
      description: Structured error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Visito M2M API key
      description: Server-side tenant-scoped credential created from Build > API Keys.

````

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