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

# Update Request

> Updates specified request



## OpenAPI

````yaml PUT /requests
openapi: 3.0.0
info:
  title: Pipevest Investment API
  description: Connecting millions of Africans to the global economy
  version: 0.0.1
servers:
  - url: https://api.pipevest.com/v1
    description: Production server
  - url: https://api.staging.pipevest.com/v1
    description: Staging server
security:
  - BearerAuth: []
paths:
  /requests:
    parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/SignatureInput'
      - $ref: '#/components/parameters/XCliendId'
    put:
      tags:
        - Requests
      summary: Updates an instrument request
      parameters:
        - $ref: '#/components/parameters/ContentDigest'
        - $ref: '#/components/parameters/XIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRequest'
      responses:
        '200':
          description: Details of a updated customer asset request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Success'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Request'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    Signature:
      in: header
      name: Signature
      schema:
        type: string
        example: 'sig1=:OTEyMjY4...A5NTNDMEQ=:'
        description: >
          Base64 encoded signed hash of the http message request components.


          [Learn how signatures
          work](/concepts/http-signature/message-signature)
      required: true
    SignatureInput:
      in: header
      name: Signature-Input
      schema:
        type: string
        example: sig1=("Content-Type" "Content-Digest"...expires=<expires>
        description: >
          An ordered list of components that make up the signature base. It is
          used to recompute and verify the `Signature`


          [Learn how signatures
          work](/concepts/http-signature/message-signature)
      required: true
    XCliendId:
      in: header
      name: X-Client-Id
      schema:
        $ref: '#/components/schemas/ClientId'
      example: client-id
      required: true
    ContentDigest:
      in: header
      name: Content-Digest
      schema:
        type: string
        example: 'sha-512=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=:'
        description: >
          Base64 encoded sha-512 hash of the http message body.


          This key isn't not required for `GET` and `DELETE` requests.


          [Learn how to generate content
          digest](/concepts/http-signature/content-digest)
      required: true
    XIdempotencyKey:
      in: header
      name: X-Idempotency-Id
      schema:
        type: string
        example: 01937261-e216-754f-99ba-c1170d65dd28
        description: >
          Unique identifier passed into each a mutable request (i.e `POST`,
          `PUT`, `PATCH`, `DELETE`)


          This key isn't not required for `GET` requests
      required: true
  schemas:
    UpdateRequest:
      type: object
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        shouldCancelRequest:
          $ref: '#/components/schemas/CancelRequest'
      required:
        - requestId
        - shouldCancelRequest
    Success:
      type: object
      properties:
        data:
          oneOf:
            - type: object
            - type: array
        code:
          $ref: '#/components/schemas/ResponseCode'
        message:
          $ref: '#/components/schemas/ResponseMessage'
      required:
        - data
        - code
        - message
    Request:
      anyOf:
        - $ref: '#/components/schemas/RequestPurchase'
        - $ref: '#/components/schemas/RequestSell'
    ClientId:
      description: Unique identifier assigned to the client
      type: string
      example: client-id
    RequestId:
      description: Unique request identifier
      type: integer
      example: 123456
    CancelRequest:
      description: Determine whether to cancel a request
      type: boolean
      example: true
    ResponseCode:
      description: Request response code
      type: string
      example: 200
    ResponseMessage:
      description: Request response message
      type: string
      example: Success
    RequestPurchase:
      type: object
      description: Purchase request entity
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        instrumentId:
          $ref: '#/components/schemas/InstrumentId'
        customerId:
          $ref: '#/components/schemas/CustomerId'
        symbol:
          $ref: '#/components/schemas/InstrumentSymbol'
        requestType:
          description: The type of request being made
          enum:
            - PURCHASE
          example: PURCHASE
        status:
          $ref: '#/components/schemas/RequestStatus'
        currency:
          $ref: '#/components/schemas/Currency'
        isRecurring:
          $ref: '#/components/schemas/IsRecurring'
        schedule:
          $ref: '#/components/schemas/Schedule'
        purchaseAmount:
          $ref: '#/components/schemas/PurchaseAmount'
        createdAt:
          $ref: '#/components/schemas/CreatedAt'
        updatedAt:
          $ref: '#/components/schemas/UpdatedAt'
      required:
        - requestId
        - instrumentId
        - symbol
        - requestType
        - purchaseAmount
        - status
        - currency
        - customerId
        - isRecurring
        - schedule
        - createdAt
        - updatedAt
    RequestSell:
      type: object
      description: Sell request entity
      properties:
        requestId:
          $ref: '#/components/schemas/RequestId'
        assetId:
          $ref: '#/components/schemas/AssetId'
        customerId:
          $ref: '#/components/schemas/CustomerId'
        symbol:
          $ref: '#/components/schemas/AssetSymbol'
        requestType:
          description: The type of request being made
          enum:
            - SELL
          example: SELL
        status:
          $ref: '#/components/schemas/RequestStatus'
        currency:
          $ref: '#/components/schemas/Currency'
        isRecurring:
          $ref: '#/components/schemas/IsRecurring'
        schedule:
          $ref: '#/components/schemas/Schedule'
        sellAmount:
          $ref: '#/components/schemas/SellAmount'
        sellPercentage:
          $ref: '#/components/schemas/SellPercentage'
        createdAt:
          $ref: '#/components/schemas/CreatedAt'
        updatedAt:
          $ref: '#/components/schemas/UpdatedAt'
      required:
        - requestId
        - assetId
        - symbol
        - requestType
        - status
        - currency
        - customerId
        - isRecurring
        - schedule
        - sellAmount
        - sellPercentage
        - createdAt
        - updatedAt
    Error:
      type: object
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/ResponseCode'
            - example: 401
        message:
          allOf:
            - $ref: '#/components/schemas/ResponseMessage'
            - example: Unauthorized
      required:
        - code
        - message
    InstrumentId:
      description: Unique instrument identifier
      type: integer
      example: 123456
    CustomerId:
      description: Unique customer identifier
      type: integer
      example: 123456
    InstrumentSymbol:
      description: The symbol associated by the instrument
      type: string
      example: APPL
    RequestStatus:
      description: The status of the request
      enum:
        - PENDING
        - COMPLETED
        - CANCELED
        - ERROR
      example: PENDING
    Currency:
      description: Associated currency
      enum:
        - USD
        - EUR
        - ZK
      example: ZK
    IsRecurring:
      description: >
        Determines whether the request should be in recurring mode


        Defaults to `false`


        Refer to [Requests documentation](/guides/requests#recurring-requests)
        to better understand how recurring works
      type: boolean
      example: false
    Schedule:
      description: |
        The recurring schedule in which the asset should be purchased or sold.

        Defaults to `ONCE`
      enum:
        - ONCE
        - DAILY
        - WEEKLY
        - BI_WEEKLY
        - MONTHLY
      example: ONCE
    PurchaseAmount:
      description: The total purchase amount for an instrument
      type: integer
      example: 1550
    CreatedAt:
      description: Created at unix timestamp
      type: integer
      example: 1234567890
    UpdatedAt:
      description: Updated at unix timestamp
      type: integer
      example: 1234567890
    AssetId:
      description: Unique asset identifier
      type: integer
      example: 123456
    AssetSymbol:
      description: The symbol associated by the asset
      type: string
      example: APPL
    SellAmount:
      description: The total amount to sell from an asset or group of assets
      type: integer
      example: 1550
    SellPercentage:
      description: The percentage amount to sell from an asset or group of assets
      type: integer
      example: 50
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  code:
                    type: string
                    example: 404
                  message:
                    type: string
                    example: Not Found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````