# Method: projects.locations.functions.call

- [HTTP request](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.CallFunctionResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#body.aspect)
- [Try it!](https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/call#try-it)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).

### HTTP request

`POST https://cloudfunctions.googleapis.com/v1/{name}:call`

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the function to be called. It takes the form `projects/{project}/locations/{location}/functions/{function}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `cloudfunctions.functions.call` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "data": string } ``` |

| Fields ||
|---|---|
| `data` | `string` Required. Input to be passed to the function. |

### Response body

Response of `functions.call` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "executionId": string, "result": string, "error": string } ``` |

| Fields ||
|---|---|
| `executionId` | `string` Execution id of function invocation. |
| `result` | `string` Result populated for successful execution of synchronous function. Will not be populated if function does not return a result through context. |
| `error` | `string` Either system or user-function generated error. Set if execution was not successful. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).