Priority ERP API Permissions Guide

For LeonAI to read (and, where enabled, write) data in Priority, TWO separate permission layers need to be configured. This guide explains both, with the exact Priority menu path for each.

What this service needs from Priority

LeonAI connects to Priority ERP through a dedicated API user and a Personal Access Token (PAT) with read access to the required forms (and, where needed, write access too). The PAT authenticates against Priority exactly like a regular user — so it is subject to both permission layers described below. A block in EITHER layer produces the same symptom: tools can't see the data, even though the user technically "exists".
Layer 1
RESTFLAG licensing (FORMLIMITED)
The FORMLIMITED system table controls REST API access per screen (form). Every form has a RESTFLAG field — when it is set to 'Y', external applications like LeonAI can reach it via the API. Priority ships with most forms REST-disabled by default, so this is almost always the first layer that needs attention.
Priority menu path: System Administrator → System Maintenance → Licenses → Forms for Limited/API License For every form in the lists below, make sure RESTFLAG = Y.
Layer 2 — the important, undocumented one
Per-user form permissions
Even after RESTFLAG is enabled, that alone is not enough. Priority separately checks whether the SPECIFIC user who owns the PAT (not "any" user, and not "the system" in general) actually has access granted to that screen in Priority's normal user/role permission screens (Privileges / Authorizations). The PAT inherits exactly that user's own rights — it does not bypass them. This is the layer almost nobody knows about, because Priority never documents it anywhere customer-facing.
How to check: In Priority's user/permissions administration screens, find the user the PAT was created for and confirm they have a granted privilege for every screen in the lists below — exactly as if you were checking whether they could open that screen manually inside Priority itself.
The telltale sign (the most common mistake): If RESTFLAG is already enabled but you still get an HTTP 400 with this message — it is almost always Layer 2, not Layer 1:
לא ניתן להפעיל API למסך זה ("Cannot activate API for this screen")
And if the message is this one — it is the user's license, not the screen: Priority refuses every API call from this user, on every screen, so no setting of the refused screen fixes it. In the “User Permissions” form, tick “API License” for the API user, or create the access token (PAT) for a user who already has it ticked. Then test the connection again.
לא ניתן להפעיל API במסגרת סוג הרשיון של המשתמש הנוכחי

The basic forms

Every connection needs these forms, with working read access in BOTH layers. Confirm RESTFLAG=Y and per-user permission for each one, including the sales and purchase invoice lines. Then also open the forms of the business areas you work in — they are listed below.

CUSTOMERSSUPPLIERSLOGPARTFAMILY_LOGCURRENCIESSALESINVOICEITEMSPURCHASEINVOICEITEMS

Forms by business area

Open the forms of every area you want to ask about. Order lines, and the item lines inside a document, come with that document. No need to open them separately.

Sales and orders

ORDERSCPROFAGENTSPHONEBOOKPRICELIST

Customer invoices and collections

AINVOICESCINVOICESEINVOICESTINVOICESACCOUNTS_RECEIVABLEOBLIGOAGENTS

Purchasing and suppliers

PORDERSPINVOICESYINVOICESACCOUNTS_PAYABLE

Stock and warehouses

PARTBALLOGFILEWAREHOUSESDOCUMENTS_T

Shipping and receiving

DOCUMENTS_DDOCUMENTS_NDOCUMENTS_PDOCUMENTS_TDOCUMENTS_WWAREHOUSES

Accounting

FNCLOGFNCTRANSACCOUNTS

Customer service

DOCUMENTS_QSERNUMBERSPHONEBOOK

Production

SERIALDOCUMENTS_H

Optional: procedure catalogue & help text

Open these too if you want the assistant to find any procedure or report by name and read Priority's own help text. Not required for data access.

EXECEPROGEREPEFORMFORMCLMNSTITLE

Firewall allowlist

If your Priority installation sits behind a firewall, allow inbound HTTPS from these three fixed IP addresses — every call the service makes to your Priority leaves from one of them.

34.165.219.21634.165.106.634.165.236.22

The registration form and the setup wizard show the same three addresses. Dedicated (non-shared) egress addresses are an Enterprise option with a private deployment.

Quick refresher: creating a PAT

If you don't have a Personal Access Token (PAT) yet, create one at this screen in Priority:

Personal Access Tokens form (PATOKENS) — or: System Administrator → System Maintenance → System Users → REST API Authentication Tokens sub-form

Still failing after enabling it?

•Priority sometimes takes a few minutes to apply permission changes — wait a bit and try again.
•Re-run the check from the registration success page or from the LeonAI admin portal — it performs a real read against every form and shows exactly which ones are still blocked.
•Still stuck? Reach out and we'll help: info@leonai.io