# Annotation

Annotation operations

## GET /annotation

> List annotations, subject to attribute search criteria.

```json
{"openapi":"3.0.0","info":{"title":"Nexus211 Platform API","version":"1.0.0"},"tags":[{"name":"annotation","description":"Annotation operations"}],"security":[{"Basic":[]},{"OAuth":[]}],"components":{"securitySchemes":{"Basic":{"description":"A registered Nexus211 app can use Basic Auth method to authenticate itself.\nThe username is the app's Client ID and the password is Client Secret.\n","type":"http","scheme":"basic"},"OAuth":{"description":"Profile authentication is possibly using the OAuth flow.\n","type":"http","scheme":"bearer"}},"parameters":{"limitParam":{"name":"$limit","in":"query","description":"The number of records to be returned.","schema":{"type":"number","default":100}},"skipParam":{"name":"$skip","in":"query","description":"The number of records to be skipped for pagination.","schema":{"type":"number","default":0}},"orderParam":{"name":"$order","in":"query","description":"The order of the records. The result can be sorted by multiple attributes separated by a comma (`,`). Examples; `name`  `name asc` `name desc` `name,createdAt desc`","schema":{"type":"string"}},"withParam":{"name":"$with","in":"query","description":"Load related entities as objects.","schema":{"type":"string"}},"filterParam":{"name":"attrib_name","in":"query","description":"Filter records by attributes. The result can be filtered by any attribute of the entity. All request parameters not\nstarting with `$` are automatically used as a filter condition.\n\n- Extended filtering options are also available. See the table below.\n- Filter parameters that do not belong to the entity are silently ignored.\n- ISO-8601 formats are accepted for the date fields. The timezone will be set to UTC if not provided.\n- The separator for `in` and `notin` modifiers is the pipe character (`|`). Pipe characters can be escaped with a backslash in front of it.\n- Concat Like is to search for a string in two or more fields. It is only supported for JSON fields.\n\n Description              | GET Request Example\n--------------------------|--------------------\nExact Match              | `name=john`\nNot Equals (Exact Match) | `name:ne=john`\nIs Null                  | `name=null`\nIs Not Null              | `name:ne=null`\nGreater Than             | `age:gt=5`, `birth:gt=1977-10-22T22:04:00`\nGreater Than or Equal To | `age:gte=5`, `birth:gte=1977-10-22T22:04:00`\nLess Than                | `age:lt=3`, `birth:lt=2000-01-01T00:00:00`\nLess Than or Equal To    | `age:lte=3`, `birth:lte=2000-01-01T00:00:00`\nBetween                  | `age:bt=3,5`, `birth:bt=1977-10-22T22:04:00,2000-01-01T00:00:00`\nIn                       | <code>status:in=value 1&#124;value 2&#124;value 3</code>\nNot In                   | <code>status:notin=value 1&#124;value 2&#124;value 3</code>\nLike                     | `name:like=%john%`\nNot Like                 | `name:notlike=%john%`\nConcat Like(Only for JSON fields)| `firstName,lastName:concatlike=full name`\n","schema":{"type":"string"}}},"schemas":{"PaginatedArray":{"type":"object","properties":{"__meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"PaginationMeta":{"type":"object","properties":{"total":{"type":"number"},"perPage":{"type":"number"},"currentLength":{"type":"number"},"prevUrl":{"type":"number"},"nextUrl":{"type":"number"}}},"Annotation":{"allOf":[{"$ref":"#/components/schemas/NewAnnotation"},{"$ref":"#/components/schemas/BaseEntity"},{"type":"object"}]},"NewAnnotation":{"type":"object","required":["value","elementType","elementId","organization"],"properties":{"value":{"type":"string"},"elementType":{"type":"string"},"elementId":{"type":"string"},"organization":{"type":"string","format":"uuid"}}},"BaseEntity":{"type":"object","required":["id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"}}}}},"paths":{"/annotation":{"get":{"tags":["annotation"],"description":"List annotations, subject to attribute search criteria.","parameters":[{"$ref":"#/components/parameters/limitParam"},{"$ref":"#/components/parameters/skipParam"},{"$ref":"#/components/parameters/orderParam"},{"$ref":"#/components/parameters/withParam"},{"$ref":"#/components/parameters/filterParam"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginatedArray"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"}}}}]}}}}}}}}}
```

## POST /annotation

> Create a new annotation

```json
{"openapi":"3.0.0","info":{"title":"Nexus211 Platform API","version":"1.0.0"},"tags":[{"name":"annotation","description":"Annotation operations"}],"security":[{"Basic":[]},{"OAuth":[]}],"components":{"securitySchemes":{"Basic":{"description":"A registered Nexus211 app can use Basic Auth method to authenticate itself.\nThe username is the app's Client ID and the password is Client Secret.\n","type":"http","scheme":"basic"},"OAuth":{"description":"Profile authentication is possibly using the OAuth flow.\n","type":"http","scheme":"bearer"}},"schemas":{"NewAnnotation":{"type":"object","required":["value","elementType","elementId","organization"],"properties":{"value":{"type":"string"},"elementType":{"type":"string"},"elementId":{"type":"string"},"organization":{"type":"string","format":"uuid"}}}}},"paths":{"/annotation":{"post":{"tags":["annotation"],"description":"Create a new annotation","parameters":[{"in":"body","name":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewAnnotation"}}}},"responses":{"201":{"description":"Created"}}}}}}
```

## GET /annotation/{id}

> Read a annotation by ID

```json
{"openapi":"3.0.0","info":{"title":"Nexus211 Platform API","version":"1.0.0"},"tags":[{"name":"annotation","description":"Annotation operations"}],"security":[{"Basic":[]},{"OAuth":[]}],"components":{"securitySchemes":{"Basic":{"description":"A registered Nexus211 app can use Basic Auth method to authenticate itself.\nThe username is the app's Client ID and the password is Client Secret.\n","type":"http","scheme":"basic"},"OAuth":{"description":"Profile authentication is possibly using the OAuth flow.\n","type":"http","scheme":"bearer"}},"schemas":{"Annotation":{"allOf":[{"$ref":"#/components/schemas/NewAnnotation"},{"$ref":"#/components/schemas/BaseEntity"},{"type":"object"}]},"NewAnnotation":{"type":"object","required":["value","elementType","elementId","organization"],"properties":{"value":{"type":"string"},"elementType":{"type":"string"},"elementId":{"type":"string"},"organization":{"type":"string","format":"uuid"}}},"BaseEntity":{"type":"object","required":["id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"}}}}},"paths":{"/annotation/{id}":{"get":{"tags":["annotation"],"description":"Read a annotation by ID","parameters":[{"in":"path","name":"id","description":"Unique ID of the annotation to get","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotation"}}}},"404":{"description":"A annotation with the specified ID was not found."}}}}}}
```

## DELETE /annotation/{id}

> Delete an existing annotation

```json
{"openapi":"3.0.0","info":{"title":"Nexus211 Platform API","version":"1.0.0"},"tags":[{"name":"annotation","description":"Annotation operations"}],"security":[{"Basic":[]},{"OAuth":[]}],"components":{"securitySchemes":{"Basic":{"description":"A registered Nexus211 app can use Basic Auth method to authenticate itself.\nThe username is the app's Client ID and the password is Client Secret.\n","type":"http","scheme":"basic"},"OAuth":{"description":"Profile authentication is possibly using the OAuth flow.\n","type":"http","scheme":"bearer"}},"schemas":{"DeletedAnnotation":{"type":"object","properties":{"annotation":{"type":"string"},"annotation.network_override":{"type":"array","items":"string"}}}}},"paths":{"/annotation/{id}":{"delete":{"tags":["annotation"],"description":"Delete an existing annotation","parameters":[{"in":"path","name":"id","description":"Unique ID of the annotation to delete","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedAnnotation"}}}},"404":{"description":"A annotation with the specified ID was not found."}}}}}}
```

## PATCH /annotation/{id}

> Update an existing annotation

```json
{"openapi":"3.0.0","info":{"title":"Nexus211 Platform API","version":"1.0.0"},"tags":[{"name":"annotation","description":"Annotation operations"}],"security":[{"Basic":[]},{"OAuth":[]}],"components":{"securitySchemes":{"Basic":{"description":"A registered Nexus211 app can use Basic Auth method to authenticate itself.\nThe username is the app's Client ID and the password is Client Secret.\n","type":"http","scheme":"basic"},"OAuth":{"description":"Profile authentication is possibly using the OAuth flow.\n","type":"http","scheme":"bearer"}},"schemas":{"Annotation":{"allOf":[{"$ref":"#/components/schemas/NewAnnotation"},{"$ref":"#/components/schemas/BaseEntity"},{"type":"object"}]},"NewAnnotation":{"type":"object","required":["value","elementType","elementId","organization"],"properties":{"value":{"type":"string"},"elementType":{"type":"string"},"elementId":{"type":"string"},"organization":{"type":"string","format":"uuid"}}},"BaseEntity":{"type":"object","required":["id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"}}}}},"paths":{"/annotation/{id}":{"patch":{"tags":["annotation"],"description":"Update an existing annotation","parameters":[{"in":"header","name":"if-unmodified-since","description":"last update time to make sure request data is not outdated and does not overwrite any data","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","description":"Unique ID of the annotation to get","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotation"}}}},"404":{"description":"A annotation with the specified ID was not found."}}}}}}
```
