Invalid key error in expired F&O historical data

I am calling this GET

https://api.upstox.com/v3/historical-candle/NSE_FO|50014|30-12-2025/minutes/1/2025-12-26/2025-12-26

and this is the json that shows the F&O key I am using in the above api call

{

  "status": "success",

"data": [

    {

"name": "RELIANCE INDUSTRIES LTD",

"segment": "NSE_FO",

"exchange": "NSE",

"expiry": "2025-12-30",

"instrument_key": "NSE_FO|50014|30-12-2025",

"exchange_token": "50014",

"trading_symbol": "RELIANCE FUT 30 DEC 25",

"tick_size": 10.0,

"lot_size": 500,

"instrument_type": "FUT",

"freeze_quantity": 15000.0,

"underlying_key": "NSE_EQ|INE002A01018",

"underlying_type": "EQUITY",

"underlying_symbol": "RELIANCE",

"minimum_lot": 500

    }

  ]

}


I don’t understand why am I getting the below response from upstox

{

    "status": "error",

"errors": [

{

"errorCode": "UDAPI1021",

"message": "Instrument key is of invalid format",

"propertyPath": "getHistoricalCandleData.instrumentKey",

"invalidValue": "NSE_FO|50014|30-12-2025",

"error_code": "UDAPI1021",

"property_path": "getHistoricalCandleData.instrumentKey",

"invalid_value": "NSE_FO|50014|30-12-2025"

}

]

}

I have tried replacing | with %7C and removing the expiry date from key as well, still getting the same error.

Hi @Virat_49479145 , It appears that you’re using the Historical Candles API instead of the Expired Historical Candles API. Please refer to the following documentation for the correct endpoint: Expired Historical Candle Data | Upstox Developer API

Thanks, I’ll try this.