Update a proto on a gateway group
PUT /apisix/admin/protos/{proto_id}
PUT /apisix/admin/protos/{proto_id}Interactive request editor loads with JavaScript.
In: header
Path Parameters
The unique identifier of the proto.
^[a-zA-Z0-9-_.]+$1 <= length <= 256Query Parameters
Gateway group ID. Optional when using the gateway group admin key to authenticate.
1 <= lengthRequest Body
application/json
The proto description.
Response Body
application/json
application/json
curl -X PUT "$API_BASE_URL/apisix/admin/protos/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335" \ -H "Content-Type: application/json" \ -d '{ "content": "syntax = \\"proto3\\";\\n\\nmessage Person {\\n string name = 1;\\n int32 id = 2;\\n string email = 3;\\n}\\n" }'Protobuf definition updated successfully.
{
"value": {
"content": "syntax = \"proto3\";\n\nmessage Person {\n string name = 1;\n int32 id = 2;\n string email = 3;\n}\n",
"labels": {
"version": "v2",
"env": "prod"
},
"id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"created_at": 1742288230,
"updated_at": 1742288230
}
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
PUT /apisix/admin/protos/{proto_id}
Update a proto on a gateway group
Replace an existing proto definition in the gateway group. After updates, verify dependent gRPC-transcode routes still match the revised service and method signatures.
Required IAM Permission: Action gateway:UpdateProto, Resource arn:api7:gateway:gatewaygroup/%s
Parameters
proto_id(path, string, required): The unique identifier of the proto.gateway_group_id(query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.
Request body
Content type: application/json
content(string, required): The protobuf content.labels(object, optional): Key-value pairs of labels.
Responses
200: Protobuf definition updated successfully.- allOf variant 1
value(object, optional): The specific resource.- allOf variant 2
value(object, optional): The proto with management fields.- allOf variant 1
value.content(string, required): The protobuf content.value.labels(object, optional): Key-value pairs of labels.- allOf variant 2
value.id(string, optional): The object ID.value.created_at(integer, optional): The object timestamp.value.updated_at(integer, optional): The object timestamp.400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X PUT '$API_BASE_URL/apisix/admin/protos/{proto_id}'