# Introduction

Welcome to the developer documentation for the ForePaaS API. This API provides a comprehensive suite of tools for merchants to integrate a prediction market platform into their applications. Unlike traditional exchanges, the Pari-Mutuel model is a peer-to-peer system where users trade on the outcomes of future events.

This documentation will provide you with everything you need to get started, from authentication and basic requests to advanced trading and market creation.

## Base URLs

All REST endpoints in this documentation are relative to a base URL (host). Use the environment provided to you by ForePaaS.

| Environment | Base URL                      |
| ----------- | ----------------------------- |
| Development | `https://apidev.forepass.org` |
| Production  | Provided by ForePaaS          |

## Key Capabilities

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>User Management</strong></td><td>Seamlessly authenticate and manage users from your application with JWT tokens.</td><td><a href="/pages/BWeJcUeoEaESfcdbbSBM">/pages/BWeJcUeoEaESfcdbbSBM</a></td></tr><tr><td><strong>Market Discovery</strong></td><td>Browse, search, and filter prediction markets with real-time pricing data.</td><td><a href="/pages/GkMtRpt4KedFOW6Ito1a">/pages/GkMtRpt4KedFOW6Ito1a</a></td></tr><tr><td><strong>Trading</strong></td><td>Enable users to buy and sell shares in market outcomes with instant execution.</td><td><a href="/pages/OQaTfLAZ91NZivM92F2z">/pages/OQaTfLAZ91NZivM92F2z</a></td></tr><tr><td><strong>Market Creation</strong></td><td>Allow certified creators to propose and launch new prediction markets.</td><td><a href="/pages/d8BjDxYQzj85CCAQA6Gj">/pages/d8BjDxYQzj85CCAQA6Gj</a></td></tr><tr><td><strong>Real-Time Data</strong></td><td>Use WebSockets to receive live updates on prices and market activity.</td><td><a href="/pages/DsnRQsp4Y0IYOY9vuYpI">/pages/DsnRQsp4Y0IYOY9vuYpI</a></td></tr><tr><td><strong>Settlement &#x26; Rewards</strong></td><td>Automatically settle markets and allow users to claim their winnings.</td><td><a href="/pages/OQaTfLAZ91NZivM92F2z">/pages/OQaTfLAZ91NZivM92F2z</a></td></tr></tbody></table>

{% hint style="info" %}
This API is designed for a centralized merchant model, where the merchant manages users and facilitates access to the ForePaaS platform. All user-specific actions require a JWT token obtained through the user authorization flow.
{% endhint %}

## Getting Started

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Quick Start</strong></td><td>Make your first API call in 5 minutes with our step-by-step guide.</td><td><a href="/pages/asMqybhY3nVN1UsBZBuG">/pages/asMqybhY3nVN1UsBZBuG</a></td></tr><tr><td><strong>Authentication</strong></td><td>Learn how to authenticate using API keys and RSA-SHA256 signatures.</td><td><a href="/pages/WW3bfMtyv43ajq22yyBY">/pages/WW3bfMtyv43ajq22yyBY</a></td></tr><tr><td><strong>Code Examples</strong></td><td>Complete SDK implementations in Node.js and Python with end-to-end workflows.</td><td><a href="/pages/BLtr8ip2Yn3d2Kq2qjFZ">/pages/BLtr8ip2Yn3d2Kq2qjFZ</a></td></tr><tr><td><strong>OpenAPI Spec</strong></td><td>Generate clients in 50+ languages using our OpenAPI 3.0 specification.</td><td><a href="https://github.com/gph-tech/fg-centralize-api/blob/develop/openapi.yaml">https://github.com/gph-tech/fg-centralize-api/blob/develop/openapi.yaml</a></td></tr></tbody></table>

{% hint style="success" %}
**New to prediction markets?** Start with our [Quick Start Guide](/getting-started/quick-start.md) and follow it with complete [Code Examples](/advanced/code-examples.md) in Node.js and Python.
{% endhint %}

## Pagination Standards

All paginated endpoints follow consistent patterns:

| Parameter  | Type   | Default  | Range | Description                    |
| ---------- | ------ | -------- | ----- | ------------------------------ |
| `page`     | number | 1        | 1-∞   | Page number (1-indexed)        |
| `pageSize` | number | 10 or 20 | 1-100 | Items per page (capped at 100) |

**Response fields:**

* `current` - Current page number
* `size` - Items per page
* `total` - Total number of items
* `pages` - Total number of pages
* `data` - Array of results for current page

## Time & Timezone Standards

All timestamp fields in the API follow these conventions:

| Field Type              | Format            | Timezone     | Example                                  |
| ----------------------- | ----------------- | ------------ | ---------------------------------------- |
| **Request timestamps**  | Unix milliseconds | UTC          | `1704067200000`                          |
| **Response timestamps** | ISO 8601          | UTC          | `2025-11-06T16:56:54` (or with Z suffix) |
| **Market deadlines**    | ISO 8601 or local | As specified | `2025-12-31T23:59:59Z`                   |

**Important Notes:**

* **Clock Skew Tolerance:** Request timestamps must be within **5 minutes** of server time or signature validation will fail
* **Token Expiry:** JWT tokens expire after **24 hours**
* **Synchronize Your Clock:** Use NTP or similar to ensure accurate timestamps


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forepaas.org/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
