Hi Callum,
Out of interest, most use the pynetbox module for this ... you may wish to consider the module.
Have you tried using the test functions in the <netbox.ip>/api/docs ?
If I run POST using api docs using the below data (where tenant 1 is a valid tenant) - it holds the tenant just fine:
{
"name": "test",
"tenant": 1,
"description": "string",
"custom_fields": {}
}
returning:
{
"id": 1,
"url": "http://192.168.1.135/api/ipam/route-targets/1/",
"display": "test",
"name": "test",
"tenant": {
"id": 1,
"url": "http://192.168.1.135/api/tenancy/tenants/1/",
"display": "wibble",
"name": "wibble",
"slug": "wibble"
},
"description": "string",
"tags": [],
"custom_fields": {},
"created": "2021-11-19",
"last_updated": "2021-11-19T12:39:14.087321Z"
}
netbox = latest release
Ta
Chris