@@ -217,26 +217,34 @@ If we wanted to assign this IP address to a virtual machine interface instead, w
217
217
218
218
### Brief Format
219
219
220
- Most API endpoints support an optional "brief" format, which returns only a minimal representation of each object in the response. This is useful when you need only a list of available objects without any related data, such as when populating a drop-down list in a form. As an example, the default (complete) format of an IP address looks like this:
220
+ Most API endpoints support an optional "brief" format, which returns only a minimal representation of each object in the response. This is useful when you need only a list of available objects without any related data, such as when populating a drop-down list in a form. As an example, the default (complete) format of a prefix looks like this:
221
221
222
- ```
222
+ ``` no-highlight
223
223
GET /api/ipam/prefixes/13980/
224
+ ```
224
225
226
+ ``` json
225
227
{
226
228
"id" : 13980 ,
227
229
"url" : " http://netbox/api/ipam/prefixes/13980/" ,
230
+ "display_url" : " http://netbox/api/ipam/prefixes/13980/" ,
231
+ "display" : " 192.0.2.0/24" ,
228
232
"family" : {
229
233
"value" : 4 ,
230
234
"label" : " IPv4"
231
235
},
232
236
"prefix" : " 192.0.2.0/24" ,
233
- "site": {
237
+ "vrf" : null ,
238
+ "scope_type" : " dcim.site" ,
239
+ "scope_id" : 3 ,
240
+ "scope" : {
234
241
"id" : 3 ,
235
- "url": "http://netbox/api/dcim/sites/17/",
242
+ "url" : " http://netbox/api/dcim/sites/3/" ,
243
+ "display" : " Site 23A" ,
236
244
"name" : " Site 23A" ,
237
- "slug": "site-23a"
245
+ "slug" : " site-23a" ,
246
+ "description" : " "
238
247
},
239
- "vrf": null,
240
248
"tenant" : null ,
241
249
"vlan" : null ,
242
250
"status" : {
@@ -250,24 +258,36 @@ GET /api/ipam/prefixes/13980/
250
258
"slug" : " staging"
251
259
},
252
260
"is_pool" : false ,
261
+ "mark_utilized" : false ,
253
262
"description" : " Example prefix" ,
263
+ "comments" : " " ,
254
264
"tags" : [],
255
265
"custom_fields" : {},
256
- "created": "2018-12-10",
257
- "last_updated": "2019-03-01T20:02:46.173540Z"
266
+ "created" : " 2025-03-01T20:01:23.458302Z" ,
267
+ "last_updated" : " 2025-03-01T20:02:46.173540Z" ,
268
+ "children" : 0 ,
269
+ "_depth" : 0
258
270
}
259
271
```
260
272
261
273
The brief format is much more terse:
262
274
263
- ```
275
+ ``` no-highlight
264
276
GET /api/ipam/prefixes/13980/?brief=1
277
+ ```
265
278
279
+ ``` json
266
280
{
267
281
"id" : 13980 ,
268
282
"url" : " http://netbox/api/ipam/prefixes/13980/" ,
269
- "family": 4,
270
- "prefix": "10.40.3.0/24"
283
+ "display" : " 192.0.2.0/24" ,
284
+ "family" : {
285
+ "value" : 4 ,
286
+ "label" : " IPv4"
287
+ },
288
+ "prefix" : " 192.0.2.0/24" ,
289
+ "description" : " Example prefix" ,
290
+ "_depth" : 0
271
291
}
272
292
```
273
293
@@ -400,25 +420,31 @@ curl -s -X POST \
400
420
-H "Authorization: Token $TOKEN" \
401
421
-H "Content-Type: application/json" \
402
422
http://netbox/api/ipam/prefixes/ \
403
- --data '{"prefix": "192.0.2.0/24", "site": 6}' | jq '.'
423
+ --data '{"prefix": "192.0.2.0/24", "scope_type": "dcim. site", "scope_id ": 6}' | jq '.'
404
424
```
405
425
406
426
``` json
407
427
{
408
428
"id" : 18691 ,
409
429
"url" : " http://netbox/api/ipam/prefixes/18691/" ,
430
+ "display_url" : " http://netbox/api/ipam/prefixes/18691/" ,
431
+ "display" : " 192.0.2.0/24" ,
410
432
"family" : {
411
433
"value" : 4 ,
412
434
"label" : " IPv4"
413
435
},
414
436
"prefix" : " 192.0.2.0/24" ,
415
- "site" : {
437
+ "vrf" : null ,
438
+ "scope_type" : " dcim.site" ,
439
+ "scope_id" : 6 ,
440
+ "scope" : {
416
441
"id" : 6 ,
417
442
"url" : " http://netbox/api/dcim/sites/6/" ,
443
+ "display" : " US-East 4" ,
418
444
"name" : " US-East 4" ,
419
- "slug" : " us-east-4"
445
+ "slug" : " us-east-4" ,
446
+ "description" : " "
420
447
},
421
- "vrf" : null ,
422
448
"tenant" : null ,
423
449
"vlan" : null ,
424
450
"status" : {
@@ -427,11 +453,15 @@ http://netbox/api/ipam/prefixes/ \
427
453
},
428
454
"role" : null ,
429
455
"is_pool" : false ,
456
+ "mark_utilized" : false ,
430
457
"description" : " " ,
458
+ "comments" : " " ,
431
459
"tags" : [],
432
460
"custom_fields" : {},
433
- "created" : " 2020-08-04" ,
434
- "last_updated" : " 2020-08-04T20:08:39.007125Z"
461
+ "created" : " 2025-04-29T15:44:47.597092Z" ,
462
+ "last_updated" : " 2025-04-29T15:44:47.597092Z" ,
463
+ "children" : 0 ,
464
+ "_depth" : 0
435
465
}
436
466
```
437
467
@@ -490,18 +520,24 @@ http://netbox/api/ipam/prefixes/18691/ \
490
520
{
491
521
"id" : 18691 ,
492
522
"url" : " http://netbox/api/ipam/prefixes/18691/" ,
523
+ "display_url" : " http://netbox/api/ipam/prefixes/18691/" ,
524
+ "display" : " 192.0.2.0/24" ,
493
525
"family" : {
494
526
"value" : 4 ,
495
527
"label" : " IPv4"
496
528
},
497
529
"prefix" : " 192.0.2.0/24" ,
498
- "site" : {
530
+ "vrf" : null ,
531
+ "scope_type" : " dcim.site" ,
532
+ "scope_id" : 6 ,
533
+ "scope" : {
499
534
"id" : 6 ,
500
535
"url" : " http://netbox/api/dcim/sites/6/" ,
536
+ "display" : " US-East 4" ,
501
537
"name" : " US-East 4" ,
502
- "slug" : " us-east-4"
538
+ "slug" : " us-east-4" ,
539
+ "description" : " "
503
540
},
504
- "vrf" : null ,
505
541
"tenant" : null ,
506
542
"vlan" : null ,
507
543
"status" : {
@@ -510,11 +546,15 @@ http://netbox/api/ipam/prefixes/18691/ \
510
546
},
511
547
"role" : null ,
512
548
"is_pool" : false ,
549
+ "mark_utilized" : false ,
513
550
"description" : " " ,
551
+ "comments" : " " ,
514
552
"tags" : [],
515
553
"custom_fields" : {},
516
- "created" : " 2020-08-04" ,
517
- "last_updated" : " 2020-08-04T20:14:55.709430Z"
554
+ "created" : " 2025-04-29T15:44:47.597092Z" ,
555
+ "last_updated" : " 2025-04-29T15:49:40.689109Z" ,
556
+ "children" : 0 ,
557
+ "_depth" : 0
518
558
}
519
559
```
520
560
@@ -670,6 +710,7 @@ Note that we are _not_ passing an existing REST API token with this request. If
670
710
{
671
711
"id" : 6 ,
672
712
"url" : " https://netbox/api/users/tokens/6/" ,
713
+ "display_url" : " https://netbox/api/users/tokens/6/" ,
673
714
"display" : " **********************************3c9cb9" ,
674
715
"user" : {
675
716
"id" : 2 ,
0 commit comments