Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ti-infinite/GSMApplication/llms.txt

Use this file to discover all available pages before exploring further.

API Rules are tenant-scoped records that define how the GSM Application integration engine (exec-api) should reach external services. Each rule pairs a short identifier (ShortName) with a target URL and HTTP operation. When the operations service receives an exec-api request, it looks up the matching rule by ShortName and executes the call against the stored UrlEndPoint. This design centralises external endpoint configuration and keeps integration credentials and routing details out of client code. All five CRUD endpoints live under the /api/application/v1/integrations/api-rules path. The idApiRule path parameter is an integer primary key as stored in the ApiRules table (db_ms schema).

List All API Rules

Retrieve every API rule configured for the current tenant.

Endpoint

GET /api/application/v1/integrations/api-rules

Authentication

Authorization
string
required
Bearer token. Format: Bearer <token>

Response

success
boolean
required
true on success.
message
string
required
Status message.
data
array
List of API rule objects.

Example

curl --request GET \
  --url 'https://your-gateway.example.com/api/application/v1/integrations/api-rules' \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "message": "API rules retrieved.",
  "data": [
    {
      "idApi": 1,
      "shortName": "ERP_STOCK_QUERY",
      "descr": "Query live stock levels from ERP",
      "urlEndPoint": "https://erp.internal.example.com/api/stock/query",
      "operation": "POST"
    }
  ],
  "errorType": null,
  "traceId": "00-1a2b3c4d5e6f7a08-01",
  "details": null
}

Get API Rule by ID

Retrieve a single API rule by its integer ID.

Endpoint

GET /api/application/v1/integrations/api-rules/{idApiRule}

Path Parameters

idApiRule
integer
required
The integer primary key of the API rule to retrieve.

HTTP Status Codes

CodeMeaning
200 OKRule found and returned.
401 UnauthorizedToken missing or invalid.
404 Not FoundNo rule exists with the given idApiRule.

Example

curl --request GET \
  --url 'https://your-gateway.example.com/api/application/v1/integrations/api-rules/1' \
  --header 'Authorization: Bearer <token>'

Create API Rule

Create a new API rule for the current tenant.

Endpoint

POST /api/application/v1/integrations/api-rules

Request Body

shortName
string
required
A unique short identifier for this rule within the tenant (max 100 chars, ASCII). This is the key used by exec-api to locate the rule at runtime.
descr
string
Optional description explaining the purpose of the rule (max 200 chars, ASCII).
urlEndPoint
string
required
The full URL of the external endpoint this rule targets (max 500 chars).
operation
string
required
HTTP verb to use when calling the external endpoint. Accepted values: GET, POST, PUT, PATCH, DELETE (max 10 chars, ASCII).

HTTP Status Codes

CodeMeaning
200 OKRule created. data contains the persisted ApiRule including the generated idApi.
400 Bad RequestRequired fields missing or invalid (e.g. duplicate shortName).
401 UnauthorizedToken missing or invalid.

Example

curl --request POST \
  --url 'https://your-gateway.example.com/api/application/v1/integrations/api-rules' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "shortName": "ERP_STOCK_QUERY",
    "descr": "Query live stock levels from ERP",
    "urlEndPoint": "https://erp.internal.example.com/api/stock/query",
    "operation": "POST"
  }'
{
  "success": true,
  "message": "API rule created successfully.",
  "data": {
    "idApi": 4,
    "shortName": "ERP_STOCK_QUERY",
    "descr": "Query live stock levels from ERP",
    "urlEndPoint": "https://erp.internal.example.com/api/stock/query",
    "operation": "POST"
  },
  "errorType": null,
  "traceId": "00-1a2b3c4d5e6f7a08-03",
  "details": null
}

Update API Rule

Replace the fields of an existing API rule identified by its integer ID.

Endpoint

PUT /api/application/v1/integrations/api-rules/{idApiRule}

Path Parameters

idApiRule
integer
required
The integer primary key of the rule to update.

Request Body

Same fields as Create API Rule — all fields in ApiRuleDTO are replaced on the stored record.
shortName
string
required
Updated short identifier.
descr
string
Updated description (optional).
urlEndPoint
string
required
Updated external endpoint URL.
operation
string
required
Updated HTTP method.

HTTP Status Codes

CodeMeaning
200 OKRule updated. data contains the updated ApiRule.
400 Bad RequestRequest body is invalid.
401 UnauthorizedToken missing or invalid.
404 Not FoundNo rule exists with the given idApiRule.

Example

curl --request PUT \
  --url 'https://your-gateway.example.com/api/application/v1/integrations/api-rules/4' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "shortName": "ERP_STOCK_QUERY",
    "descr": "Query live stock levels from ERP v2",
    "urlEndPoint": "https://erp.internal.example.com/api/v2/stock/query",
    "operation": "POST"
  }'

Delete API Rule

Permanently remove an API rule. Any exec-api invocations that reference the deleted rule’s ShortName will subsequently fail with a 404.

Endpoint

DELETE /api/application/v1/integrations/api-rules/{idApiRule}

Path Parameters

idApiRule
integer
required
The integer primary key of the rule to delete.

HTTP Status Codes

CodeMeaning
200 OKRule deleted successfully.
401 UnauthorizedToken missing or invalid.
404 Not FoundNo rule exists with the given idApiRule.

Example

curl --request DELETE \
  --url 'https://your-gateway.example.com/api/application/v1/integrations/api-rules/4' \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "message": "API rule deleted successfully.",
  "data": null,
  "errorType": null,
  "traceId": "00-1a2b3c4d5e6f7a08-05",
  "details": null
}

Common HTTP Status Codes

CodeMeaning
200 OKOperation completed. Inspect success field to confirm outcome.
400 Bad RequestValidation failure or constraint violation.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundThe requested idApiRule does not exist.

Integration with exec-api

API rules created here are consumed by the Operations service exec-api endpoint (POST /api/operations/v1/integrations/exec-api). When exec-api receives a request, it resolves the target endpoint using the UrlEndPoint and Operation stored in the matching rule. See the exec-api reference for full details on how to invoke a rule from client code.

Build docs developers (and LLMs) love