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

# Modificar posición abierta

> Use the Position ticket, login and sl and/or tp. Omit to preserve; 0 removes the level; null is rejected. Returns a request ID. Entry price and volume cannot be changed.

Usa el ticket `Position` de una posición abierta y envía `login` con `sl` y/o `tp`.
No modifica el precio de apertura ni el volumen.

Omitir conserva; `0` elimina SL/TP; `null` se rechaza. Los precios son absolutos.
Requiere cuenta verificada, permiso para esta ruta e `Idempotency-Key`.
La respuesta devuelve un request ID: consulta su resultado antes de confirmar éxito.

[Flujo de modificación y ejemplos](/es/trading/modifications)


## OpenAPI

````yaml POST /api/v1/positions/{position}/modify
openapi: 3.1.0
info:
  title: API MT5 — Portal de partners
  description: >-
    Endpoints seguros para verificar la propiedad de cuentas, consultar el
    mercado y operar en cuentas previamente verificadas.
  version: 0.1.0
servers:
  - url: https://api-trading.vexprofx.com
    description: API Trading · Partners
security: []
paths:
  /api/v1/positions/{position}/modify:
    post:
      tags:
        - Trading
      summary: Modify an open position's SL and TP
      description: >-
        Use the Position ticket, login and sl and/or tp. Omit to preserve; 0
        removes the level; null is rejected. Returns a request ID. Entry price
        and volume cannot be changed.
      operationId: modify_position_api_v1_positions__position__modify_post
      parameters:
        - name: position
          in: path
          required: true
          schema:
            type: integer
            title: Posición
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 16
            maxLength: 128
            pattern: ^[A-Za-z0-9._:-]{16,128}$
            example: 550e8400-e29b-41d4-a716-446655440000
          description: >-
            Persisted key for this intent. Reuse the same key and body when
            retrying; use a new key for another trading intent, including a
            modification.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyPositionRequest'
      responses:
        '200':
          description: Respuesta satisfactoria
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: 'Respuesta: Modify an open position''s SL and TP'
        '400':
          description: Idempotency-Key ausente o inválida.
        '409':
          description: Clave reutilizada con otros datos o solicitud pendiente.
        '422':
          description: Invalid request or incompatible trading parameters.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: Invalid request
      security:
        - HTTPBearer: []
components:
  schemas:
    ModifyPositionRequest:
      properties:
        sl:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Sl
          description: >-
            Absolute Stop Loss price. Omit to preserve; 0 removes SL; null is
            rejected.
        tp:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Tp
          description: >-
            Absolute Take Profit price. Omit to preserve; 0 removes TP; null is
            rejected.
        login:
          type: integer
          exclusiveMinimum: 0
          title: Login
      additionalProperties: false
      type: object
      required:
        - login
      title: ModifyPositionRequest
      examples:
        - login: 104205
          sl: 1.095
          tp: 1.125
        - login: 104205
          sl: 0
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        Envía el token entregado por el proveedor en el encabezado Authorization
        mediante autenticación Bearer.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.