API endpoint that allows CV Categories to be viewed or edited. In addition to the normal detail page, when provided with the param nested=True, the detail endpoint shows all Terms on the category. Then on the detail page, terms can be viewed, changed, deleted and added to the Category.

» click to learn about Filtering, Ordering and more...

Accepted filters:

- search: Search in the following fields: ^name. (^startswith, $regex, =exact)
- id: ID (exact)
- created: Created (exact)
- modified: Modified (exact)
- name: Name starts with (istartswith)
- description: Description contains (icontains)
- query: Search filter on the name property (exact)
- owner: Owner Username (exact)
- owned_by: Filter on list of owned by group names [OR] (exact)
- public: Public (exact)
- deleted: Deleted (exact)
- deleted_by: Deleted by (exact)
- deleted_date: Deleted date (exact)
- label: Label contains (icontains)
- created_by: Created by Username (exact)
- modified_by: Modified by Username (exact)

Advanced Filtering

You can also filter using a json object to process all search parameters. Currently this filter supports the syntax as produced/used by the http://summitroute.github.io/react-structured-filter/ search UI.

Example

?query_expression={"category":"name","operator":"contains","value":"Y00"},
       {"category":"amount","operator":">","value":"10"},
       {"category":"type__name","operator":"exact","value":"ANTIBODY"}
» more info about the query_expression param..

Preset mappings

- terms: {'name': 'term_count', 'aggregate': Count(F(terms), distinct=True)}
- deleted: <function filter_deleted at 0x7f45063b6710>
- deleted_by: deleted_by__username
- owner: owner__username
- owned_by: owned_by__name
- created_by: created_by__username
- modified_by: modified_by__username

Operators

- ==
- =
- >=
- >
- <=
- <
- contains
- icontains
- exact
- iexact
- startswith
- istartswith
- endswith
- iendswith

Permission filtering

Based on the current logged in user you can filter for objects that have a particular permission set:

- can_change: True/False, show objects that you can change
- can_delete: True/False, show objects that you can delete

# not applicable - will raise NotAcceptable:
- can_view: as this is always True, you can only view items you are allowed to see

Ordering

You can order on practically any field even spanning relations.

# reverse order on owner username
?ordering=-owner

# order on related field
?ordering=category__version
API endpoint that allows CV Categories to be viewed or edited.
In addition to the normal detail page, when provided with the param *nested*=True,
the detail endpoint shows all Terms on the category.
Then on the detail page, terms can be viewed, changed, deleted and added to the Category.

None

The default modelviewset used in this project


Add JSONPatch like functionality to bulk update items.


### Bulk Delete

This view also allows for one to bulk delete items. The url needs to be appended by ``/bulk_delete/`` and the ids
need to be given by multiple query_params:

```
{current_url}/bulk_delete/?id=<id_1>,id=<id_2>
```
GET /api/v2/vocabularies/categories/e358e5cb-556f-477e-92fe-5f8e98c13e92/?format=api&ordering=version
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "results": {
        "url": {
            "name": "url",
            "value": "https://labid-demo.embl.de/api/v2/vocabularies/categories/e358e5cb-556f-477e-92fe-5f8e98c13e92/?format=api",
            "category": "property"
        },
        "id": {
            "name": "id",
            "category": "property",
            "value": "e358e5cb-556f-477e-92fe-5f8e98c13e92"
        },
        "created_by": {
            "name": "created_by",
            "value": {
                "id": 1,
                "username": "admin",
                "full_name": "Admin User"
            },
            "category": "property"
        },
        "modified_by": {
            "name": "modified_by",
            "value": {
                "id": 1,
                "username": "admin",
                "full_name": "Admin User"
            },
            "category": "property"
        },
        "created": {
            "name": "created",
            "value": "2025-12-16T09:30:45.688791+01:00",
            "category": "property"
        },
        "modified": {
            "name": "modified",
            "value": "2025-12-16T09:30:45.689136+01:00",
            "category": "property"
        },
        "model_name": {
            "name": "model_name",
            "category": "property",
            "value": "category"
        },
        "app_name": {
            "name": "app_name",
            "category": "property",
            "value": "vocabularies"
        },
        "model_type": {
            "name": "model_type",
            "category": "property",
            "value": "DEFAULT"
        },
        "name": {
            "name": "name",
            "value": {
                "id": "e358e5cb-556f-477e-92fe-5f8e98c13e92",
                "name": "celltypes",
                "model_name": "category",
                "app_name": "vocabularies",
                "model_type": null
            },
            "category": "property"
        },
        "choice_label": {
            "name": "choice_label",
            "category": "property",
            "value": "celltypes"
        },
        "description": {
            "name": "description",
            "category": "property",
            "value": ""
        },
        "label": {
            "name": "label",
            "category": "property",
            "value": "Celltypes"
        },
        "status": {
            "name": "status",
            "value": {
                "value": "ACTIVE",
                "label": "Active"
            },
            "category": "property"
        },
        "source": {
            "name": "source",
            "category": "property",
            "value": "CLO"
        },
        "version": {
            "name": "version",
            "category": "property",
            "value": "1.0"
        },
        "terms": {
            "name": "terms",
            "category": "property",
            "value": [
                {
                    "id": "5b990728-5fd2-41b1-ae78-40a9bc6ce6f8",
                    "name": "HeLa",
                    "description": "HeLa cells were developed from cervix adenocarcinoma of a 31-year-old Black female. The cells are positive for keratin by immunoperoxidase staining. HeLa cells have been reported to contain human papilloma virus 18 (HPV-18) sequences. P53 expression was reported to be low, and normal levels of pRB (retinoblastoma suppressor) were found. Four typical HeLa marker chromosomes have been reported. M1 is a rearranged long arm and centromere of chromosome 1 and the long arm of chromosome 3. M2 is a combination of short arm of chromosome 3 and long arm of chromosome 5. M3 is an isochromosome of the short arm of chromosome 5. M4 consists of the long arm of chromosome 11 and an arm of chromosome 19. HeLa Marker Chromosomes: One copy of Ml, one copy of M2, four-five copies of M3, and two copies of M4 as revealed by G-banding patterns.",
                    "dbxref_id": "NCIT:C20226",
                    "default": false,
                    "short_name": "HeLa",
                    "image_url": "",
                    "public": true
                },
                {
                    "id": "b742625f-0e5b-4df3-9274-237ee2e112a7",
                    "name": "human embryonic stem cells",
                    "description": "human embryonic stem cells (CLO:0037280)",
                    "dbxref_id": "CLO:0037280",
                    "default": false,
                    "short_name": "human embryonic stem cells",
                    "image_url": "",
                    "public": true
                },
                {
                    "id": "8c80471d-874b-4a5a-9f64-0ed2d73c7ac4",
                    "name": "mouse embryonic stem cells",
                    "description": "mouse embryonic stem cells (CLO:0037317)",
                    "dbxref_id": "CLO:0037317",
                    "default": false,
                    "short_name": "mouse embryonic stem cells",
                    "image_url": "",
                    "public": true
                }
            ]
        },
        "permissions": {
            "name": "permissions",
            "value": {
                "public": true,
                "actions": {
                    "view": {
                        "users": [
                            {
                                "id": 1,
                                "username": "admin",
                                "email": "admin@example.com",
                                "is_active": true,
                                "full_name": "Admin User"
                            }
                        ],
                        "groups": [
                            {
                                "id": 1,
                                "name": "SYSTEM_GROUP"
                            }
                        ]
                    },
                    "change": {
                        "users": [
                            {
                                "id": 1,
                                "username": "admin",
                                "email": "admin@example.com",
                                "is_active": true,
                                "full_name": "Admin User"
                            }
                        ],
                        "groups": [
                            {
                                "id": 1,
                                "name": "SYSTEM_GROUP"
                            }
                        ]
                    },
                    "delete": {
                        "users": [
                            {
                                "id": 1,
                                "username": "admin",
                                "email": "admin@example.com",
                                "is_active": true,
                                "full_name": "Admin User"
                            }
                        ],
                        "groups": []
                    }
                },
                "allowed": [
                    "view"
                ]
            },
            "category": "property"
        },
        "public": {
            "name": "public",
            "value": true,
            "category": "property"
        },
        "owner": {
            "name": "owner",
            "value": {
                "id": 1,
                "username": "admin",
                "full_name": "Admin User"
            },
            "category": "property"
        },
        "owned_by": {
            "name": "owned_by",
            "value": {
                "id": 1,
                "name": "SYSTEM_GROUP"
            },
            "category": "property"
        }
    }
}