[Yandex Cloud documentation](../../../index.md) > [Yandex Serverless Integrations](../../index.md) > Workflows API reference > API authentication

# Authentication with the Workflows API

To work via the API, you can use an [IAM token](../../../iam/concepts/authorization/iam-token.md) or an [API key](../../../iam/concepts/authorization/api-key.md).

{% note info %}

You can use an API key only for methods of the `Execution` resource.

{% endnote %}

## IAM token {#iam-token}

An _IAM token_ is a unique sequence of characters issued to the user following authentication.

How to get an IAM token:

* [Guide](../../../iam/operations/iam-token/create.md) for Yandex accounts.
* [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.

Specify the received IAM token when accessing Yandex Cloud resources via the API. Provide the IAM token in the `Authorization` header in the following format:

```yaml
Authorization: Bearer <IAM_token>
```

If you have saved your IAM token to a variable, use the latter:

```yaml
Authorization: Bearer ${IAM_TOKEN}
```

## API key {#api-key}

The _API key_ is a secret key only used for simplified authorization of [service accounts](../../../iam/concepts/users/service-accounts.md) with the Yandex Cloud API.

[Guide](../../../iam/operations/authentication/manage-api-keys.md) to obtaining an API key for service accounts.

Use the API key you obtained when accessing Yandex Cloud resources via the API. Include the API key in the `Authorization` header, formatted as follows:

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

If you have saved the API key to a variable, use the latter:

```yaml
Authorization: Api-Key ${API_KEY}
```


#### See also {#see-also}

[Accounts in Yandex Cloud](../../../iam/concepts/users/accounts.md)