Hi @christng
Think you need to look at this page you are missing some of the headers etc.
2nd always helpful to show the response error etc.. otherwise we are just guessing
3rd I assume you are actually putting the host and port into the API call.
Example
curl -X POST \
http://localhost:5601/api/spaces/space \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-d '{
"id": "sales",
"name": "Sales",
"description": "This is your Sales Space!",
"disabledFeatures": []
}
'