Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Identity and Access Management
    • All guides
    • Getting information about subjects
    • Processing secrets that have become publicly available
    • Users
    • User groups
      • Overview
        • Overview
        • Getting an IAM token for a Yandex account
        • Getting an IAM token for a service account
        • Getting an IAM token for a federated account
        • Getting an IAM token for a local user account
        • Revoking an IAM token
      • Managing static access keys
      • Managing API keys
      • Managing authorized keys
      • Creating a temporary access key using Security Token Service
      • Managing ephemeral access keys
  • Secure use of Yandex Cloud
  • Access management
  • Pricing policy
  • Role reference
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Examples
  • Using an IAM token obtained via the CLI
  1. Step-by-step guides
  2. Authentication
  3. IAM tokens
  4. Getting an IAM token for a local user account

Getting an IAM token for a local user account

Written by
Yandex Cloud
Updated at November 2, 2026
View in Markdown
  • Examples
    • Using an IAM token obtained via the CLI

Note

The IAM token lifetime cannot exceed 12 hours and is limited by the cookie lifetime for the user pool.

CLI

If you do not have the Yandex Cloud CLI yet, install and initialize it.

  1. Authenticate to the CLI as a local user.

  2. Get an IAM token:

    yc iam create-token
    

    Result:

    t1.9euelZrLop7Uz8up********
    

    The returned value is an IAM token. You can copy and save it to a file or store it in a variable:

    export IAM_TOKEN=`<IAM_token>`
    

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:

Authorization: Bearer <IAM_token>

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

Authorization: Bearer ${IAM_TOKEN}

ExamplesExamples

Using an IAM token obtained via the CLIUsing an IAM token obtained via the CLI

Sending a request to get a list of clouds using an IAM token:

Bash
PowerShell
  1. Get an IAM token and write it to the variable:

    export IAM_TOKEN=`yc iam create-token`
    
  2. Send a request to get a list of clouds:

    curl \
      --request GET \
      --header "Authorization: Bearer ${IAM_TOKEN}" \
      https://resource-manager.api.cloud.yandex.net/resource-manager/v1/clouds
    
  3. Result:

    {
    "clouds": [
      {
      "id": "b1gia87mbaom********",
      "createdAt": "2019-08-19T06:15:54Z",
      "name": "my-cloud-1",
      "organizationId": "my-organization"
      },
      {
      "id": "b1gue7m154kt********",
      "createdAt": "2022-08-29T13:27:03Z",
      "name": "my-cloud-2",
      "organizationId": "my-organization"
      }
    ]
    }
    
  1. Get an IAM token and write it to the variable:

    $IAM_TOKEN=yc iam create-token
    
  2. Send a request to get a list of clouds:

    curl.exe ` 
      --request GET ` 
      --header "Authorization: Bearer $IAM_TOKEN" ` 
      https://resource-manager.api.cloud.yandex.net/resource-manager/v1/clouds 
    
  3. Result:

    {
    "clouds": [
      {
      "id": "b1gia87mbaom********",
      "createdAt": "2019-08-19T06:15:54Z",
      "name": "my-cloud-1",
      "organizationId": "my-organization"
      },
      {
      "id": "b1gue7m154kt********",
      "createdAt": "2022-08-29T13:27:03Z",
      "name": "my-cloud-2",
      "organizationId": "my-organization"
      }
    ]
    }
    

Useful linksUseful links

  • Revoking an IAM token

Was the article helpful?

Previous
Getting an IAM token for a federated account
Next
Revoking an IAM token
© 2026 Direct Cursus Technology L.L.C.