Adding a new datacenter server without ralph importer

Was trying to add a server named ‘testsserver’ via curl:

curl -k -H “Content-Type: application/json” -H ‘Authorization: Token 57xxxxxxxxxx’ -X POST https://ralph.server/api/data-center-assets/add/ -d {‘hostname’:‘testserver’}

but got back:
{“detail”:“Method “POST” not allowed.”}

Was wondering is there a way to add a server entry like this without having to use ralph importer and csv files?

Use endpoint: api/data-center-assets/ and not api/data-center-assets/add/

Take a look at similar thread: Api: Assign ipaddress object to data-center-assert object