> For the complete documentation index, see [llms.txt](https://docs.ninox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ninox.com/ninox-api/api-reference/api-endpoints/modules.md).

# Modules

## List all modules in a workspace

> Retrieves all modules available in a workspace

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"ModulesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened","type":"string"},"components":{"description":"Module components (pages, containers, widgets). Read-only.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Component id"},"kind":{"type":"string","description":"Component type (e.g. Container, Button, Text, Page)"},"name":{"description":"Component name","type":"string"},"order":{"description":"Component display order","type":"number"},"parentId":{"description":"Parent component id (forms the component tree)","type":"string"},"visible":{"description":"Conditional visibility logic: a boolean, or a script expression (as { $nx: <script> }) evaluated at render time. Read-only.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]}]}},"required":["id","kind"]}},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"openRoles":{"description":"Module open roles","type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]}}},"required":["name"]},"description":"List of modules"},"page_info":{"type":"object","properties":{"has_more":{"type":"boolean","description":"Whether more results are available"},"limit":{"type":"number","description":"Maximum results per page"},"offset":{"type":"number","description":"Current offset"}},"description":"Pagination information"}},"required":["data","page_info"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules":{"get":{"operationId":"ModulesV1Controller_getModules","summary":"List all modules in a workspace","description":"Retrieves all modules available in a workspace","parameters":[{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of modules to return","schema":{"minimum":1,"type":"number"}},{"name":"offset","required":false,"in":"query","description":"Number of modules to skip (starts with 0)","schema":{"minimum":0,"type":"number"}}],"responses":{"200":{"description":"Modules retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulesResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workspace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```

## Create a module

> Creates a new module in a workspace

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"CreateModuleBody":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened. Read-only through the public API for now: a request that sets it is refused with 403 (UnconfinableScriptError), because the browser does not confine an API-written script to its module the way table triggers are confined. Set it in the app settings","type":"string"},"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$","description":"Module name"},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"type":"string"},"filling":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","minLength":1}}},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}},"openRoles":{"description":"Module open roles","minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["admin","editor"]}}},"required":["name"],"description":"Create Module request body"},"ModuleResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened","type":"string"},"components":{"description":"Module components (pages, containers, widgets). Read-only.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Component id"},"kind":{"type":"string","description":"Component type (e.g. Container, Button, Text, Page)"},"name":{"description":"Component name","type":"string"},"order":{"description":"Component display order","type":"number"},"parentId":{"description":"Parent component id (forms the component tree)","type":"string"},"visible":{"description":"Conditional visibility logic: a boolean, or a script expression (as { $nx: <script> }) evaluated at render time. Read-only.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]}]}},"required":["id","kind"]}},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"openRoles":{"description":"Module open roles","type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]}}},"description":"Module details"}},"required":["data"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules":{"post":{"operationId":"ModulesV1Controller_createModule","summary":"Create a module","description":"Creates a new module in a workspace","parameters":[{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateModuleBody"}}}},"responses":{"201":{"description":"Module created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleResponse"}}}},"400":{"description":"Bad request (e.g., module already exists)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Workspace not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```

## Get a specific module

> Retrieves detailed information about a specific module, including its tables

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"ModuleResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened","type":"string"},"components":{"description":"Module components (pages, containers, widgets). Read-only.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Component id"},"kind":{"type":"string","description":"Component type (e.g. Container, Button, Text, Page)"},"name":{"description":"Component name","type":"string"},"order":{"description":"Component display order","type":"number"},"parentId":{"description":"Parent component id (forms the component tree)","type":"string"},"visible":{"description":"Conditional visibility logic: a boolean, or a script expression (as { $nx: <script> }) evaluated at render time. Read-only.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]}]}},"required":["id","kind"]}},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"openRoles":{"description":"Module open roles","type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]}}},"description":"Module details"}},"required":["data"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules/{moduleName}":{"get":{"operationId":"ModulesV1Controller_getModule","summary":"Get a specific module","description":"Retrieves detailed information about a specific module, including its tables","parameters":[{"name":"moduleName","required":true,"in":"path","description":"Module name","schema":{"minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$","type":"string"}},{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}}],"responses":{"200":{"description":"Module details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Module not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```

## Delete a module

> Deletes a module in a workspace

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"DeleteModuleResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Deleted module id"}}}},"required":["data"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules/{moduleName}":{"delete":{"operationId":"ModulesV1Controller_deleteModule","summary":"Delete a module","description":"Deletes a module in a workspace","parameters":[{"name":"moduleName","required":true,"in":"path","description":"Module name","schema":{"minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$","type":"string"}},{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}}],"responses":{"200":{"description":"Module deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteModuleResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Module not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```

## Update a module

> Updates an existing module in a workspace

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"UpdateModuleBody":{"type":"object","properties":{"afterOpen":{"type":"string","description":"Script expression run in the browser each time the app is opened. Read-only through the public API for now: a request that sets it is refused with 403 (UnconfinableScriptError), because the browser does not confine an API-written script to its module the way table triggers are confined. Set it in the app settings; null removes the script and is accepted","nullable":true},"name":{"description":"Module name","type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$"},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"type":"string"},"filling":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","minLength":1}}},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}},"openRoles":{"description":"Module open roles","minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["admin","editor"]}}},"description":"Update Module request body"},"ModuleResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened","type":"string"},"components":{"description":"Module components (pages, containers, widgets). Read-only.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Component id"},"kind":{"type":"string","description":"Component type (e.g. Container, Button, Text, Page)"},"name":{"description":"Component name","type":"string"},"order":{"description":"Component display order","type":"number"},"parentId":{"description":"Parent component id (forms the component tree)","type":"string"},"visible":{"description":"Conditional visibility logic: a boolean, or a script expression (as { $nx: <script> }) evaluated at render time. Read-only.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]}]}},"required":["id","kind"]}},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"openRoles":{"description":"Module open roles","type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]}}},"description":"Module details"}},"required":["data"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules/{moduleName}":{"patch":{"operationId":"ModulesV1Controller_updateModule","summary":"Update a module","description":"Updates an existing module in a workspace","parameters":[{"name":"moduleName","required":true,"in":"path","description":"Module name","schema":{"minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$","type":"string"}},{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModuleBody"}}}},"responses":{"200":{"description":"Module updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleResponse"}}}},"400":{"description":"Bad request (e.g., module already exists)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Module not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```

## Update module, table, field, and option labels (batch)

> Updates labels across a module, its tables, their fields, and choice/multi option labels in a single transaction. Labels are replaced wholesale per object, same as the single-field PATCH — send every locale you want kept, not just the one changing. Every option id in an \`options\` entry must already exist on that field; an unknown id rejects the whole request. Writes against a synced field are rejected.

```json
{"openapi":"3.0.0","info":{"title":"Ninox Public API","version":"1.0.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"API Key","description":"Enter your Workspace API key. \n\n API keys can be generated and managed within the **Workspace Integration** settings in the Ninox app.","in":"header","name":"Authorization","type":"http"}},"schemas":{"UpdateModuleLabelsBody":{"type":"object","properties":{"labels":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}},"tables":{"type":"object","additionalProperties":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"labels":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}},"options":{"description":"Choice/multi option labels — every id must already exist on the field","type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Existing option id — must already exist on the field"},"labels":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}}},"required":["id","labels"],"additionalProperties":false}}},"additionalProperties":false}},"labels":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":100}}},"additionalProperties":false}}},"additionalProperties":false},"ModuleLabelsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]},"description":"Fields whose labels were updated"},"module":{"type":"object","properties":{"afterOpen":{"description":"Script expression run in the browser each time the app is opened","type":"string"},"components":{"description":"Module components (pages, containers, widgets). Read-only.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Component id"},"kind":{"type":"string","description":"Component type (e.g. Container, Button, Text, Page)"},"name":{"description":"Component name","type":"string"},"order":{"description":"Component display order","type":"number"},"parentId":{"description":"Parent component id (forms the component tree)","type":"string"},"visible":{"description":"Conditional visibility logic: a boolean, or a script expression (as { $nx: <script> }) evaluated at render time. Read-only.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]}]}},"required":["id","kind"]}},"hideNavigation":{"description":"Hide module from navigation","type":"boolean"},"icon":{"description":"Module icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isHidden":{"description":"Hide module","type":"boolean"},"labels":{"description":"Module labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"openRoles":{"description":"Module open roles","type":"array","items":{"type":"string"}},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]}}},"required":["name"],"description":"The module, with its updated labels if any"},"tables":{"type":"array","items":{"type":"object","properties":{"canCreate":{"description":"Script expression gating record creation","type":"string"},"canDelete":{"description":"Script expression gating record deletion","type":"string"},"canRead":{"description":"Script expression gating record read access","type":"string"},"canWrite":{"description":"Script expression gating record write access","type":"string"},"createRoles":{"description":"Roles allowed to create records","type":"array","items":{"type":"string"}},"deleteRoles":{"description":"Roles allowed to delete records","type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"binding":{"description":"Read-only: internal binding reference, format not yet specified","type":"string"},"canRead":{"description":"Script expression gating field-level read access","type":"string"},"canWrite":{"description":"Script expression gating field-level write access","type":"string"},"defaultValue":{"description":"Default value applied when a record is created: a literal value (an array of option ids for multi/dmulti), or a script expression (as { $nx: <script> }) evaluated at creation time","anyOf":[{"type":"object","properties":{"$nx":{"type":"string","description":"Script expression"}},"required":["$nx"]},{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"}],"nullable":true},{"type":"array","items":{"type":"string"}}]},"expression":{"description":"Expression (for function type)","type":"string"},"expressionErrors":{"description":"Expression validation errors (for function type)","type":"array","items":{"type":"object","properties":{"column":{"type":"number","description":"Column number where the error occurred"},"line":{"type":"number","description":"Line number where the error occurred"},"message":{"type":"string","description":"Error message"}},"required":["column","line","message"]}},"index":{"description":"Field is indexed","type":"boolean"},"labels":{"description":"Field labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Field name"},"onUpdate":{"description":"Script expression run as a row trigger when the field value changes","type":"string"},"optionColor":{"description":"Color expression for dchoice/dmulti fields","type":"string"},"optionIcon":{"description":"Icon expression for dchoice/dmulti fields","type":"string"},"optionName":{"description":"Display name expression for dchoice/dmulti fields","type":"string"},"options":{"description":"Options array for choice/multi fields, or selection expression for dchoice/dmulti fields","anyOf":[{"type":"array","items":{"type":"object","properties":{"color":{"description":"Option color (hex string)","type":"string"},"icon":{"description":"Option icon name","type":"string"},"id":{"type":"string","description":"Stable option id"},"labels":{"description":"Localized option labels","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string","description":"Option name"},"order":{"type":"number","description":"Option display order"},"textColor":{"description":"Option text color (hex string)","type":"string"}},"required":["id","name","order"]}},{"type":"string"}]},"readRoles":{"description":"Roles allowed to read the field","type":"array","items":{"type":"string"}},"refTableId":{"description":"Reference table id","type":"string"},"required":{"description":"Field is required","type":"boolean"},"search":{"description":"Field is searchable","type":"boolean"},"syncedFrom":{"description":"Source column this field syncs from. Read-only unless the table has two-way sync with updates enabled, in which case every synced field except the key column is writable.","type":"string"},"type":{"type":"string","enum":["any","appointment","boolean","choice","color","date","dchoice","dmulti","file","function","html","icon","lambda","multi","number","react","reference","reverse","rowId","string","styled","time","timeinterval","timestamp","unknown","user","void"],"description":"Field type"},"unique":{"description":"Field is unique","type":"boolean"},"variant":{"description":"Field variant (for string type)","type":"string"},"writeRoles":{"description":"Roles allowed to write to the field","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"hasFiles":{"description":"Enable files for the table","type":"boolean"},"hasGlobalSearch":{"description":"Enable global search for the table","type":"boolean"},"hasHistory":{"description":"Enable history for the table","type":"boolean"},"icon":{"description":"Table icon","type":"object","properties":{"color":{"description":"Icon color (hex string)","type":"string"},"filling":{"description":"Icon filling","anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"icon":{"type":"string","description":"Icon name"}},"required":["icon"]},"isEmailLinkingEnabled":{"description":"Enable email linking for the table","type":"boolean"},"isHidden":{"description":"Hide the table","type":"boolean"},"labels":{"description":"Table labels (localized)","type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"onCreate":{"description":"Script expression run as a trigger after a record is created","type":"string"},"onDelete":{"description":"Script expression run as a trigger when a record is deleted","type":"string"},"onUpdate":{"description":"Script expression run as a trigger after a record is updated","type":"string"},"readRoles":{"description":"Roles allowed to read records","type":"array","items":{"type":"string"}},"writeRoles":{"description":"Roles allowed to update records","type":"array","items":{"type":"string"}}},"required":["name"]},"description":"Tables whose labels were updated"}}}},"required":["data"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}},"required":["error"]}}},"paths":{"/api/v1/workspace/{workspaceId}/modules/{moduleName}/labels":{"patch":{"operationId":"ModulesV1Controller_updateModuleLabels","summary":"Update module, table, field, and option labels (batch)","description":"Updates labels across a module, its tables, their fields, and choice/multi option labels in a single transaction. Labels are replaced wholesale per object, same as the single-field PATCH — send every locale you want kept, not just the one changing. Every option id in an `options` entry must already exist on that field; an unknown id rejects the whole request. Writes against a synced field are rejected.","parameters":[{"name":"moduleName","required":true,"in":"path","description":"Module name","schema":{"minLength":1,"maxLength":100,"pattern":"^[a-z0-9_]+$","type":"string"}},{"name":"workspaceId","required":true,"in":"path","description":"Workspace ID","schema":{"minLength":12,"maxLength":12,"pattern":"^[a-z0-9]+$","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModuleLabelsBody"}}}},"responses":{"200":{"description":"Labels updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleLabelsResponse"}}}},"400":{"description":"Bad request (e.g., unknown option id, table/field not found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Write rejected: field is synced from an external source (read-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Module not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Modules"]}}}}
```


---

# 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://docs.ninox.com/ninox-api/api-reference/api-endpoints/modules.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.
