> For the complete documentation index, see [llms.txt](https://documentation.ocsinventory-ng.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ocsinventory-ng.org/open-api-reference/virtual-cols.md).

# Virtual Cols

## GET /virtual\_cols/

> Return the list of objects that the user can see (public,\
> private\_personal, private\_group)

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PaginatedVirtualColList":{"type":"object","required":["count","results"],"properties":{"count":{"type":"integer"},"next":{"type":"string","nullable":true,"format":"uri"},"previous":{"type":"string","nullable":true,"format":"uri"},"results":{"type":"array","items":{"$ref":"#/components/schemas/VirtualCol"}}}},"VirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}},"required":["id","last_updated","name","user"]},"VisibilityEnum":{"enum":["public","private_personal","private_group"],"type":"string","description":"* `public` - Public\n* `private_personal` - Private (Personal)\n* `private_group` - Private (Group)"},"TargetEnum":{"enum":["asset"],"type":"string","description":"* `asset` - Assets"}}},"paths":{"/virtual_cols/":{"get":{"operationId":"virtual_cols_list","description":"Return the list of objects that the user can see (public,\nprivate_personal, private_group)","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}},{"in":"query","name":"id","schema":{"type":"integer"}},{"name":"limit","required":false,"in":"query","description":"Number of results to return per page.","schema":{"type":"integer"}},{"in":"query","name":"name","schema":{"type":"string"}},{"name":"offset","required":false,"in":"query","description":"The initial index from which to return the results.","schema":{"type":"integer"}},{"name":"ordering","required":false,"in":"query","description":"Which field to use when ordering the results.","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","description":"A search term.","schema":{"type":"string"}},{"in":"query","name":"target","schema":{"type":"string","enum":["asset"]},"description":"* `asset` - Assets"}],"tags":["virtual_cols"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedVirtualColList"}},"application/xml":{"schema":{"$ref":"#/components/schemas/PaginatedVirtualColList"}}},"description":""}}}}}}
```

## POST /virtual\_cols/

> Handle post request, suitable for single and multi creation\
> \
> Args:\
> &#x20;   request (\[dict]): can be dict or list of dicts\
> \
> Returns:\
> &#x20;   \[type]: \[description]

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"VirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}},"required":["id","last_updated","name","user"]},"VisibilityEnum":{"enum":["public","private_personal","private_group"],"type":"string","description":"* `public` - Public\n* `private_personal` - Private (Personal)\n* `private_group` - Private (Group)"},"TargetEnum":{"enum":["asset"],"type":"string","description":"* `asset` - Assets"}}},"paths":{"/virtual_cols/":{"post":{"operationId":"virtual_cols_create","description":"Handle post request, suitable for single and multi creation\n\nArgs:\n    request ([dict]): can be dict or list of dicts\n\nReturns:\n    [type]: [description]","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}}],"tags":["virtual_cols"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"description":""}}}}}}
```

## GET /virtual\_cols/{id}/

> This class will define the view behavior\
> \
> Args:\
> &#x20;   viewsets (\[RestrictVisibilityViewSet])

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"VirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}},"required":["id","last_updated","name","user"]},"VisibilityEnum":{"enum":["public","private_personal","private_group"],"type":"string","description":"* `public` - Public\n* `private_personal` - Private (Personal)\n* `private_group` - Private (Group)"},"TargetEnum":{"enum":["asset"],"type":"string","description":"* `asset` - Assets"}}},"paths":{"/virtual_cols/{id}/":{"get":{"operationId":"virtual_cols_retrieve","description":"This class will define the view behavior\n\nArgs:\n    viewsets ([RestrictVisibilityViewSet])","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}},{"in":"path","name":"id","schema":{"type":"integer"},"description":"A unique integer value identifying this virtual col.","required":true}],"tags":["virtual_cols"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"description":""}}}}}}
```

## PUT /virtual\_cols/{id}/

> User needs to either be the creator or part of the group\
> (if allow\_group\_modification is enabled) to modify a\
> visibility restricted object

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"VirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}},"required":["id","last_updated","name","user"]},"VisibilityEnum":{"enum":["public","private_personal","private_group"],"type":"string","description":"* `public` - Public\n* `private_personal` - Private (Personal)\n* `private_group` - Private (Group)"},"TargetEnum":{"enum":["asset"],"type":"string","description":"* `asset` - Assets"}}},"paths":{"/virtual_cols/{id}/":{"put":{"operationId":"virtual_cols_update","description":"User needs to either be the creator or part of the group\n(if allow_group_modification is enabled) to modify a\nvisibility restricted object","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}},{"in":"path","name":"id","schema":{"type":"integer"},"description":"A unique integer value identifying this virtual col.","required":true}],"tags":["virtual_cols"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"description":""}}}}}}
```

## DELETE /virtual\_cols/{id}/

> User needs to be the creator to delete a visibility restricted object

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}}},"paths":{"/virtual_cols/{id}/":{"delete":{"operationId":"virtual_cols_destroy","description":"User needs to be the creator to delete a visibility restricted object","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}},{"in":"path","name":"id","schema":{"type":"integer"},"description":"A unique integer value identifying this virtual col.","required":true}],"tags":["virtual_cols"],"responses":{"204":{"description":"No response body"}}}}}}
```

## PATCH /virtual\_cols/{id}/

> This class will define the view behavior\
> \
> Args:\
> &#x20;   viewsets (\[RestrictVisibilityViewSet])

```json
{"openapi":"3.0.3","info":{"title":"OCS Inventory Backend API References","version":"3.0.0"},"security":[{"knoxApiToken":[]}],"components":{"securitySchemes":{"knoxApiToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Token-based authentication with required prefix \"Token\""}},"schemas":{"PatchedVirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}}},"VisibilityEnum":{"enum":["public","private_personal","private_group"],"type":"string","description":"* `public` - Public\n* `private_personal` - Private (Personal)\n* `private_group` - Private (Group)"},"TargetEnum":{"enum":["asset"],"type":"string","description":"* `asset` - Assets"},"VirtualCol":{"type":"object","description":"This serialize class provide the API representation","properties":{"id":{"type":"integer","readOnly":true},"visibility":{"$ref":"#/components/schemas/VisibilityEnum"},"allow_group_modification":{"type":"boolean"},"name":{"type":"string","maxLength":100},"target":{"$ref":"#/components/schemas/TargetEnum"},"mapping":{},"last_updated":{"type":"string","format":"date-time","readOnly":true},"user":{"type":"integer","readOnly":true},"groups":{"type":"array","items":{"type":"integer"}}},"required":["id","last_updated","name","user"]}}},"paths":{"/virtual_cols/{id}/":{"patch":{"operationId":"virtual_cols_partial_update","description":"This class will define the view behavior\n\nArgs:\n    viewsets ([RestrictVisibilityViewSet])","parameters":[{"in":"query","name":"format","schema":{"type":"string","enum":["json","xml"]}},{"in":"path","name":"id","schema":{"type":"integer"},"description":"A unique integer value identifying this virtual col.","required":true}],"tags":["virtual_cols"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/PatchedVirtualCol"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PatchedVirtualCol"}},"application/json":{"schema":{"$ref":"#/components/schemas/PatchedVirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/PatchedVirtualCol"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualCol"}},"application/xml":{"schema":{"$ref":"#/components/schemas/VirtualCol"}}},"description":""}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.ocsinventory-ng.org/open-api-reference/virtual-cols.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
