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

# Persist trade signal

> Internal endpoint on `trade-worker`. Inserts a new trade signal
record into the `trade_signals` D1 table.




## OpenAPI

````yaml /docs/openapi-minimal.yaml post /signals
openapi: 3.0.3
info:
  title: Hoox API
  description: |
    REST API for the Hoox algorithmic trading platform.

    Ingest trade signals, check system health, and manage DeFi wallet
    operations on the Cloudflare edge. All requests are handled by the
    Hoox gateway worker (`workers/hoox`) running at the network edge.
  version: 1.0.0
  contact:
    name: Hoox Support
    email: support@hoox.sh
servers:
  - url: https://api.hoox.sh
    description: Production API
  - url: https://staging.hoox.sh
    description: Staging environment
security: []
paths:
  /signals:
    post:
      tags:
        - Signals
      summary: Persist trade signal
      description: |
        Internal endpoint on `trade-worker`. Inserts a new trade signal
        record into the `trade_signals` D1 table.
      operationId: postSignal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - symbol
                - signal_type
                - timestamp
              properties:
                symbol:
                  type: string
                  example: BTCUSDT
                signal_type:
                  type: string
                  enum:
                    - LONG
                    - SHORT
                    - CLOSE_LONG
                    - CLOSE_SHORT
                  example: LONG
                timestamp:
                  type: integer
                  description: Unix timestamp in milliseconds
                  example: 1779261050000
                source:
                  type: string
                  example: tv-webhook
                raw_data:
                  type: object
                  additionalProperties: true
      responses:
        '201':
          description: Signal created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  result:
                    type: object
                    properties:
                      signalId:
                        type: string
                        format: uuid
        '400':
          description: Missing required fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Internal authentication missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal error storing signal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        requestId:
          type: string
          format: uuid
          description: Request trace identifier
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        error:
          type: string
          description: Human-readable error description
          example: Invalid JSON payload structure.

````