Welcome to Portkey Forum

Updated 5 months ago

Update Virtual Key Endpoint for Bedrock Virtual Key

Hi, how do I use the Update Virtual Key endpoint for Bedrock virtual key? The docs suggest it has only one field key, however Bedrock key requires more fields.
Attachment
Screenshot_2024-07-04_at_4.29.20_PM.png
V
b
W
16 comments
Hi @bhuvansingla sharing an example request here shortly! Will also confirm if you can access this API
Here's a working example for updating your bedrock key:

Plain Text
curl -X PUT 'https://api.portkey.ai/v1/virtual-keys/{BEDROCK_VIRTUAL_KEY}' \
-H 'Content-Type: application/json' \
-H 'x-portkey-api-key: {PERMISSIONED_PORTKEY_API_KEY}' \
-d '{
  "name": "New Virtual Key Name",
  "aws_secret_access_key": "xxxxxxxxxxxx",
  "aws_access_key_id":"xxxxxxxxxxxxxx",
  "aws_region":"us-east-2"
}'
Thanks Vrushank! Really helpful, gonna try it out today.
Hi @Vrushank | Portkey I am trying the above but it doesn't seem to work unforunately. The request goes through, but the fields don't update. Only the name updates, but not the three aws parameters. Can you please help here? πŸ™
Happy to share more over DM on what the request slug and response is. Unfortunately, this is a blocker for us to release some stuff to production : (
Hi, let me check! cc @Witherwings
We're on this. Sorry about this!
hey @bhuvansingla can you try camelcase for aws keys.
Plain Text
curl -X PUT 'https://api.portkey.ai/v1/virtual-keys/{BEDROCK_VIRTUAL_KEY}' \
-H 'Content-Type: application/json' \
-H 'x-portkey-api-key: {PERMISSIONED_PORTKEY_API_KEY}' \
-d '{
  "name": "New Virtual Key Name",
  "awsSecretAccessKey": "xxxxxxxxxxxx",
  "awsAccessKeyId":"xxxxxxxxxxxxxx",
  "awsRegion":"us-east-2"
}'
ahh niceee that works!! ez
thanks a lot @Witherwings!
Thanks! Sorry not sure how I missed this πŸ˜…
no worries. we will update our docs. that should clear the confusion
Thanks a lot folks! I guessed it would be something similar (i did try removing aws prefixes but it was casing lol)
Just some quick feedback here, the api response doesn't match the documented structure. The API response I get is:
Plain Text
{
    "id": ".....",
    "slug": ".....",
    "object": "virtual-key"
}

whereas I expected it to follow a json schema with a success and data key. If the API call fails then I do get the expected json format with success as false.
thanks for the feedback. we are in the middle of updating our docs. we will be updating the structure.
Add a reply
Sign up and join the conversation on Discord