CreateTag

POST {{baseUrl}}/tagNamespaces/:tagNamespaceId/tags

Creates a new tag in the specified tag namespace.

The tag requires either the OCID or the name of the tag namespace that will contain this tag definition.

You must specify a name for the tag, which must be unique across all tags in the tag namespace and cannot be changed. The name can contain any ASCII character except the space (_) or period (.) characters. Names are case insensitive. That means, for example, myTag and mytag are not allowed in the same namespace. If you specify a name that's already in use in the tag namespace, a 409 error is returned.

The tag must have a description. It does not have to be unique, and you can change it with UpdateTag.

The tag must have a value type, which is specified with a validator. Tags can use either a static value or a list of possible values. Static values are entered by a user applying the tag to a resource. Lists are created by you and the user must apply a value from the list. Lists are validiated.

  • If no validator is set, the user applying the tag to a resource can type in a static value or leave the tag value empty.
  • If a validator is set, the user applying the tag to a resource must select from a list of values that you supply with EnumTagDefinitionValidator.

Request Body

{"name"=>"qui fugiat", "description"=>"in comm", "isCostTracking"=>false, "validator"=>{"validatorType"=>"ENUM"}}

HEADERS

KeyDatatypeRequiredDescription
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or
server error without risk of executing that same action again. Retry tokens expire after 24
hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
has been deleted and purged from the system, then a retry of the original creation request
may be rejected).
Content-Typestring
Datestring(Required) Current Date
Authorizationstring(Required) Signature Authentication on Authorization header
x-content-sha256string(Required) Content sha256 for POST, PUT and PATCH operations

RESPONSES

status: OK

{"compartmentId":"fugiat incididunt dolor","tagNamespaceId":"mollit","tagNamespaceName":"cillum officia","id":"in tempor ","name":"eiusmod ad in elit","description":"deserunt","isRetired":false,"timeCreated":"1965-11-30T05:55:07.213Z","definedTags":{},"freeformTags":{},"isCostTracking":false,"lifecycleState":"INACTIVE","validator":{"validatorType":"ENUM"}}