tencent cloud


GET Bucket versioning

Last updated: 2022-04-08 15:48:22


    This API is used to query the lifecycle configuration set for a bucket.

    API Explorer is recommended.
    API Explorer makes it easy to make online API calls, verify signatures, generate SDK code, search for APIs, etc. You can also use it to query the content of each request as well as its response.


    1. To query the versioning status of a bucket, you need to have permission to read the bucket.

    2. There are three versioning states: not enabled, enabled, or suspended.

      • If you have never enabled or suspended versioning for the bucket, the response is:

      • If you have enabled versioning for the bucket, the response is:

      • If you have suspended versioning for the bucket, the response is:



    Sample request

    GET /?versioning HTTP 1.1
    Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
    Date: GMT date
    Authorization: Auth String

    Request headers

    This API only uses Common Request Headers.

    Request body

    The request body of this request is empty.


    Response headers

    This API only returns Common Response Headers.

    Response body


    The nodes are described as follows:

    Node Name (Keyword) Parent Node Description Type
    VersioningConfiguration None Versioning configuration Container
    Status VersioningConfiguration Whether versioning is enabled. Enumerated values: Suspended, Enabled Enum

    Error codes

    This API returns common error responses and error codes. For more information, please see Error Codes.



    GET /?versioning HTTP/1.1
    Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.com
    Connection: keep-alive
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.12.4
    Authorization: q-sign-algorithm=sha1&q-ak=AKID15IsskiBQKTZbAo6WhgcBqVls9Sm****&q-sign-time=1480932292;1981012292&q-key-time=1480932292;1981012292&q-url-param-list=versioning&q-header-list=host&q-signature=5118a936049f9d44482bbb61309235cf4abe****


    HTTP/1.1 200 OK
    Content-Type: application/xml
    Content-Length: 120
    Connection: keep-alive
    Date: Wed, 23 Aug 2017 08:15:16 GMT
    Server: tencent-cos
    x-cos-request-id: NTk5ZDM5OTRfZDNhZDM1MGFfMjYyMTFfZmU3****
    <?xml version='1.0' encoding='utf-8' ?>

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support