Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
  • Access management
      • All methods
        • BatchGetItem
        • BatchWriteItem
        • CreateTable
        • DeleteItem
        • DeleteTable
        • DescribeTable
        • DescribeTimeToLive
        • GetItem
        • ListTables
        • PutItem
        • Query
        • Scan
        • TransactGetItems
        • TransactWriteItems
        • UpdateItem
        • UpdateTimeToLive
        • UpdateTable
    • Common errors when working with the Document API
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • Request
  • Parameters
  • Response
  • Parameters
  • Errors
  1. Amazon DynamoDB-compatible Document API
  2. Document API reference
  3. Actions
  4. UpdateTimeToLive

UpdateTimeToLive method

Written by
Yandex Cloud
Updated at February 28, 2023
  • Request
    • Parameters
  • Response
    • Parameters
  • Errors

Enables or disables TTL for the specified table.

If successful, returns the current TimeToLiveSpecification value. The operation may take up to an hour. Additional method calls for the same table will throw a ValidationException error until the operation is completed.

The TTL checking mechanism compares the current time in Unix time format with the time stored in the TTL attribute of an item. If it's less than the current time, the item is marked as obsolete and subsequently deleted.

Items with an expired TTL are usually deleted within two days, the deletion time depends on the nature of the workload. Obsolete but not yet deleted items are displayed when reading, querying, and scanning data. When deleting items from a table, they are immediately deleted from the local and global secondary indexes the same way as a standard delete operation.

Obsolete items are deleted to provide sufficient bandwidth for other data operations.

RequestRequest

The request contains data in JSON format.

{
  "TableName": "string",
  "TimeToLiveSpecification": {
    "AttributeName": "string",
    "Enabled": boolean
  }
}

ParametersParameters

Parameter Description
TableName Name of the table that the TTL state is requested for.
May contain a path in the directory hierarchy like path/to/table.

Type: String
Length: 3 - 255 characters.
Pattern: [a-zA-Z0-9_.-]+
Required: Yes
TimeToLiveSpecification Parameters used to enable or disable TTL for the specified table.

Type: Object of the TimeToLiveSpecification type.
Required: Yes

ResponseResponse

If successful, HTTP code 200 is returned.
The response is returned in JSON format.

{
  "TimeToLiveSpecification": {
    "AttributeName": "string",
    "Enabled": boolean
  }
}

ParametersParameters

Parameter Description
TimeToLiveSpecification Operation result.

Type: Object of the TimeToLiveSpecification type.

ErrorsErrors

Parameter Description
InternalServerError An internal error occurred on the server side.

HTTP status code: 500
LimitExceededException Table operations limit exceeded.
You can simultaneously perform up to 50 operations on tables, such as CreateTable, UpdateTable, DeleteTable, UpdateTimeToLive, RestoreTableFromBackup, and RestoreTableToPointInTime.

HTTP status code: 400
ResourceInUseException The resource is being used by another operation.

HTTP status code: 400
ResourceNotFoundException The specified table doesn't exist or its state is different from ACTIVE.

HTTP status code: 400

There may be common errors as well. These are errors that are common to all methods.

Was the article helpful?

Previous
UpdateItem
Next
UpdateTable
© 2025 Direct Cursus Technology L.L.C.