{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "description": "Tags are identifiers that you use to further define and track a some object. For example, to specify the location of a network or for which department particular IP's pool belongs.\n\nUser able to add the predefined set of Tags for account, as well as restrict values set which can be assigned to particular Tag key or add  validation for values by POSIX regex. One of the most useful feature is ability filter by specified Tag(Key -\u003e Values pair) or sort object by particular Tag key.\n\n Atlas Tagging API  responsible for defining Tag definitions,  it's no more than a set of rules(global for your account), this rules describe which values you can assign to exact key, rules works in a way  allow all what not forbidden.",
    "title": "Atlas Tagging API",
    "version": "v2"
  },
  "basePath": "/api/atlas-tagging/v2/",
  "paths": {
    "/namespacetags": {
      "post": {
        "description": "Validates the provided tags and returns or creates the corresponding namespace and tag definitions. Used internally by application services via tagging middleware.",
        "tags": [
          "TagService"
        ],
        "summary": "Get or create namespace tags",
        "operationId": "TagService_GetOrCreateNamespaceTags",
        "parameters": [
          {
            "description": "tagging.api.tags",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "description": "tagging.api.tags",
              "type": "string"
            }
          },
          {
            "type": "string",
            "description": "The account ID to scope validation.",
            "name": "account_id",
            "in": "query"
          }
        ],
        "responses": {
          "201": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceNamespaceTagsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    },
    "/tag_values/key/{key}/{namespace}": {
      "get": {
        "description": "Returns the list of values for a specific tag identified by namespace and key. Supports optional prefix filtering via the value_prefix query parameter for typeahead use cases. An empty or 'default' namespace are equivalent.",
        "tags": [
          "TagService"
        ],
        "summary": "Read tag values",
        "operationId": "TagService_ReadTagValues",
        "parameters": [
          {
            "type": "string",
            "description": "The tag key to look up values for.",
            "name": "key",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "The namespace name. Use \"default\" or empty string for the default namespace.",
            "name": "namespace",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "Optional typeahead prefix filter for values (e.g., \"us-\" returns values starting with \"us-\").",
            "name": "value_prefix",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceReadTagValuesResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    },
    "/tags": {
      "get": {
        "description": "Returns a paginated list of tag definitions for the authenticated account. Supports filtering by key, type, and status using Atlas collection operators.",
        "tags": [
          "TagService"
        ],
        "summary": "List tag definitions",
        "operationId": "TagService_List",
        "parameters": [
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null.\n\nLiteral values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions:\n\n|  Op   |  Description               | \n|  --   |  -----------               | \n|  ==   |  Equal                     | \n|  !=   |  Not Equal                 | \n|  \u003e    |  Greater Than              | \n|  \u003e=   |  Greater Than or Equal To  | \n|  \u003c    |  Less Than                 | \n|  \u003c=   |  Less Than or Equal To     | \n|  and  |  Logical AND               | \n|  ~    |  Matches Regex             | \n|  !~   |  Does Not Match Regex      | \n|  or   |  Logical OR                | \n|  not  |  Logical NOT               | \n|  ()   |  Groupping Operators       |\n\n\t\t\t\t\t\t",
            "name": "_filter",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.)\n\nSpecify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order.\n\n\t\t\t\t\t\t",
            "name": "_order_by",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nA collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource.\n\nSpecify this parameter as a comma-separated list of JSON tag names.\n\n\t\t\t\t\t\t",
            "name": "_fields",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "\n\nThe integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'.\n\n\t\t\t\t\t\t\t",
            "name": "_offset",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "\n\nThe integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value.\n\n\t\t\t\t\t\t\t",
            "name": "_limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "\n\nThe service-defined string used to identify a page of resources. A null value indicates the first page.\n\n\t\t\t\t\t\t\t",
            "name": "_page_token",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceListTagsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      },
      "post": {
        "description": "Creates a new tag definition in the authenticated account's default namespace. Returns the created tag definition with a server-assigned UUID. Tag key must be unique within the namespace and account.",
        "tags": [
          "TagService"
        ],
        "summary": "Create a tag definition",
        "operationId": "TagService_Create",
        "parameters": [
          {
            "description": "The tag definition to create. Required fields: key. Optional: type (default freeform), regexp, values.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/serviceTag"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceCreateTagResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      },
      "delete": {
        "description": "Soft-deletes (revokes) multiple tag definitions in a single request. Each tag's status is set to 'revoked'. Tags are not physically deleted.",
        "tags": [
          "TagService"
        ],
        "summary": "Bulk revoke tag definitions",
        "operationId": "TagService_DeleteSet",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/serviceDeleteSetTagRequest"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    },
    "/tags/{id}": {
      "get": {
        "description": "Returns a single tag definition by its unique resource ID, including its namespace, values, status, and version.",
        "tags": [
          "TagService"
        ],
        "summary": "Read a tag definition",
        "operationId": "TagService_Read",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceReadTagResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      },
      "put": {
        "description": "Updates an existing tag definition. PUT replaces all fields; PATCH updates only the fields specified in the field mask. The version field must match the current server-side version for optimistic concurrency control.",
        "tags": [
          "TagService"
        ],
        "summary": "Update a tag definition",
        "operationId": "TagService_Update",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "The tag definition with updated fields. The id and version fields must be set for optimistic concurrency.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/serviceTag"
            }
          },
          {
            "type": "string",
            "description": "Field mask for partial updates (PATCH). If empty, all fields are replaced (PUT).",
            "name": "fields",
            "in": "query"
          }
        ],
        "responses": {
          "201": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceUpdateTagResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      },
      "delete": {
        "description": "Soft-deletes (revokes) a tag definition by setting its status to 'revoked'. The tag definition is not physically deleted and can still be read. Revoked tags cannot be assigned to resources.",
        "tags": [
          "TagService"
        ],
        "summary": "Revoke a tag definition",
        "operationId": "TagService_Delete",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      },
      "patch": {
        "description": "Updates an existing tag definition. PUT replaces all fields; PATCH updates only the fields specified in the field mask. The version field must match the current server-side version for optimistic concurrency control.",
        "tags": [
          "TagService"
        ],
        "summary": "Update a tag definition",
        "operationId": "TagService_Update2",
        "parameters": [
          {
            "type": "string",
            "description": "An application specific resource identity of a resource",
            "name": "id",
            "in": "path",
            "required": true
          },
          {
            "description": "The tag definition with updated fields. The id and version fields must be set for optimistic concurrency.",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/serviceTag"
            }
          },
          {
            "type": "string",
            "description": "Field mask for partial updates (PATCH). If empty, all fields are replaced (PUT).",
            "name": "fields",
            "in": "query"
          }
        ],
        "responses": {
          "201": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/serviceUpdateTagResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "apiPageInfo": {
      "description": "PageInfo represents both server-driven and client-driven pagination response.\nServer-driven pagination is a model in which the server returns some\namount of data along with an token indicating there is more data\nand where subsequent queries can get the next page of data.\nClient-driven pagination is a model in which rows are addressable by\noffset and page size (limit).",
      "type": "object",
      "properties": {
        "offset": {
          "description": "The service may optionally include the offset of the next page of resources.\nA null value indicates no more pages.",
          "type": "integer",
          "format": "int32"
        },
        "page_token": {
          "description": "The service response should contain a string to indicate\nthe next page of resources.\nA null value indicates no more pages.",
          "type": "string"
        },
        "size": {
          "description": "The service may optionally include the total number of resources being paged.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "rpcStatus": {},
    "serviceCreateTagResponse": {
      "description": "CreateTagResponse contains the created tag definition with server-assigned ID.",
      "type": "object",
      "properties": {
        "result": {
          "description": "The created tag definition object.",
          "$ref": "#/definitions/serviceTag"
        }
      }
    },
    "serviceDeleteSetTagRequest": {
      "description": "DeleteSetTagRequest is the request message for bulk revoking multiple tag definitions.",
      "type": "object",
      "properties": {
        "ids": {
          "description": "The resource identifier.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "serviceListTagsResponse": {
      "description": "ListTagsResponse contains the paginated list of tag definitions.",
      "type": "object",
      "properties": {
        "page": {
          "description": "Pagination metadata.",
          "$ref": "#/definitions/apiPageInfo"
        },
        "results": {
          "description": "The list of tag definition objects.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/serviceTag"
          }
        }
      }
    },
    "serviceNamespace": {
      "type": "object",
      "properties": {
        "created_at": {
          "description": "Read-only. Timestamp created_at, equals to time when particular object was created. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "deleted_at": {
          "description": "Read-only. Timestamp deleted_at, equals to time when particular object was deleted, by default equals to null. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "name": {
          "description": "Human-readable name for namespace.",
          "type": "string"
        },
        "type": {
          "description": "The namespace type. Valid values: \"freeform\" (default), \"locked\", \"system\".",
          "type": "string"
        },
        "updated_at": {
          "description": "Read-only. Timestamp updated_at, equals to time when particular object was updated, by default equals to created_at. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "serviceNamespaceTagsResponse": {
      "description": "NamespaceTagsResponse contains namespaces and tags returned by GetOrCreateNamespaceTags.",
      "type": "object",
      "properties": {
        "namespaces": {
          "description": "The namespace objects (existing or newly created).",
          "type": "array",
          "items": {
            "$ref": "#/definitions/serviceNamespace"
          }
        },
        "tags": {
          "description": "The tag definition objects (existing or newly created).",
          "type": "array",
          "items": {
            "$ref": "#/definitions/serviceTag"
          }
        }
      }
    },
    "serviceReadTagResponse": {
      "description": "ReadTagResponse contains the requested tag definition.",
      "type": "object",
      "properties": {
        "result": {
          "description": "The tag definition object.",
          "$ref": "#/definitions/serviceTag"
        }
      }
    },
    "serviceReadTagValuesResponse": {
      "description": "ReadTagValuesResponse contains the values for the requested tag.",
      "type": "object",
      "properties": {
        "last_hint": {
          "description": "Hint indicating there are no more results beyond this page.",
          "type": "boolean"
        },
        "values": {
          "description": "The list of values for this tag.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/serviceValue"
          }
        }
      }
    },
    "serviceTag": {
      "type": "object",
      "properties": {
        "compartment_id": {
          "description": "The compartment ID for multi-tenancy scoping.",
          "type": "string"
        },
        "created_at": {
          "description": "Read-only. Timestamp created_at, equals to time when particular object was created. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "deleted_at": {
          "description": "Read-only. Timestamp deleted_at, equals to time when particular object was deleted, by default equals to null. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "key": {
          "description": "The tag key. Must be unique within a namespace and account.",
          "type": "string"
        },
        "namespace": {
          "description": "The namespace is a reference of the namespace object to which this tag belongs.",
          "$ref": "#/definitions/serviceNamespace"
        },
        "regexp": {
          "description": "The tag regexp. POSIX regexp string, used for values validation. By default equals to \"*\" (allow all). Only applies to freeform tags.",
          "type": "string"
        },
        "regexp_description": {
          "description": "The regexp_description, optional human-readable description explaining the regexp validation pattern.",
          "type": "string"
        },
        "status": {
          "description": "The tag status. Valid values: \"active\" (default), \"revoked\" (soft-deleted).",
          "type": "string"
        },
        "type": {
          "description": "The tag type. Valid values: \"freeform\" (default — any value allowed), \"restricted\" (only predefined values allowed).",
          "type": "string"
        },
        "updated_at": {
          "description": "Read-only. Timestamp updated_at, equals to time when particular object was updated, by default equals to created_at. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "values": {
          "description": "The values is a repeated value objects which belongs to particular tag. For restricted tags, defines the set of allowed values.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/serviceValue"
          }
        },
        "version": {
          "description": "The version is used for optimistic concurrency control — prevents multiple users from updating the same tag simultaneously. Must match the current server-side version for updates to succeed.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "serviceUpdateTagResponse": {
      "description": "UpdateTagResponse contains the updated tag definition.",
      "type": "object",
      "properties": {
        "result": {
          "description": "The updated tag definition object with incremented version.",
          "$ref": "#/definitions/serviceTag"
        }
      }
    },
    "serviceValue": {
      "type": "object",
      "properties": {
        "created_at": {
          "description": "Read-only. Timestamp created_at, equals to time when particular object was created. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "deleted_at": {
          "description": "Read-only. Timestamp deleted_at, equals to time when particular object was deleted, by default equals to null. Format: RFC 3339 (ISO 8601).",
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "description": "The resource identifier.",
          "type": "string",
          "readOnly": true
        },
        "value": {
          "description": "The value string. Trimmed of leading/trailing whitespace on input.",
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "ApiKeyAuth": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "NamespaceService"
    },
    {
      "name": "TagService"
    }
  ]
}