How to create labels in confluence page on confluence server developer using rest api

Hi Team,

I have using below code for creating label in confluence page on confluence server developer , no error but not creating any labels in page.
Please suggest me permission in space and code level changes.

1, $body =
“{
"type“:"page”,
"title“:"$pageTitle ”,
"ancestors“:[{"id”:$pageId}],
"tags“:[{"cql”: "confluence“}],
"metadata“:{"labels”:[{"name”:"global” , "name“:"label2”}]},
"space“: {"key”:"$space"},

2, $body =
“{
"type“:"page”,
"title“:"$pageTitle ”,
"ancestors“:[{"id”:$pageId}],
"tags“:[{"cql”: "confluence“}],
"metadata“:{"labels”:[{"prefix”:"global” , "name“:"label2”}]},

Thank you.