> For the complete documentation index, see [llms.txt](https://developers.make.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.make.com/white-label-documentation/admin-api-reference/admin-functions-v2.md).

# Admin / Functions V2

## List trashed Functions of a team

> Lists the team's Functions V2 that were deleted less than 30 days ago and can still be restored, newest deletion first.\
> Requires the \`scenario view\` admin permission.\
> \
> Deleting a Function moves it to trash: it is switched off, its in-flight Runs are cancelled, and the Function, its versions\
> and its Runs disappear from every non-admin route. After 30 days a background job deletes them permanently, and they no\
> longer appear here.<br>

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["admin:read","functions:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/admin/functions/v2/trash":{"get":{"tags":["Admin / Functions V2"],"summary":"List trashed Functions of a team","description":"Lists the team's Functions V2 that were deleted less than 30 days ago and can still be restored, newest deletion first.\nRequires the `scenario view` admin permission.\n\nDeleting a Function moves it to trash: it is switched off, its in-flight Runs are cancelled, and the Function, its versions\nand its Runs disappear from every non-admin route. After 30 days a background job deletes them permanently, and they no\nlonger appear here.\n","parameters":[{"name":"teamId","in":"query","required":true,"description":"Team that owns the Function collection.","schema":{"type":"integer","format":"int32","minimum":1}}],"responses":{"200":{"description":"Trashed Functions of the team that can still be restored.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["functions"],"properties":{"functions":{"type":"array","items":{"type":"object","additionalProperties":false,"description":"A Function in trash. Trashed Functions are always off.","required":["id","teamId","name","active","latestVersion","createdAt","updatedAt","ownerUserId","deletedAt"],"properties":{"id":{"type":"integer","format":"int32","minimum":1},"teamId":{"type":"integer","format":"int32","minimum":1},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","enum":[false]},"latestVersion":{"type":"object","additionalProperties":false,"required":["version","inputSchema","outputSchema","connections","endpoints","createdAt"],"properties":{"version":{"type":"integer","format":"int32","minimum":1},"inputSchema":{"type":"object","maxProperties":64,"additionalProperties":true,"description":"Authoritative client-authored JSON Schema using the bounded Make Functions subset of Draft\n2020-12. `{}` is the explicit permissive schema. Each side is limited to 64 KiB canonical\nUTF-8, 32 expanded levels, 1,000 schema nodes, 500 named properties, 32 total composition\nbranches, and 256 enum values. Schema literals are limited to 32 JSON levels and 10,000 JSON nodes.\nRemote, dynamic, recursive, and non-fragment references are rejected.\n"},"outputSchema":{"type":"object","maxProperties":64,"additionalProperties":true,"description":"Authoritative client-authored JSON Schema using the bounded Make Functions subset of Draft\n2020-12. `{}` is the explicit permissive schema. Each side is limited to 64 KiB canonical\nUTF-8, 32 expanded levels, 1,000 schema nodes, 500 named properties, 32 total composition\nbranches, and 256 enum values. Schema literals are limited to 32 JSON levels and 10,000 JSON nodes.\nRemote, dynamic, recursive, and non-fragment references are rejected.\n"},"connections":{"type":"object","additionalProperties":{"type":"integer","format":"int32","minimum":1}},"endpoints":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"description":"An Endpoint the Function source may call, each one declared once. Code calls it in the\nEndpoints SDK's shape with a declared connection label, for example\n`make.endpoints.salesforce.v4.getCustomer({ input: { id }, connection: 'crm' })`.\n","required":["alias","appName","appVersion","endpointName"],"properties":{"alias":{"type":"string","minLength":1,"maxLength":128,"description":"Display name of the declaration. Code calls the Endpoint by its app, version and name, never by alias."},"connectionKey":{"type":"string","minLength":1,"maxLength":128,"description":"Label of the declared connection the editor binds this Endpoint to; its calls pass the same label as `connection`."},"appName":{"type":"string","minLength":1,"maxLength":128},"appVersion":{"type":"integer","minimum":1},"endpointName":{"type":"string","minLength":1,"maxLength":128}}}},"createdAt":{"type":"string","format":"date-time"}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"ownerUserId":{"type":"integer","format":"int32","minimum":1,"description":"ID of the user who created the Function."},"deletedAt":{"type":"string","format":"date-time","description":"When the Function was moved to trash. It is purged 30 days later."}}}}}}}}},"400":{"description":"Request validation failed.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}},"401":{"description":"Authentication is missing or invalid.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}},"403":{"description":"The caller is authenticated but cannot perform the requested action.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}}}}}}}
```

## Restore a trashed Function

> Restores a Function V2 deleted less than 30 days ago, together with its versions and Runs.\
> Requires the \`scenario edit\` admin permission. The request has no body.\
> \
> The restored Function is switched off; its owner must switch it on before published versions accept Runs again.\
> Runs cancelled by the deletion stay cancelled. Restoring a Function that is not in trash returns it unchanged.\
> Returns \`404\` when the Function does not exist or was deleted 30 or more days ago.<br>

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["admin:write","functions:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/admin/functions/v2/{functionId}/restore":{"post":{"tags":["Admin / Functions V2"],"summary":"Restore a trashed Function","description":"Restores a Function V2 deleted less than 30 days ago, together with its versions and Runs.\nRequires the `scenario edit` admin permission. The request has no body.\n\nThe restored Function is switched off; its owner must switch it on before published versions accept Runs again.\nRuns cancelled by the deletion stay cancelled. Restoring a Function that is not in trash returns it unchanged.\nReturns `404` when the Function does not exist or was deleted 30 or more days ago.\n","responses":{"200":{"description":"The restored Function, switched off.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["function"],"properties":{"function":{"type":"object","additionalProperties":false,"required":["id","teamId","name","active","latestVersion","createdAt","updatedAt"],"properties":{"id":{"type":"integer","format":"int32","minimum":1},"teamId":{"type":"integer","format":"int32","minimum":1},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","description":"Whether published versions accept Runs. New and restored Functions are off; inline Runs work either way."},"latestVersion":{"type":"object","additionalProperties":false,"required":["version","inputSchema","outputSchema","connections","endpoints","createdAt"],"properties":{"version":{"type":"integer","format":"int32","minimum":1},"inputSchema":{"type":"object","maxProperties":64,"additionalProperties":true,"description":"Authoritative client-authored JSON Schema using the bounded Make Functions subset of Draft\n2020-12. `{}` is the explicit permissive schema. Each side is limited to 64 KiB canonical\nUTF-8, 32 expanded levels, 1,000 schema nodes, 500 named properties, 32 total composition\nbranches, and 256 enum values. Schema literals are limited to 32 JSON levels and 10,000 JSON nodes.\nRemote, dynamic, recursive, and non-fragment references are rejected.\n"},"outputSchema":{"type":"object","maxProperties":64,"additionalProperties":true,"description":"Authoritative client-authored JSON Schema using the bounded Make Functions subset of Draft\n2020-12. `{}` is the explicit permissive schema. Each side is limited to 64 KiB canonical\nUTF-8, 32 expanded levels, 1,000 schema nodes, 500 named properties, 32 total composition\nbranches, and 256 enum values. Schema literals are limited to 32 JSON levels and 10,000 JSON nodes.\nRemote, dynamic, recursive, and non-fragment references are rejected.\n"},"connections":{"type":"object","additionalProperties":{"type":"integer","format":"int32","minimum":1}},"endpoints":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"description":"An Endpoint the Function source may call, each one declared once. Code calls it in the\nEndpoints SDK's shape with a declared connection label, for example\n`make.endpoints.salesforce.v4.getCustomer({ input: { id }, connection: 'crm' })`.\n","required":["alias","appName","appVersion","endpointName"],"properties":{"alias":{"type":"string","minLength":1,"maxLength":128,"description":"Display name of the declaration. Code calls the Endpoint by its app, version and name, never by alias."},"connectionKey":{"type":"string","minLength":1,"maxLength":128,"description":"Label of the declared connection the editor binds this Endpoint to; its calls pass the same label as `connection`."},"appName":{"type":"string","minLength":1,"maxLength":128},"appVersion":{"type":"integer","minimum":1},"endpointName":{"type":"string","minLength":1,"maxLength":128}}}},"createdAt":{"type":"string","format":"date-time"}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Authentication is missing or invalid.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}},"403":{"description":"The caller is authenticated but cannot perform the requested action.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}},"404":{"description":"The resource does not exist or is not visible to the caller.","headers":{"X-Request-ID":{"description":"Correlation identifier for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"description":"Human-readable or structured error details.","oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]}}}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.make.com/white-label-documentation/admin-api-reference/admin-functions-v2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
