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

# Activities

> Get your trading activity history

## Authentication

Read authentication required — `X-Public-Key` header.

## Query parameters

<ParamField query="type" type="string">
  Filter activities by category. Accepted values:

  | Filter   | Activity types included                                                                                                                                                 |
  | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `buys`   | `BUY_MARKET_ORDER_CREATED`, `BUY_TRADE_FILL`                                                                                                                            |
  | `sells`  | `SELL_MARKET_ORDER_CREATED`, `SELL_TRADE_FILL`                                                                                                                          |
  | `limits` | `BUY_LIMIT_ORDER_CREATED`, `SELL_LIMIT_ORDER_CREATED`, `BUY_LIMIT_ORDER_CANCELLED`, `SELL_LIMIT_ORDER_CANCELLED`, `BUY_LIMIT_ORDER_EXPIRED`, `SELL_LIMIT_ORDER_EXPIRED` |
  | `payout` | `PAYOUT_WIN`, `PAYOUT_LOSS`                                                                                                                                             |

  When no filter is provided, all activity types are returned except `BUY_TRADE_FILL` and `SELL_TRADE_FILL`.
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number.
</ParamField>

<ParamField query="size" type="integer" default="20">
  Results per page.
</ParamField>

## Activity types

Each activity in the response has a `type` field with one of the following values:

| Type                         | Description                             |
| ---------------------------- | --------------------------------------- |
| `BUY_MARKET_ORDER_CREATED`   | A market buy order was placed           |
| `SELL_MARKET_ORDER_CREATED`  | A market sell order was placed          |
| `BUY_LIMIT_ORDER_CREATED`    | A limit buy order was placed            |
| `SELL_LIMIT_ORDER_CREATED`   | A limit sell order was placed           |
| `BUY_LIMIT_ORDER_CANCELLED`  | A limit buy order was cancelled         |
| `SELL_LIMIT_ORDER_CANCELLED` | A limit sell order was cancelled        |
| `BUY_LIMIT_ORDER_EXPIRED`    | A limit buy order expired               |
| `SELL_LIMIT_ORDER_EXPIRED`   | A limit sell order expired              |
| `BUY_TRADE_FILL`             | A buy order was filled via trade match  |
| `SELL_TRADE_FILL`            | A sell order was filled via trade match |
| `PAYOUT_WIN`                 | Payout received for a winning position  |
| `PAYOUT_LOSS`                | Market resolved against your position   |
| `BUY_REFUND`                 | Refund issued for a buy order           |

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://relay.bayse.markets/v1/pm/activities?type=buys&page=1&size=20" \
    -H "X-Public-Key: pk_live_abcdef123456"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://relay.bayse.markets/v1/pm/activities?type=buys&page=1&size=20',
    { headers: { 'X-Public-Key': 'pk_live_abcdef123456' } }
  );
  const activities = await response.json();
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      'https://relay.bayse.markets/v1/pm/activities',
      params={'type': 'buys', 'page': 1, 'size': 20},
      headers={'X-Public-Key': 'pk_live_abcdef123456'},
  )
  activities = resp.json()
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://relay.bayse.markets/v1/pm/activities", nil)
  q := req.URL.Query()
  q.Add("type", "buys")
  q.Add("page", "1")
  q.Add("size", "20")
  req.URL.RawQuery = q.Encode()
  req.Header.Set("X-Public-Key", "pk_live_abcdef123456")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

Returns a paginated list of your trading activities across all markets.

### Response fields

<ResponseField name="activities" type="array">
  <Expandable title="Activity object">
    <ResponseField name="id" type="string">Activity ID.</ResponseField>
    <ResponseField name="type" type="string">Activity type (see [Activity types](#activity-types)).</ResponseField>
    <ResponseField name="eventId" type="string">Event ID.</ResponseField>
    <ResponseField name="marketId" type="string">Market ID.</ResponseField>
    <ResponseField name="outcomeId" type="string">Outcome ID.</ResponseField>
    <ResponseField name="orderId" type="string">Order ID (if applicable).</ResponseField>
    <ResponseField name="settlementId" type="string">Settlement ID (if applicable).</ResponseField>
    <ResponseField name="transactionId" type="string">Transaction ID (if applicable).</ResponseField>
    <ResponseField name="eventType" type="string">Event type.</ResponseField>
    <ResponseField name="eventTitle" type="string">Event title.</ResponseField>
    <ResponseField name="marketTitle" type="string">Market title.</ResponseField>
    <ResponseField name="outcome" type="string">Outcome name (e.g. `"YES"`, `"NO"`).</ResponseField>
    <ResponseField name="resolvedOutcome" type="string">Resolved outcome (for payout activities).</ResponseField>
    <ResponseField name="currency" type="string">Currency code (e.g. `"USD"`, `"NGN"`).</ResponseField>
    <ResponseField name="amount" type="string">Order amount.</ResponseField>
    <ResponseField name="fee" type="string">Fee charged.</ResponseField>
    <ResponseField name="size" type="string">Number of shares.</ResponseField>
    <ResponseField name="filledSize" type="string">Filled share quantity (limit orders).</ResponseField>
    <ResponseField name="remainingSize" type="string">Remaining share quantity (limit orders).</ResponseField>
    <ResponseField name="price" type="string">Order price.</ResponseField>
    <ResponseField name="avgFillPrice" type="string">Average fill price (limit orders).</ResponseField>
    <ResponseField name="totalCost" type="string">Total cost of the order.</ResponseField>
    <ResponseField name="currencyBaseMultiplier" type="string">Currency base multiplier.</ResponseField>
    <ResponseField name="status" type="string">Order status.</ResponseField>
    <ResponseField name="expiresAt" type="string">Expiration timestamp (limit orders with GTD).</ResponseField>
    <ResponseField name="payout" type="string">Payout amount (for `PAYOUT_WIN`).</ResponseField>
    <ResponseField name="amountSpent" type="string">Amount spent before cancellation/expiry (buy limit orders).</ResponseField>
    <ResponseField name="amountRefunded" type="string">Amount refunded on cancellation/expiry (buy limit orders).</ResponseField>
    <ResponseField name="amountEarned" type="string">Amount earned before cancellation/expiry (sell limit orders).</ResponseField>
    <ResponseField name="sharesReturned" type="string">Shares returned on cancellation/expiry (sell limit orders).</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  <Expandable title="Pagination object">
    <ResponseField name="page" type="integer">Current page number.</ResponseField>
    <ResponseField name="size" type="integer">Results per page.</ResponseField>
    <ResponseField name="lastPage" type="integer">Last page number.</ResponseField>
    <ResponseField name="totalCount" type="integer">Total number of activities.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "activities": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "type": "BUY_MARKET_ORDER_CREATED",
        "eventId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "outcomeId": "d4e5f6a7-b8c9-0123-def1-234567890123",
        "orderId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
        "eventType": "SINGLE",
        "imageUrl": "https://example.com/image.png",
        "eventTitle": "Will BTC reach $100k by March 2026?",
        "marketTitle": "Bitcoin Price Prediction",
        "outcome": "YES",
        "currency": "USD",
        "amount": "100",
        "fee": "2",
        "size": "138.21",
        "price": "0.7235",
        "totalCost": "102",
        "currencyBaseMultiplier": "1",
        "status": "FILLED",
        "createdAt": "2026-02-17T12:00:00Z",
        "updatedAt": "2026-02-17T12:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "size": 20,
      "lastPage": 4,
      "totalCount": 73
    }
  }
  ```
</ResponseExample>
