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

# Register Heartbeat

> Register or refresh a heartbeat to auto-cancel orders on connectivity loss.



## OpenAPI

````yaml POST /heartbeat
openapi: 3.0.1
info:
  title: SX Bet API
  version: 1.0.0
  description: >-
    REST API for the SX Bet decentralized sports betting exchange. Retrieve
    sports data, markets, and orderbook information. Post, cancel, and fill
    orders with signed payloads.


    Base URLs:

    - **Mainnet**: `https://api.sx.bet`

    - **Testnet**: `https://api.toronto.sx.bet`
servers:
  - url: https://api.sx.bet
    description: Mainnet (SX Network, chainId 4162)
  - url: https://api.toronto.sx.bet
    description: Testnet (Toronto, chainId 79479957)
security: []
tags:
  - name: Connection
    description: Server metadata and heartbeat management
  - name: Sports Data
    description: Sports, leagues, teams, fixtures, and live scores
  - name: Markets
    description: Active, specific, and popular betting markets
  - name: Trades
    description: Matched trades and portfolio history
  - name: Orders
    description: Orderbook queries, posting, cancelling, and filling orders
paths:
  /heartbeat:
    post:
      tags:
        - Heartbeat
      summary: Register heartbeat
      description: >-
        To register and refresh your heartbeat with 0 > `timeoutSeconds` <=
        3600. Ping this endpoint to maintain your heartbeat after initial
        registration.
      operationId: registerHeartbeat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - requestor
                - timeoutSeconds
              properties:
                requestor:
                  type: string
                  description: The ethereum address associated with your account
                timeoutSeconds:
                  type: integer
                  description: >-
                    The number of seconds before heartbeat service times out and
                    cancels your open orders
                  minimum: 0
                  maximum: 3600
            example:
              requestor: <YOUR-ACCOUNT-ADDRESS>
              timeoutSeconds: 10
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: '`success` or `failure` if the request succeeded or not'
                  data:
                    type: object
                    properties:
                      requestor:
                        type: string
                        description: The ethereum address associated with your account
                      timeoutSeconds:
                        type: integer
                        description: >-
                          The number of seconds before heartbeat service times
                          out and cancels your open orders
                      expiresAt:
                        type: string
                        format: date-time
                        description: >-
                          A JS Date object describing when the heartbeat will
                          timeout/expire (UTC)
              example:
                status: success
                data:
                  requestor: <YOUR-ACCOUNT-ADDRESS>
                  timeoutSeconds: 10
                  expiresAt: '2024-11-12T14:35:06.614Z'
        '400':
          description: Bad request — missing or invalid `requestor` or `timeoutSeconds`
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key for authenticated endpoints. See [API
        Key](/api-reference/api-key) for how to obtain one.

````