GetbeelDocs
API referenceA I rules

Change or pause an AI rule

Changes the text, or pauses (active false) or resumes the rule; the type stays. The scope follows the rule type: invoice_scan rules take the received_invoices scopes, fattura_emessa rules the invoices scopes. Live keys only.

PATCH
/ai-rules/{id}

Changes the text, or pauses (active false) or resumes the rule; the type stays. The scope follows the rule type: invoice_scan rules take the received_invoices scopes, fattura_emessa rules the invoices scopes. Live keys only.

Authorization

apiKey
headerAuthorizationBearer <token>

API key: gb_test_… or gb_live_…

Path Parameters

id*string

Header Parameters

Getbeel-Company?string

Act on one of the account's client companies (its id from GET /companies) instead of the key's own account. 404 company_not_found when the key cannot act on it.

Formatuuid

Request Body

application/json
  1. body
text?string

The instruction, in plain language (up to 500 characters)

Length1 <= length <= 500
active?boolean

false pauses the rule without deleting it

Response Body

OK

application/json
  1. response
object*string
id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
type*string

invoice_scan: followed when the AI reads received invoices and receipts. fattura_emessa: followed when it drafts issued invoices from Stripe payments.

Value in"invoice_scan""fattura_emessa"
text*string
active*boolean

Only active rules are followed

sort_order*integer

Order in which the AI reads the rules of a type

Range-9007199254740991 <= value <= 9007199254740991
created_at*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
updated_at*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
Example Request
curl -X PATCH 'https://www.getbeel.com/api/v1/ai-rules/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "object": "ai_rule",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "type": "invoice_scan",  "text": "string",  "active": true,  "sort_order": -9007199254740991,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}