API post new device custom_fields is and invalid keyword #1187

Closed
opened 2025-12-29 16:29:50 +01:00 by adam · 3 comments
Owner

Originally created by @Atoms on GitHub (Aug 21, 2017).

Issue type

[x] Bug report

Environment

  • Python version: 3.4
  • NetBox version: 2.1.3

Description

When using API trying to create new device with custom_fields got error:
<pre><strong>&lt;class &#39;TypeError&#39;&gt;</strong><br /> &#39;custom_fields&#39; is an invalid keyword argument for this function</pre>

Works in 2.1.2 version

Originally created by @Atoms on GitHub (Aug 21, 2017). ### Issue type [x] Bug report ### Environment * Python version: 3.4 * NetBox version: 2.1.3 ### Description When using API trying to create new device with custom_fields got error: `<pre><strong>&lt;class &#39;TypeError&#39;&gt;</strong><br /> &#39;custom_fields&#39; is an invalid keyword argument for this function</pre>` Works in 2.1.2 version
adam added the type: bug label 2025-12-29 16:29:50 +01:00
adam closed this issue 2025-12-29 16:29:51 +01:00
Author
Owner

@Atoms commented on GitHub (Aug 21, 2017):

i think this commit introduced issue: c394985b1b

@Atoms commented on GitHub (Aug 21, 2017): i think this commit introduced issue: https://github.com/digitalocean/netbox/commit/c394985b1be3f2126363782018af9acd3e4865cf
Author
Owner

@jeremystretch commented on GitHub (Aug 21, 2017):

Could you provide the exact request you made please?

@jeremystretch commented on GitHub (Aug 21, 2017): Could you provide the exact request you made please?
Author
Owner

@Atoms commented on GitHub (Aug 22, 2017):

the post request i'm making:
{ "tenant": "1", "platform": "8", "name": "test1", "device_type": "6", "site": "1", "device_role": "8", "custom_fields": { "ansible_groups": "xx,yyy,zzz" } }

@Atoms commented on GitHub (Aug 22, 2017): the post request i'm making: `{ "tenant": "1", "platform": "8", "name": "test1", "device_type": "6", "site": "1", "device_role": "8", "custom_fields": { "ansible_groups": "xx,yyy,zzz" } }`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1187