An error occurred BadRequestException when calling the UpdateRestApi operation Invalid patch path tags keytest

0 votes

Hi Guys,

I am new to the AWS API gateway service. I am trying to add a tag to an existing restApi with AWS CLI. I have tried with the below command.

$ aws apigateway update-rest-api --rest-api-id ${rest_api_id} --patch-operations op=add,path=/tags/keytest,value='testvalue'

But it is showing me the below error.

An error occurred (BadRequestException) when calling the UpdateRestApi operation: Invalid patch path /tags/keytest
Dec 8, 2020 in AWS by akhtar
• 38,220 points

1 answer to this question.

0 votes


You need to use the tag-resource method instead of update-rest-api in your command.

$ aws apigateway tag-resource --resource-arn your-api-gateway-arn --tags tag-name=tag-value
answered Dec 8, 2020 by MD
• 95,320 points

Related Questions In AWS

0 votes
1 answer