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

# Preview rule test fields

> Preview test fields for an unsaved Rulebook flow configuration.

Derives test fields from a flow configuration payload without requiring the rule to be saved first. Use this while building or editing a rule draft.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `read` scope.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body parameters

<ParamField body="flowConfig" type="object" required>
  Rulebook flow configuration to inspect.
</ParamField>

## Response

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/hc-rules/test-fields/preview/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
    "flowConfig": {
      "name": "Example",
      "value": "message"
    }
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api-prod.usefini.com/v2/hc-rules/test-fields/preview/public', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer fini_your_api_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    'flowConfig': {
      'name': 'Example',
      'value': 'message'
    }
  }
    )
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api-prod.usefini.com/v2/hc-rules/test-fields/preview/public",
      headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
      json={
      "flowConfig": {
          "name": "Example",
          "value": "message"
      }
  },
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "contextFields": [
      {
        "path": "message.text",
        "dataType": "string"
      },
      {
        "path": "user.email",
        "dataType": "string"
      }
    ],
    "operatorTypes": [
      "==",
      "!=",
      "contains"
    ],
    "quantifierTypes": [
      "ANY",
      "ALL",
      "NONE"
    ]
  }
  ```
</ResponseExample>

Returns an array of test field definitions.
