> 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.8/api-integrations/data-quality-apis/functions.md).

# Functions

## Delete function

> Deletes the specified function.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/functions/{id}":{"delete":{"description":"Deletes the specified function.","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

> Retrieves all available functions the user can query.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/functions":{"get":{"description":"Retrieves all available functions the user can query.","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 function resource.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/functions":{"post":{"description":"Creates a new function resource.","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 all functions with the provided function definitions.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/functions":{"put":{"description":"Replaces all functions with the provided function definitions.","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 all functions with the provided function definitions.

```json
{"openapi":"3.0.0","info":{"title":"td-dq","version":"Truedat 8.8.2"},"paths":{"/api/functions":{"patch":{"description":"Replaces all functions with the provided function definitions.","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"}}}}
```
