Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Este documento explica como criar e atualizar rótulos para projetos usando a API Resource Manager e o console Google Cloud . Ele fornece detalhes sobre como entender os custos usando rótulos e os serviços que os aceitam.
Na página Gerenciar recursos, selecione os projetos em
que você quer adicionar identificadores.
No painel de informações, na guia Identificadores, clique em + Adicionar rótulo e
insira um valor e uma chave para cada identificador que você quer adicionar.
Ao terminar de adicioná-los, clique em Salvar.
Depois de adicionar os marcadores, você poderá filtrar os projetos digitando a chave ou o valor do marcador na caixa de filtro acima da lista de projetos. A caixa de filtro faz a sugestão de chaves e valores para que você possa visualizar os resultados.
REST
Para criar um novo projeto com um identificador, defina o campo labels ao criar o projeto.
Depois de adicionar identificadores, é possível filtrar projetos com base neles. Para detalhes sobre
como usar identificadores para filtrar projetos, consulte Como listar projetos.
Atualizar identificadores de projetos
Console
Para atualizar identificadores de um único projeto:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[],[],null,["# Create and update labels for projects\n\nThis document provides details on how to create and update\nlabels for projects using the Resource Manager API and the Google Cloud console. It provides\ndetails on how to understand costs using labels and the services that support labels.\n| **Note:** For more information about adding or updating labels on specific resources, such as Compute Engine instance and Cloud Storage buckets, see the corresponding product documentation of the resource.\n\n\nCreate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo add labels to a single project:\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. To add a new label entry, click **+ Add label** and enter a label key and\n value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nTo add labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to add labels.\n\n3. In the info panel, in the **Labels** tab, click **+ Add label** and\n enter a label key and value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nAfter you add labels, you can filter projects by typing a label key or value in\nthe filter box above the projects list. The filter box will suggest keys and\nvalues so you can preview results.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo create a **new** project with a label, set the `labels` field when you create\nthe project.\n\nRequest: \n\n```text\nPOST https://cloudresourcemanager.googleapis.com/v3/projects\n\n{\n \"labels\": {\n \"color\": \"red\"\n },\n \"name\": \"myproject\",\n \"projectId\": \"our-project-123\"\n}\n```\n\nResponse: \n\n```text\n{\n \"projectNumber\": \"333197460082\",\n \"projectId\": \"our-project-123\",\n \"lifecycleState\": \"ACTIVE\",\n \"name\": \"myproject\",\n \"labels\": {\n \"color\": \"red\"\n },\n \"createTime\": \"2016-01-12T22:18:28.633Z\",\n}\n```\n\nTo add labels for **existing** projects:\n\n- Get the project using the [`projects.get()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/get) method.\n- Modify the `labels` field.\n- Update the project using the [`projects.patch()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/patch) method.\n\nOnce you add labels, you can filter projects based on labels. For details about\nusing labels to filter projects, see [Listing Projects](/resource-manager/docs/creating-managing-projects#listing_projects).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nUpdate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo update labels for a single project:\n\n\u003cbr /\u003e\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. Update the labels for your project:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\nTo update labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to update labels.\n\n3. In the info panel, click the **Labels** tab and update labels for the\n selected projects:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo update a project's labels, do the following:\n\n- Get the `project` object using the\n [`projects.get()`](/resource-manager/reference/rest/v3/projects/get)\n method.\n\n- Modify the labels that you want to update.\n\n- Call the `projects.patch` method.\n\nThe following example updates the label `color:blue`:\n\nThe following code snippet changes the value of the `color` label from `blue`\nto `red`.\n\nRequest: \n\n PATCH https://cloudresourcemanager.googleapis.com/v3/projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n {\n updateMask=labels\n }\n\nWhere \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e is the name of the project you want\nto update.\n\nRequest JSON body: \n\n {\n \"labels\":\n {\n \"color\": \"red\"\n }\n }\n\nResponse: \n\n {\n \"projects\": [\n {\n \"name\": \"projects/123456789012\",\n \"parent\": \"folders/123456789012\",\n \"projectId\": \"my-project\",\n \"state\": \"ACTIVE\",\n \"displayName\": \"\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\"\n \"createTime\": \"2013-11-13T20:31:53.308Z\"\n \"updateTime\": \"2013-11-13T20:35:42.308Z\"\n \"etag\": \"BwWUlZ6XEfY=\"\n \"labels\": {\n \"color\": \"red\"\n },\n }\n ]\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]