# Model Notes

## List Model Notes

> Retrieves a paginated list of notes associated with a model.\
> Note: Model variables, filter values, and notes can all be attached to different entity types via \`model\_type\` and \`model\_id\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Model Notes"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ModelNotesListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ModelNotes"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"ModelNotes":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"note":{"type":"string"},"private":{"type":"string"},"patchworks_only":{"type":"string"},"model_type":{"type":"string"},"model_id":{"type":"integer"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"object"},"flow_step":{"type":"object"},"user":{"type":"object"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/model-notes":{"get":{"summary":"List Model Notes","description":"Retrieves a paginated list of notes associated with a model.\nNote: Model variables, filter values, and notes can all be attached to different entity types via `model_type` and `model_id`.","parameters":[{"name":"filter[user_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by user_id."},{"name":"filter[my_notes]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by my_notes."},{"name":"filter[model_type]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by model_type."},{"name":"filter[model_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by model_id."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flowStep, user"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: id, created_at"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Model Notes"]}}}}
```

## Create Model Note

> Creates a new note for a model.\
> Note: Model variables, filter values, and notes can all be attached to different entity types via \`model\_type\` and \`model\_id\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Model Notes"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ModelNotesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ModelNotes"}}},"ModelNotes":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"note":{"type":"string"},"private":{"type":"string"},"patchworks_only":{"type":"string"},"model_type":{"type":"string"},"model_id":{"type":"integer"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"object"},"flow_step":{"type":"object"},"user":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"ModelNotesStoreRequest":{"type":"object","properties":{"note":{"type":"string","minLength":1,"maxLength":65535},"private":{"type":"string"},"patchworks_only":{"type":"string"},"model_type":{"type":"string"},"model_id":{"type":"integer"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]}},"required":["colour","model_id","model_type","note"]}}},"paths":{"/api/v1/model-notes":{"post":{"summary":"Create Model Note","description":"Creates a new note for a model.\nNote: Model variables, filter values, and notes can all be attached to different entity types via `model_type` and `model_id`.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesStoreRequest"}}}},"tags":["Model Notes"],"parameters":[]}}}}
```

## Get Model Note

> Retrieves the details of a specific model note.\
> Note: Model variables, filter values, and notes can all be attached to different entity types via \`model\_type\` and \`model\_id\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Model Notes"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ModelNotesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ModelNotes"}}},"ModelNotes":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"note":{"type":"string"},"private":{"type":"string"},"patchworks_only":{"type":"string"},"model_type":{"type":"string"},"model_id":{"type":"integer"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"object"},"flow_step":{"type":"object"},"user":{"type":"object"}}}}},"paths":{"/api/v1/model-notes/{model_note}":{"get":{"summary":"Get Model Note","description":"Retrieves the details of a specific model note.\nNote: Model variables, filter values, and notes can all be attached to different entity types via `model_type` and `model_id`.","parameters":[{"name":"model_note","in":"path","required":true,"schema":{"type":"string"},"description":"The model note identifier."},{"name":"filter[user_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by user_id."},{"name":"filter[my_notes]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by my_notes."},{"name":"filter[model_type]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by model_type."},{"name":"filter[model_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by model_id."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flowStep, user"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: id, created_at"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Model Notes"]}}}}
```

## Update Model Note

> Updates an existing model note.\
> Note: Model variables, filter values, and notes can all be attached to different entity types via \`model\_type\` and \`model\_id\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Model Notes"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ModelNotesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ModelNotes"}}},"ModelNotes":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"note":{"type":"string"},"private":{"type":"string"},"patchworks_only":{"type":"string"},"model_type":{"type":"string"},"model_id":{"type":"integer"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"object"},"flow_step":{"type":"object"},"user":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"ModelNotesUpdateRequest":{"type":"object","properties":{"note":{"type":"string","minLength":1,"maxLength":65535},"private":{"type":"string"},"patchworks_only":{"type":"string"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]}}}}},"paths":{"/api/v1/model-notes/{model_note}":{"put":{"summary":"Update Model Note","description":"Updates an existing model note.\nNote: Model variables, filter values, and notes can all be attached to different entity types via `model_type` and `model_id`.","parameters":[{"name":"model_note","in":"path","required":true,"schema":{"type":"string"},"description":"The model note identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotesUpdateRequest"}}}},"tags":["Model Notes"]}}}}
```

## Delete Model Note

> Permanently deletes a specific model note.\
> Note: Model variables, filter values, and notes can all be attached to different entity types via \`model\_type\` and \`model\_id\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Model Notes"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/model-notes/{model_note}":{"delete":{"summary":"Delete Model Note","description":"Permanently deletes a specific model note.\nNote: Model variables, filter values, and notes can all be attached to different entity types via `model_type` and `model_id`.","parameters":[{"name":"model_note","in":"path","required":true,"schema":{"type":"string"},"description":"The model note identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Model Notes"]}}}}
```
