POST /api/v202604/billImportRule/generate

Generates a bill import rule definition from a natural language prompt using AI

GenerateRuleV202604 Permissions: BillProcessingRules (Manage)
Use this endpoint to create rule logic from a plain-language description of what the rule should do. The generated rule can be reviewed and then saved via POST /billImportRule.

Request Headers

Header Value Required Description
ECI-ApiKey string Yes Your API key. See Authentication.
Content-Type application/json Yes All requests must specify JSON content type, including the request body.

Request Body

BillImportRulePromptV202604
Property Description Type
prompt A natural language prompt used to generate JavaScript for a bill import rule Required string
Example Request Body application/json
{  "prompt": "string"
}

Responses

200 OK The request succeeded and the response body contains the requested data.

Response Body Parameters

BillImportRuleGenerationResponseV202604
Property Description Type
javaScript The generated JavaScript. Null if the prompt is refused string
refusalReason If set, contains the reason why the rule generation prompt was refused string
Example Response application/json
{  "javaScript": "string",  "refusalReason": "string"
}