[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Functions](../../index.md) > [Step-by-step guides](../index.md) > Invoking a function > Authenticating when invoking a private function via HTTPS

# Authenticating when invoking a private function via HTTPS

To [invoke](function-invoke.md) a private function via HTTPS, you need to get authenticated. These are the types of credentials you can use:

* [IAM token](../../../iam/concepts/authorization/iam-token.md):

    * [Guide](../../../iam/operations/iam-token/create.md) for a Yandex account.
    * [Guide](../../../iam/operations/iam-token/create-for-sa.md) for a service account.
    * [Guide](../../../iam/operations/iam-token/create-for-federation.md) for a federated account.
    * [Guide](../../../iam/operations/iam-token/create-for-local.md) for a local account.

    Provide the IAM token in the `Authorization` header in the following format:

    ```text
    Authorization: Bearer <IAM_token>
    ```

    IAM tokens are valid for up to 12 hours.

* Service account [API key](../../../iam/operations/authentication/manage-api-keys.md).

    Provide the API key in the `Authorization` header in the following format:

    ```text
    Authorization: Api-Key <API_key>
    ```

    Use API keys if requesting an [IAM token](../../../iam/concepts/authorization/iam-token.md) automatically is not an option.