---
title: "Call Function"
method: POST
path: "/v2/nvcf/exec/functions/{functionId}/versions/{versionId}"
tags: ["Envelope Function Invocation"]
deprecated: true
---

# Call Function

`POST /v2/nvcf/exec/functions/{functionId}/versions/{versionId}`

> **Deprecated.**

Invokes the specified function that was successfully deployed. If the version  is not specified, any active function versions will handle the request. If  the version is specified in the URI, then the request is exclusively processed  by the designated version of the function. By default, this endpoint will block  for 5 seconds. If the request is not fulfilled before the timeout, it's status  is considered in-progress or pending and the response includes HTTP status code  202 with an invocation request ID, indicating that the client should commence  polling for the result using the invocation request ID. Access to this endpoint  mandates inclusion of either a bearer token or an api-key with 'invoke_function'  scope in the HTTP Authorization header. Additionally, this endpoint has the  capability to provide updates on the progress of the request, contingent  upon the workload's provision of such information. In-progress responses are returned in order. If no in-progress response is received  during polling you will receive the most recent in-progress response. Only the first  256 unread in-progress messages are kept.

## Path parameters

- `functionId` string, uuid, required
- `versionId` string, uuid, required

## Request body

- InvokeFunctionRequest — Request body for creating a job/task for inference/train using a GPU powered spot instance in cloud.
  - `requestHeader` RequestHeaderDto — Data Transfer Object(DTO) representing header/address for Cloud Functions processing.
    - `inputAssetReferences` string[] — List of UUIDs corresponding to the uploaded assets to be used as input for executing the task.
    - `meteringData` MeteringDataEntryDto[] — Metadata used for billing/metering purposes.
      - `key` string, required — Metering/Billing key
      - `value` string, required — Metering/Billing value
    - `pollDurationSeconds` integer — Polling timeout duration.
  - `requestBody` object, required

## Response `200`

Invocation is fulfilled

- InvokeFunctionResponse — Response body with result from a request for executing a job/task as a cloud function using a GPU powered spot/on-demand instance.
  - `reqId` string, uuid — Request id
  - `status` 'errored' | 'in-progress' | 'fulfilled' | 'pending-evaluation' | 'rejected' — Status of the task/job executing cloud function.
  - `responseReference` string, url — For large results, responseReference will be a pre-signeddownload URL.
  - `percentComplete` integer — Progress indicator for the task/job executing cloud function.
  - `errorCode` integer — Error code from the container while executing cloud function.
  - `response` string — Response/result of size < 5MB size for the task/job executing cloud function.

## Other responses

- `202` — Result is pending. Client should poll using the requestId.
- `302` — Client should use the URL specified in the 'Location' response header to fetch large result.
- `402` — Cloud credits expired for public functions. Please contact NVIDIA representatives.
- `403` — Either missing scope in the auth(SSA JWT / SAK) token and/or missing resource entry in the SAK for the function.
- `429` — Client is doing too many requests per second and should slow down request rate.

---

[API](https://skmtc.dev/brevdev/apis/cloud-functions.md) · [All operations](https://skmtc.dev/brevdev/apis/cloud-functions/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/brevdev/cloud-functions/revisions/add37b001ffc/schema)
