2. Manage REST Users¶
The REST API identifies each caller by an application key (app key), which is passed in the HTTP header app_key. The REST server executes every request with the privileges of the database user that belongs to the key, including row and column level security.
2.1. Application Keys¶
App keys are managed automatically by the security refresh (see When Do Changes Take Effect?):
Every human user (HU) and generic user (GU) gets an app key. Technical users (TU) cannot use the REST API.
When a user is dropped or no longer classified as HU or GU, the key is removed.
The keys are stored in SCURTY.REP_REST_USERS, which is only accessible to the Security Manager. The keys survive a database clone, as they are saved by redctl preclone (see the RED-PSS Guide).
Example: Show the App Keys of All REST Users
1SELECT USER_NAME, APP_KEY
2FROM SCURTY.REP_REST_USERS
3ORDER BY USER_NAME;
Each user can read their own key in the self-service view SCURTY.USER_CONTEXT (column API_KEY):
Example: Read the Own App Key
1SELECT API_KEY FROM SCURTY.USER_CONTEXT;
2.2. Use the REST API¶
The documentation of all endpoints is available at https://<red-server>:<gu_port>/docs. A call passes the key in the header:
Example: Call a Monitoring Endpoint
curl -H "app_key: <app key>" https://<red-server>:<gu_port>/mon/object_status
Important
The generic SQL endpoint executes any SQL statement with the privileges of the user. Grant REST users only the roles they need, and protect app keys like passwords. For batch integrations, use a dedicated generic user (GU) with exactly the required object groups.