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

# Submit Rebalance

> Moves funds from one venue to another and returns an issued `rebalanceId`.



## OpenAPI

````yaml /openapi/v1.json post /v1/rebalances
openapi: 3.0.0
info:
  title: ParlayX API
  version: 1.0.0
  description: Aggregated prediction-market trading API
servers:
  - url: https://api.parlayx.com
security:
  - apiKey: []
tags:
  - name: Markets
    description: Discover markets and find cross-venue matches.
  - name: Orders
    description: Submit, inspect, and cancel orders.
  - name: Rebalances
    description: Move funds between venues and track the transfer.
  - name: Balance
    description: Read account balances and funding state.
paths:
  /v1/rebalances:
    post:
      tags:
        - Rebalances
      summary: Submit Rebalance
      description: >-
        Moves funds from one venue to another and returns an issued
        `rebalanceId`.
      operationId: submitRebalance
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Idempotency key for this request. Re-sending the same key with the
              same body returns the original result and creates no duplicate;
              re-sending it with a different body is rejected with 422.
            example: 2f1a8c4e-0b3d-4a9c-8e7f-1a2b3c4d5e6f
          required: true
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRebalanceRequest'
      responses:
        '200':
          description: Rebalance accepted
          headers:
            Idempotency-Key:
              schema:
                type: string
                description: >-
                  Echoes the request's Idempotency-Key, identifying the
                  (possibly replayed) resource this response resolved to.
                example: 2f1a8c4e-0b3d-4a9c-8e7f-1a2b3c4d5e6f
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitRebalanceResponse'
        '400':
          description: Invalid request, or a missing/malformed Idempotency-Key header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '403':
          description: API key missing, malformed, or not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              example:
                message: Forbidden
        '422':
          description: Idempotency key reused with a different request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdempotencyConflictError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >
            import { createClient } from "@parlayx/sdk";


            const client = createClient({ apiKey: process.env.PARLAYX_API_KEY!
            });


            const { rebalanceId } = await client.submitRebalance({
              sourceVenue: "polymarket",
              destinationVenue: "limitless",
              amount: 25,
            });


            console.log("submitted rebalance:", rebalanceId);
components:
  schemas:
    SubmitRebalanceRequest:
      type: object
      properties:
        sourceVenue:
          allOf:
            - $ref: '#/components/schemas/Venue'
            - description: >-
                Venue whose resting form funds the move. polymarket: pUSD on
                Polygon. limitless: USDC on Base.
        destinationVenue:
          allOf:
            - $ref: '#/components/schemas/Venue'
            - description: >-
                Venue the funds must land spendable at. Must differ from
                sourceVenue.
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Amount to move, in USDC (up to 6 decimal places). This is the amount
            that must land spendable at the destination venue; execution grosses
            up the source debit to cover bridge/swap slippage.
          example: 25
        maxSlippageBps:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9999
          description: >-
            Optional slippage-protection cap (basis points, below 10000) for the
            lossy swap/bridge steps. Defaults server-side when omitted.
          example: 200
      required:
        - sourceVenue
        - destinationVenue
        - amount
    SubmitRebalanceResponse:
      type: object
      properties:
        rebalanceId:
          type: string
          minLength: 1
          description: Issued `rebalanceId`. Stable handle for status lookups.
          example: 3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d
      required:
        - rebalanceId
    BadRequestError:
      anyOf:
        - $ref: '#/components/schemas/ApiError'
        - $ref: '#/components/schemas/IdempotencyBadRequestError'
    AuthError:
      type: object
      properties:
        message:
          type: string
          description: Plain-text explanation of the authentication error.
      required:
        - message
    IdempotencyConflictError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - IDEMPOTENCY_CONFLICT
              example: IDEMPOTENCY_CONFLICT
            message:
              type: string
              example: Idempotency key was reused with a different request body
          required:
            - code
            - message
      required:
        - error
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/ApiErrorCode'
            message:
              type: string
              description: Plain-text explanation of the error.
          required:
            - code
            - message
      required:
        - error
    Venue:
      type: string
      enum:
        - polymarket
        - limitless
        - predict_fun
      description: Source market venue (must be a supported venue)
      example: polymarket
    IdempotencyBadRequestError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/IdempotencyBadRequestErrorCode'
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    ApiErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - NOT_FOUND
        - INSUFFICIENT_BALANCE
        - IDEMPOTENCY_CONFLICT
        - ORDER_NOT_CANCELLABLE
        - INTERNAL_ERROR
      description: Stable identifier for the error category.
    IdempotencyBadRequestErrorCode:
      type: string
      enum:
        - IDEMPOTENCY_KEY_REQUIRED
        - IDEMPOTENCY_KEY_INVALID
      description: Stable identifier for the Idempotency-Key header validation failure.
      example: IDEMPOTENCY_KEY_REQUIRED
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````