---
updatedAt: 2025-06-09T23:42:20.000Z
agentTools:
  projectIndex: https://docs.tarabut.com/llms.txt
---

# Get Risk Flags

Provide insights into potential financial risks associated with an account, helping users or financial institutions identify behaviours or patterns that might be concerning

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Risk",
    "description": "APIs for the Tarabut Gateway sandbox environment. Before you begin, please create the 'clientId' and 'clientSecret' from Tarabut Gateway Dev Portal.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.sau.sandbox.tarabutgateway.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your access token generated from the [Create Access Token](https://docs.tarabut.com/v2.0/reference/createaccesstokenv2) endpoint, the access token will contain `X-TG-CustomerUserId` that was added when the token was generated"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/insights/v1/risk-flags/{accountId}": {
      "get": {
        "tags": [
          "Risk"
        ],
        "summary": "Get Risk Flags",
        "description": "Provide insights into potential financial risks associated with an account, helping users or financial institutions identify behaviours or patterns that might be concerning",
        "operationId": "getRiskFlags",
        "x-explorer-enabled": false,
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Specify the body format to JSON format",
              "default": "application/json"
            },
            "required": true
          },
          {
            "name": "months",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "maximum": 6,
              "minimum": 1,
              "description": "Defines the length of the transaction history the risk flags will be scanning for, which can be any number of months from 1 to 6. If you don't specify a period, it will automatically be set to 3 months by default",
              "default": 3
            }
          },
          {
            "name": "flags",
            "in": "query",
            "schema": {
              "type": "array",
              "description": "All risk flags will be returned if not defined, e.g. `neg_balanace`, `gambling`",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "schema": {
              "type": "string",
              "description": "The `accountId` that has been returned on the [Get Accounts](https://docs.tarabut.com/v2.0/reference/getaccountsv2) endpoint"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "format": "date",
                      "description": "Start date of the financial risk result"
                    },
                    "to": {
                      "type": "string",
                      "format": "date",
                      "description": "End date of the financial risk result"
                    },
                    "accountId": {
                      "type": "string",
                      "description": "Unique account ID (generated by TG)"
                    },
                    "accountProductType": {
                      "type": "string",
                      "description": "The type of account product, e.g. `account` or `card`"
                    },
                    "accountCurrency": {
                      "type": "string",
                      "description": "Currency code associated with account. Supports all ISO 4217 currency codes"
                    },
                    "providerId": {
                      "type": "string",
                      "description": "Unique identifier of the financial institution (see [providers](https://docs.tarabut.com/v2.0/reference/getproviders) endpoint) to which the account belongs"
                    },
                    "riskFlags": {
                      "type": "array",
                      "description": "Array of objects contains financial risk result",
                      "items": {
                        "type": "object",
                        "description": "Object contains the details of the financial risk flag",
                        "properties": {
                          "flagId": {
                            "type": "string",
                            "description": "flag ID"
                          },
                          "flagName": {
                            "type": "string",
                            "description": "flag name"
                          },
                          "descriptionField": {
                            "type": "string",
                            "description": "flag description"
                          },
                          "value": {
                            "type": "string",
                            "description": "Value of the flag"
                          },
                          "valueType": {
                            "type": "string",
                            "description": "Data type of the value field"
                          }
                        }
                      }
                    }
                  },
                  "example": {
                    "from": "2023-02-01",
                    "to": "2023-09-30",
                    "accountId": "7eeec027-16d2-41bf-abad-70a81aabb2b3",
                    "accountProductType": "account",
                    "accountCurrency": "SAR",
                    "providerId": "BLUE",
                    "riskFlags": [
                      {
                        "flagId": "neg_balanace",
                        "flagName": "Negative Balance Period",
                        "descriptionField": "Number of days the balance is negative",
                        "value": "-10.00",
                        "valueType": "number"
                      },
                      {
                        "flagId": "gambling",
                        "flagName": "Gambling",
                        "descriptionField": "Gambling transactions detected",
                        "value": true,
                        "valueType": "boolean"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "error name",
                      "example": "UNAUTHORIZED_ACCESS"
                    },
                    "errorMessage": {
                      "type": "string",
                      "description": "error message",
                      "example": "Access token used is expired"
                    },
                    "traceId": {
                      "type": "string",
                      "description": "Tracing Id used when you contact support",
                      "example": "278827398026513417"
                    },
                    "details": {
                      "type": "array",
                      "description": "The array contains details of the error",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fieldName": {
                            "type": "string",
                            "description": "Field name that has invalid input",
                            "example": "Authorization"
                          },
                          "message": {
                            "type": "string",
                            "description": "Error message of the invalid input",
                            "example": "Expired bearer token"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```