> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.12/api-integrations/data-quality-apis/functions.md).

# Functions

## Delete function

> Permanently deletes a quality function.\
> \
> Requires administrative privileges (\*\*administrator or service account\*\*).\
> \
> If the function is currently referenced by any rule or implementation, deleting it may cause validation failures in those rules. The endpoint does \*\*not\*\* perform a referential check before removal.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/functions/{id}":{"delete":{"description":"Permanently deletes a quality function.\n\nRequires administrative privileges (**administrator or service account**).\n\nIf the function is currently referenced by any rule or implementation, deleting it may cause validation failures in those rules. The endpoint does **not** perform a referential check before removal.\n","operationId":"TdDqWeb.FunctionController.delete","parameters":[{"description":"Function ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"No content"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Delete function","tags":["Functions"]}}},"components":{"schemas":{"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## List functions

> Returns the list of quality functions available for building rule expressions.\
> \
> \*\*Permissions:\*\* Requires at least one of the following permissions on any domain:\
> \- \*\*'Manage form implementations'\*\*\
> \- \*\*'Manage native implementations'\*\*\
> \- \*\*'Create grant request'\*\*\
> Administrators and service accounts are always allowed.\
> \
> No pagination is applied; the full list of functions is returned. Each function includes its return type, group, scope, and argument definitions.\
> \
> Functions are shared globally, not per domain. The permission check is therefore global rather than domain‑scoped.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/functions":{"get":{"description":"Returns the list of quality functions available for building rule expressions.\n\n**Permissions:** Requires at least one of the following permissions on any domain:\n- **'Manage form implementations'**\n- **'Manage native implementations'**\n- **'Create grant request'**\nAdministrators and service accounts are always allowed.\n\nNo pagination is applied; the full list of functions is returned. Each function includes its return type, group, scope, and argument definitions.\n\nFunctions are shared globally, not per domain. The permission check is therefore global rather than domain‑scoped.\n","operationId":"TdDqWeb.FunctionController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionIndexResponse"}}},"description":"Functions response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List functions","tags":["Functions"]}}},"components":{"schemas":{"FunctionIndexResponse":{"additionalProperties":false,"properties":{"data":{"description":"List of functions","items":{"$ref":"#/components/schemas/Function"},"type":"array"}},"required":["data"],"title":"FunctionIndexResponse","type":"object"},"Function":{"additionalProperties":false,"properties":{"args":{"description":"Function arguments","items":{"additionalProperties":false,"properties":{"name":{"description":"Argument name","type":"string"},"type":{"description":"Argument type","nullable":true,"type":"string"},"values":{"description":"Allowed values","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"id":{"description":"Function ID","type":"integer"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["id","name"],"title":"Function","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Create function

> Creates a new quality function.\
> \
> Requires administrative privileges (\*\*administrator or service account\*\*).\
> \
> \*\*Request body:\*\*\
> \- \`name\` (required, string) – Function name. Must be unique.\
> \- \`return\_type\` (optional, string) – Return type.\
> \- \`group\` (optional, string) – Group name.\
> \- \`scope\` (optional, string) – Scope.\
> \- \`args\` (optional, array) – Argument definitions, each with \`name\` (required), \`type\`, and \`values\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/functions":{"post":{"description":"Creates a new quality function.\n\nRequires administrative privileges (**administrator or service account**).\n\n**Request body:**\n- `name` (required, string) – Function name. Must be unique.\n- `return_type` (optional, string) – Return type.\n- `group` (optional, string) – Group name.\n- `scope` (optional, string) – Scope.\n- `args` (optional, array) – Argument definitions, each with `name` (required), `type`, and `values`.\n","operationId":"TdDqWeb.FunctionController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionCreateRequest"}}},"description":"Function creation request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionCreateResponse"}}},"description":"Function response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create function","tags":["Functions"]}}},"components":{"schemas":{"FunctionCreateRequest":{"additionalProperties":false,"properties":{"args":{"description":"Function arguments","items":{"additionalProperties":false,"properties":{"name":{"description":"Argument name","type":"string"},"type":{"description":"Argument type","nullable":true,"type":"string"},"values":{"description":"Allowed values","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"nullable":true,"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["name"],"title":"FunctionCreateRequest","type":"object"},"FunctionCreateResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Function"}},"required":["data"],"title":"FunctionCreateResponse","type":"object"},"Function":{"additionalProperties":false,"properties":{"args":{"description":"Function arguments","items":{"additionalProperties":false,"properties":{"name":{"description":"Argument name","type":"string"},"type":{"description":"Argument type","nullable":true,"type":"string"},"values":{"description":"Allowed values","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"id":{"description":"Function ID","type":"integer"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["id","name"],"title":"Function","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Update all functions

> Replaces the entire set of quality functions with the provided definitions. This is a full‑replacement operation: functions that are not included in the request are removed, and functions in the payload are created or updated to match the supplied definitions.\
> \
> Requires administrative privileges (\*\*administrator or service account\*\*).\
> \
> \*\*Request body:\*\*\
> \- \`functions\` (required, array) – Complete list of function definitions. Each item contains:\
> &#x20; \- \`name\` (required, string) – Function name.\
> &#x20; \- \`return\_type\` (optional, string) – Return type.\
> &#x20; \- \`group\` (optional, string) – Group name.\
> &#x20; \- \`scope\` (optional, string) – Scope.\
> &#x20; \- \`args\` (optional, array) – Argument definitions, each with \`name\` (required), \`type\`, and \`values\`.\
> \
> The replacement runs inside a transaction. The response contains the resulting full list of functions.\
> \
> Because this is a replacement rather than a partial update, any function that is omitted from the payload and currently exists in the catalog will be removed.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/functions":{"put":{"description":"Replaces the entire set of quality functions with the provided definitions. This is a full‑replacement operation: functions that are not included in the request are removed, and functions in the payload are created or updated to match the supplied definitions.\n\nRequires administrative privileges (**administrator or service account**).\n\n**Request body:**\n- `functions` (required, array) – Complete list of function definitions. Each item contains:\n  - `name` (required, string) – Function name.\n  - `return_type` (optional, string) – Return type.\n  - `group` (optional, string) – Group name.\n  - `scope` (optional, string) – Scope.\n  - `args` (optional, array) – Argument definitions, each with `name` (required), `type`, and `values`.\n\nThe replacement runs inside a transaction. The response contains the resulting full list of functions.\n\nBecause this is a replacement rather than a partial update, any function that is omitted from the payload and currently exists in the catalog will be removed.\n","operationId":"TdDqWeb.FunctionsController.update","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionsUpdateRequest"}}},"description":"Functions update request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionsUpdateResponse"}}},"description":"Functions response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update all functions","tags":["Functions"]}}},"components":{"schemas":{"FunctionsUpdateRequest":{"additionalProperties":false,"properties":{"functions":{"description":"List of functions to replace","items":{"additionalProperties":false,"properties":{"args":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"nullable":true,"type":"string"},"values":{"items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"nullable":true,"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["name"],"type":"object"},"type":"array"}},"required":["functions"],"title":"FunctionsUpdateRequest","type":"object"},"FunctionsUpdateResponse":{"additionalProperties":false,"properties":{"data":{"description":"Updated list of functions","items":{"$ref":"#/components/schemas/Function"},"type":"array"}},"required":["data"],"title":"FunctionsUpdateResponse","type":"object"},"Function":{"additionalProperties":false,"properties":{"args":{"description":"Function arguments","items":{"additionalProperties":false,"properties":{"name":{"description":"Argument name","type":"string"},"type":{"description":"Argument type","nullable":true,"type":"string"},"values":{"description":"Allowed values","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"id":{"description":"Function ID","type":"integer"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["id","name"],"title":"Function","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```

## Update all functions

> Replaces the entire set of quality functions with the provided definitions. This is a full‑replacement operation: functions that are not included in the request are removed, and functions in the payload are created or updated to match the supplied definitions.\
> \
> Requires administrative privileges (\*\*administrator or service account\*\*).\
> \
> \*\*Request body:\*\*\
> \- \`functions\` (required, array) – Complete list of function definitions. Each item contains:\
> &#x20; \- \`name\` (required, string) – Function name.\
> &#x20; \- \`return\_type\` (optional, string) – Return type.\
> &#x20; \- \`group\` (optional, string) – Group name.\
> &#x20; \- \`scope\` (optional, string) – Scope.\
> &#x20; \- \`args\` (optional, array) – Argument definitions, each with \`name\` (required), \`type\`, and \`values\`.\
> \
> The replacement runs inside a transaction. The response contains the resulting full list of functions.\
> \
> Because this is a replacement rather than a partial update, any function that is omitted from the payload and currently exists in the catalog will be removed.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.11.0"},"paths":{"/api/functions":{"patch":{"description":"Replaces the entire set of quality functions with the provided definitions. This is a full‑replacement operation: functions that are not included in the request are removed, and functions in the payload are created or updated to match the supplied definitions.\n\nRequires administrative privileges (**administrator or service account**).\n\n**Request body:**\n- `functions` (required, array) – Complete list of function definitions. Each item contains:\n  - `name` (required, string) – Function name.\n  - `return_type` (optional, string) – Return type.\n  - `group` (optional, string) – Group name.\n  - `scope` (optional, string) – Scope.\n  - `args` (optional, array) – Argument definitions, each with `name` (required), `type`, and `values`.\n\nThe replacement runs inside a transaction. The response contains the resulting full list of functions.\n\nBecause this is a replacement rather than a partial update, any function that is omitted from the payload and currently exists in the catalog will be removed.\n","operationId":"TdDqWeb.FunctionsController.update (2)","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionsUpdateRequest"}}},"description":"Functions update request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionsUpdateResponse"}}},"description":"Functions response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqUnprocessableEntityResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDqInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Update all functions","tags":["Functions"]}}},"components":{"schemas":{"FunctionsUpdateRequest":{"additionalProperties":false,"properties":{"functions":{"description":"List of functions to replace","items":{"additionalProperties":false,"properties":{"args":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"nullable":true,"type":"string"},"values":{"items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"nullable":true,"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["name"],"type":"object"},"type":"array"}},"required":["functions"],"title":"FunctionsUpdateRequest","type":"object"},"FunctionsUpdateResponse":{"additionalProperties":false,"properties":{"data":{"description":"Updated list of functions","items":{"$ref":"#/components/schemas/Function"},"type":"array"}},"required":["data"],"title":"FunctionsUpdateResponse","type":"object"},"Function":{"additionalProperties":false,"properties":{"args":{"description":"Function arguments","items":{"additionalProperties":false,"properties":{"name":{"description":"Argument name","type":"string"},"type":{"description":"Argument type","nullable":true,"type":"string"},"values":{"description":"Allowed values","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["name"],"type":"object"},"type":"array"},"group":{"description":"Group name","nullable":true,"type":"string"},"id":{"description":"Function ID","type":"integer"},"name":{"description":"Function name","type":"string"},"return_type":{"description":"Return type","nullable":true,"type":"string"},"scope":{"description":"Scope","nullable":true,"type":"string"}},"required":["id","name"],"title":"Function","type":"object"},"TdDqUnauthorizedResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnauthorizedResponse","type":"object"},"TdDqForbiddenResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqForbiddenResponse","type":"object"},"TdDqUnprocessableEntityResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqUnprocessableEntityResponse","type":"object"},"TdDqInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdDqInternalServerErrorResponse","type":"object"}}}}
```
