Set tags for an account-level resource
Creates or updates tags for a specific account-level resource.
Security
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194ParametersExpand Collapse
params AccountTagUpdateParams
ResourceType param.Field[AccountTagUpdateParamsResourceTaggingSetTagsRequestAccountLevelWorkerVersionResourceType]Body param: Enum for base account-level resource types (those with no extra required fields).
Body param: Enum for base account-level resource types (those with no extra required fields).
Header param: ETag value for optimistic concurrency control. When provided, the server will verify the current resource ETag matches before applying the write. Returns 412 Precondition Failed if the resource has been modified since the ETag was obtained. Omit this header for unconditional writes.
ReturnsExpand Collapse
type AccountTagUpdateResponse interface{…}Response for access_application resources
Response for access_application resources
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAccessApplication struct{…}Response for access_application resources
Response for access_application resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAccessApplicationPolicy struct{…}Response for access_application_policy resources
Response for access_application_policy resources
Access application ID is required only for access_application_policy resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAccessGroup struct{…}Response for access_group resources
Response for access_group resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAccount struct{…}Response for account resources
Response for account resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAIGateway struct{…}Response for ai_gateway resources
Response for ai_gateway resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAlertingPolicy struct{…}Response for alerting_policy resources
Response for alerting_policy resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAlertingWebhook struct{…}Response for alerting_webhook resources
Response for alerting_webhook resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectAPIGatewayOperation struct{…}Response for api_gateway_operation resources
Response for api_gateway_operation resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectCloudflaredTunnel struct{…}Response for cloudflared_tunnel resources
Response for cloudflared_tunnel resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectCustomCertificate struct{…}Response for custom_certificate resources
Response for custom_certificate resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectCustomHostname struct{…}Response for custom_hostname resources
Response for custom_hostname resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectD1Database struct{…}Response for d1_database resources
Response for d1_database resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectDNSRecord struct{…}Response for dns_record resources
Response for dns_record resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectDurableObjectNamespace struct{…}Response for durable_object_namespace resources
Response for durable_object_namespace resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectGatewayList struct{…}Response for gateway_list resources
Response for gateway_list resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectGatewayRule struct{…}Response for gateway_rule resources
Response for gateway_rule resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectImage struct{…}Response for image resources
Response for image resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectKVNamespace struct{…}Response for kv_namespace resources
Response for kv_namespace resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectManagedClientCertificate struct{…}Response for managed_client_certificate resources
Response for managed_client_certificate resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectQueue struct{…}Response for queue resources
Response for queue resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectR2Bucket struct{…}Response for r2_bucket resources
Response for r2_bucket resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectResourceShare struct{…}Response for resource_share resources
Response for resource_share resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectStreamLiveInput struct{…}Response for stream_live_input resources
Response for stream_live_input resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectStreamVideo struct{…}Response for stream_video resources
Response for stream_video resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectWorker struct{…}Response for worker resources
Response for worker resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectWorkerVersion struct{…}Response for worker_version resources
Response for worker_version resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
type AccountTagUpdateResponseResourceTaggingTaggedResourceObjectZone struct{…}Response for zone resources
Response for zone resources
ETag identifier for optimistic concurrency control. Formatted as “v1:
Set tags for an account-level resource
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/cloudflare-go"
"github.com/stainless-sdks/cloudflare-go/option"
"github.com/stainless-sdks/cloudflare-go/resource_tagging"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
accountTag, err := client.ResourceTagging.AccountTags.Update(context.TODO(), resource_tagging.AccountTagUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: resource_tagging.AccountTagUpdateParamsBodyResourceTaggingSetTagsRequestAccountLevelWorkerVersion{
ResourceID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
ResourceType: cloudflare.F(resource_tagging.AccountTagUpdateParamsBodyResourceTaggingSetTagsRequestAccountLevelWorkerVersionResourceTypeWorker),
WorkerID: cloudflare.F("3f72a691-44b3-4c11-8642-c18a88ddaa5e"),
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", accountTag)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
"name": "my-worker-script",
"tags": {
"environment": "production",
"team": "engineering"
},
"type": "access_application"
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
"name": "my-worker-script",
"tags": {
"environment": "production",
"team": "engineering"
},
"type": "access_application"
}
}