Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to write key-value pair data to a specified namespace and supports setting expiration time. If the key already exists, it overwrites the original value. If Not Exist, it creates a new key-value pair.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: EdgeKVPut. |
| Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
| Region | No | String | Common Params. This parameter is not required. |
| ZoneId | Yes | String | Zone ID. |
| Namespace | Yes | String | Namespace name. |
| Key | Yes | String | Key name. The length is 1-512 characters. Allowed characters include letters, digits, hyphens, and underscores. |
| Value | Yes | String | Key-value. Cannot be empty and supports up to 1 MB. Supports storing string data. |
| Expiration | No | Integer | Expiration time, absolute time. It means the seconds elapsed since midnight (UTC/GMT) on January 1, 1970, and cannot be earlier than the current time. If both Expiration and ExpirationTTL are filled in, ExpirationTTL takes precedence. If neither Expiration nor ExpirationTTL is specified, the key-value pair will never expire. |
| ExpirationTTL | No | Integer | Expiration time, relative time, in seconds. Indicates the data will expire after the specified seconds, must be greater than 0. If both Expiration and ExpirationTTL are filled in, ExpirationTTL takes precedence. If neither Expiration nor ExpirationTTL is specified, the key-value pair will never expire. |
| Parameter Name | Type | Description |
|---|---|---|
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Write a key-value pair with key named hello and value world to namespace ns-011 of site zone-3j1xw7910arp, with expiry timestamp 1774513200 and TTL 3600 seconds.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: EdgeKVPut
<Common request parameters>
{
"ZoneId": "zone-3j1xw7910arp",
"Namespace": "ns-011",
"Key": "hello",
"Value": "world",
"Expiration": 1774513200,
"ExpirationTTL": 3600
}
{
"Response": {
"RequestId": "5fc4b004-890f-44dc-9c88-e6addd1cf146"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation | Operation failed. |
| ResourceUnavailable.NamespaceNotFound | KV namespace does not exist. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback