> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fraudeg.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FraudEG REST API Reference – Endpoints and Conventions

> Complete reference for the FraudEG REST API. Covers base URLs, authentication, request format, pagination, idempotency, and all 12 endpoints.

The FraudEG REST API gives you programmatic access to every capability in the platform — transaction scoring, identity verification, device intelligence, case management, and webhook configuration. This reference covers every endpoint, required headers, request and response shapes, and the conventions that apply across the entire API. Whether you are building a server-side risk engine or integrating fraud controls into an existing payment flow, everything you need is documented here.

## Base URL

All API requests target the following base URL:

```
https://api.fraudeg.com/v1
```

Every request must be sent over **HTTPS**. Plain HTTP requests are rejected at the network edge and will not reach FraudEG servers.

## Authentication

Authenticate by passing your API key as a Bearer token in the `Authorization` header of every request. You can generate and revoke API keys from the FraudEG dashboard under **Settings → API Keys**.

```bash theme={null}
Authorization: Bearer <API_KEY>
```

<Warning>
  Never expose your API key in client-side code, public repositories, or logs. Treat it with the same care as a password. If a key is compromised, revoke it immediately from the dashboard and issue a new one.
</Warning>

## Request Format

Send all request bodies as JSON and include the `Content-Type` header on every `POST` and `PATCH` request:

```
Content-Type: application/json
```

FraudEG ignores request bodies sent without this header, which will cause validation errors on endpoints that require a body.

## Response Format

Every response is a JSON object. All responses include a top-level `object` field that identifies the resource type returned — for example `"object": "transaction_score"` or `"object": "case"`. Inspect this field to handle responses generically across different endpoints.

## HTTP Methods

FraudEG uses standard HTTP verbs consistently across the API:

| Method   | Usage                                  |
| -------- | -------------------------------------- |
| `GET`    | Retrieve a resource or list resources  |
| `POST`   | Create a resource or trigger an action |
| `PATCH`  | Partially update an existing resource  |
| `DELETE` | Delete a resource permanently          |

## Pagination

List endpoints (such as `GET /v1/events` and `GET /v1/alerts`) use **cursor-based pagination**. This approach is stable under high write volume — pages do not shift when new records are inserted.

Pass the following query parameters to control pagination:

| Parameter | Type    | Default | Description                                                                                    |
| --------- | ------- | ------- | ---------------------------------------------------------------------------------------------- |
| `limit`   | integer | `20`    | Number of records to return. Minimum `1`, maximum `100`.                                       |
| `after`   | string  | —       | Cursor from the previous response's `next_cursor`. Omit to start from the most recent records. |

Every list response includes these fields at the top level:

| Field         | Type           | Description                                                                                                |
| ------------- | -------------- | ---------------------------------------------------------------------------------------------------------- |
| `has_more`    | boolean        | `true` if additional records exist beyond the current page.                                                |
| `next_cursor` | string \| null | Pass this value as `after` in your next request to fetch the next page. `null` when `has_more` is `false`. |

## Idempotency

Use the `Idempotency-Key` header on `POST` requests to safely retry without creating duplicate resources. FraudEG stores the result of the first request for a given key and returns that same result for any subsequent requests that carry the same key.

```
Idempotency-Key: a8f3c2d1-7b94-4e12-bc56-0f3a8e7d2c1b
```

Use a unique value per logical operation — a UUID v4 is recommended. If you send the same key with a different request body, FraudEG returns a `409 Conflict` error. Keys expire after 24 hours.

## Versioning

The current API version is **v1**, reflected in the `/v1` path prefix on all endpoints. FraudEG will not introduce breaking changes to v1 without first announcing a deprecation period and providing a migration path to any new version. Non-breaking additions — new optional fields, new endpoints, new enum values on existing fields — may be added at any time without notice.

## API Endpoints

The table below lists every endpoint available in the FraudEG API.

| Method | Endpoint                  | Description                          |
| ------ | ------------------------- | ------------------------------------ |
| `POST` | `/v1/transactions/score`  | Score a transaction for fraud risk   |
| `POST` | `/v1/transactions/verify` | Verify a payment before processing   |
| `POST` | `/v1/decisions`           | Submit or override a fraud decision  |
| `POST` | `/v1/identity/verify`     | Verify a user's identity (KYC/KYB)   |
| `GET`  | `/v1/identity/watchlist`  | Screen a user against watchlists     |
| `POST` | `/v1/device/session`      | Create a device intelligence session |
| `GET`  | `/v1/events`              | List fraud events                    |
| `GET`  | `/v1/alerts`              | List fraud alerts                    |
| `POST` | `/v1/cases`               | Create a fraud case                  |
| `GET`  | `/v1/cases/{id}`          | Retrieve a fraud case                |
| `POST` | `/v1/webhooks`            | Register a webhook endpoint          |
| `GET`  | `/v1/webhooks/{id}`       | Retrieve a webhook configuration     |

## Example Request

The following cURL example shows a complete request to the transaction scoring endpoint with all required headers:

```bash theme={null}
curl --request POST \
  --url https://api.fraudeg.com/v1/transactions/score \
  --header "Authorization: Bearer <API_KEY>" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: a8f3c2d1-7b94-4e12-bc56-0f3a8e7d2c1b" \
  --data '{
    "transaction_id": "txn_01j8kp3mxz4v5w6n7q",
    "amount": 14999,
    "currency": "USD",
    "user_id": "usr_9f2e1a3b",
    "session_id": "sess_4c7d8e2f"
  }'
```

## Explore the API

<CardGroup cols={2}>
  <Card title="Error Codes" icon="circle-exclamation" href="/api-reference/errors">
    Understand every HTTP status code and error object FraudEG returns, with retry guidance for each failure mode.
  </Card>

  <Card title="Rate Limits" icon="gauge-high" href="/api-reference/rate-limits">
    Learn the per-endpoint limits, rate limit headers, and best practices for handling 429 responses gracefully.
  </Card>

  <Card title="Score a Transaction" icon="shield-check" href="/api-reference/transactions/score">
    Deep-dive into the transaction scoring endpoint — the most commonly used endpoint in the FraudEG API.
  </Card>

  <Card title="Verify Identity" icon="id-card" href="/api-reference/identity/verify">
    Run KYC and KYB checks against a user or business using the identity verification endpoint.
  </Card>
</CardGroup>
