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

# Execute Stateless AI Action



## OpenAPI

````yaml post /api/v2/execute/
openapi: 3.1.0
info:
  title: Zapier AI Actions API V2
  version: 1.0.0
  description: ''
servers:
  - url: https://actions.zapier.com
security: []
paths:
  /api/v2/execute/:
    post:
      tags:
        - execution
      summary: Execute Stateless AI Action
      operationId: api_execute_execute_stateless_action
      parameters:
        - in: query
          name: provider_id
          schema:
            description: >-
              Provider ID for AI Actions. If you don't know what your provider
              ID is, [please contact
              support](https://nla.zapier.app/_z/embed/page/clh5sdteo0001ml0pdz8a2aqr?&)
            title: Provider Id
            type: string
          required: false
          description: >-
            Provider ID for AI Actions. If you don't know what your provider ID
            is, [please contact
            support](https://nla.zapier.app/_z/embed/page/clh5sdteo0001ml0pdz8a2aqr?&)
        - in: query
          name: token_budget
          schema:
            default: 1000
            description: >

              DEPRECATED: This field is kept temporarily for compatibility.

              Maximum number of
              [tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)
              to use for each field.


              When this limit is exceeded in the response from the execution,
              values will be truncated to fit inside of it.


              If this is increased too much, running an action may fail if its
              results get outside of the context window of the LLM.
            title: Token Budget
            type: integer
          required: false
          description: >

            DEPRECATED: This field is kept temporarily for compatibility.

            Maximum number of
            [tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)
            to use for each field.


            When this limit is exceeded in the response from the execution,
            values will be truncated to fit inside of it.


            If this is increased too much, running an action may fail if its
            results get outside of the context window of the LLM.
        - in: query
          name: preview_only
          schema:
            default: false
            description: >

              If this is true, then the action will not actually be executed and
              instead the resolved params will come back.
            title: Preview Only
            type: boolean
          required: false
          description: >

            If this is true, then the action will not actually be executed and
            instead the resolved params will come back.
        - in: query
          name: skip_param_guessing
          schema:
            default: false
            description: >

              If set to `True`, AI Actions will make a direct invocation call
              without attempting to guess params.


              When `skip_param_guessing` is `True`, all params must be set to
              either 'locked' or 'ignored' mode.

              Otherwise, an error will be raised.


              Note: `skip_param_guessing` is mutually exclusive with
              `preview_only`. When `skip_param_guessing` is `True`,
              `preview_only` must be `False`, and vice versa.
            title: Skip Param Guessing
            type: boolean
          required: false
          description: >

            If set to `True`, AI Actions will make a direct invocation call
            without attempting to guess params.


            When `skip_param_guessing` is `True`, all params must be set to
            either 'locked' or 'ignored' mode.

            Otherwise, an error will be raised.


            Note: `skip_param_guessing` is mutually exclusive with
            `preview_only`. When `skip_param_guessing` is `True`, `preview_only`
            must be `False`, and vice versa.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StatelessExecuteRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - AccessPointApiKeyHeader: []
        - AccessPointOAuth: []
components:
  schemas:
    StatelessExecuteRequest:
      additionalProperties: true
      properties:
        instructions:
          description: >-

            `instructions` should be plain English instructions about how to run
            the action


            For example, "Send a message with a joke about pirates delivering
            pizza to the #general Slack channel"
                    
          title: Instructions
          type: string
        params:
          additionalProperties:
            $ref: '#/components/schemas/ParamConstraint'
          description: >

            `params` can be used to give AI Actions specific values, or hints
            for how to guess values.


            Inside of the `params` object, each key should be the `key` of a
            specific need.


            Inside of the value for each need, you can set a `mode` and a
            `value`.



            #### `"mode": "locked"`


            A `mode` of `locked` means that when running the action, AI Actions
            will use the **exact** value provided inside of `value`.


            This is useful when the user has selected a specific value for a
            prefill, or has entered a specific value like a string.


            For example, if you know ahead of time the _exact ID_ of a Slack
            channel that you want to send a message to and you're using the
            `SlackAPI`'s `channel_message` action:


            ```json

            {
                "params": {
                    "channel": {
                        "mode": "locked",
                        "value": "CHANNEL_ID"
                    }
                }
            }

            ```


            #### `"mode": "guess"`


            When using a `mode` of `guess`, AI Actions will use the `value` to
            try and figure out what to use for the need.


            This is useful when you only have a text description of a need's
            value, but don't know its actual ID.


            For example, if you provide the following for the `SlackAPI` API's
            `channel_message` action:


            ```json

            {
                "params": {
                    "channel": {
                        "mode": "guess",
                        "value": "#general"
                    }
                }
            }

            ```


            Behind the scenes, when AI Actions runs the action it will look
            through all of the available fields for the `channel` prefill (the
            same list you would get from the [Get Prefill
            Choices](https://docs.zapier.com/ai-actions/how-tos/action-info/prefill-choices)
            endpoint) and choose the one that best semantically matches the
            `value` provided.


            #### `"mode": "choose_from"`


            When using a `mode` of `choose_from`, the `value` must be a list of
            values to choose from.


            The values must be an array of exact IDs from the [Get Prefill
            Choices](https://docs.zapier.com/ai-actions/how-tos/action-info/prefill-choices)
            endpoint.


            Using an array of values is useful if the user wants to choose from
            i.e. a list of Slack channels that they want to send a message to
            based on the instructions.


            For example,


            ```json

            {
                "params": {
                    "channel": {
                        "mode": "guess",
                        "value": ["CHANNEL_ID", "ANOTHER_CHANNEL_ID"]
                    }
                }
            }

            ```


            Behind the scenes, when AI Actions goes to run the action it will
            look up the label of the provided IDs and choose th one that makes
            the most sense based off of the provided instructions.
          title: Params
          type: object
        app:
          description: >

            The app to use (i.e. `SlackAPI` or `GoogleSheetsV2API`).


            From the [Search Apps](/docs/api-reference/actions/search-apps) or
            [Search Actions](/docs/api-reference/actions/search-actions)
            endpoint.
          title: App
          type: string
        action:
          description: >

            The action to run (i.e. `direct_message` or `add_row`).


            From the [App Details](/docs/api-reference/actions/get-app-details)
            or [Search Actions](/docs/api-reference/actions/search-actions)
            endpoint.
          title: Action
          type: string
        action_type:
          allOf:
            - $ref: '#/components/schemas/ActionType'
          default: write
          description: >

            The type of the action to run (most likely `write` or `search`).


            From the [App Details](/docs/api-reference/actions/get-app-details)
            or [Search Actions](/docs/api-reference/actions/search-actions)
            endpoint.
        authentication_id:
          anyOf:
            - type: integer
            - type: 'null'
          description: >

            The authentication to use for the app.


            From the [List Authentications for
            App](/docs/api-reference/actions/list-authentications-for-app)
            endpoint.
          title: Authentication Id
        account_id:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-

            Zapier account ID to use when running the action.


            Some Zapier users may have multiple accounts under the same Zapier
            user.
                    
            If no `account_id` is provided here, then the account that they're
            currently logged into on Zapier.com will be the one that is used
            when running the action.
          title: Account Id
      required:
        - instructions
        - app
        - action
      title: StatelessExecuteRequest
      type: object
    ExecuteResponse:
      properties:
        execution_log_id:
          description: >

            ID of the execution log.
                                              
            This can be used with the [Rate Execution
            Log](/docs/api-reference/execution/rate-execution-log) endpoint to
            give feedback on the execution.


            We frequently monitor this feedback!
          title: Execution Log Id
          type: string
        action_used:
          description: The name of the action that was executed.
          title: Action Used
          type: string
        input_params:
          description: The parameters that were passed into the API.
          title: Input Params
          type: object
        resolved_params:
          anyOf:
            - type: object
            - type: 'null'
          description: >

            The resolved parameters for the action.


            If `preview_only` is `true`, this will be the parameters that the AI
            would have used to run the action if it were not a preview.

            If `preview_only` is `false`, these are the parameters that the AI
            used to run the action.
          title: Resolved Params
        results:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: |-

            Results of the action after it ran.

            This will be an empty list if `preview_only` is `true`.
                    
          title: Results
        full_results:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          description: >-
            DEPRECATED: Use `results` instead. This field is kept temporarily
            for compatibility.
          title: Full Results
        result_field_labels:
          anyOf:
            - type: object
            - type: 'null'
          description: Human readable labels for some of the keys in the result.
          title: Result Field Labels
        status:
          default: success
          description: |

            The status of the execution.

            - `success`: The action was executed successfully.
            - `error`: The action failed to execute, see `error` field.
            - `empty`: The action was not executed.
            - `preview`: The action was previewed.
          enum:
            - success
            - error
            - empty
            - preview
          title: Status
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: The error message if the execution failed.
          title: Error
      required:
        - execution_log_id
        - action_used
        - input_params
      title: ExecuteResponse
      type: object
    ErrorResponse:
      additionalProperties: true
      properties:
        error:
          description: Error message.
          title: Error
          type: string
      required:
        - error
      title: ErrorResponse
      type: object
    ParamConstraint:
      properties:
        mode:
          $ref: '#/components/schemas/ConstraintMode'
        value:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Value
      required:
        - mode
      title: ParamConstraint
      type: object
    ActionType:
      enum:
        - read
        - write
        - search
        - read_bulk
      title: ActionType
      type: string
    ConstraintMode:
      enum:
        - locked
        - guess
        - choose_from
        - ignored
      title: ConstraintMode
      type: string
  securitySchemes:
    AccessPointApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    AccessPointOAuth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize/
          tokenUrl: /oauth/token/
          scopes:
            nla:exposed_actions:execute: Run AI Actions
            openid: OpenID Connect scope

````