tencent cloud

APIs

EdgeKVPut

Focus Mode
Font Size
Last updated: 2026-04-13 14:45:58

1. API Description

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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.

3. Output Parameters

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.

4. Example

Example1 Writing EdgeKV Key-Value Pairs

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.

Input Example

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
}

Output Example

{
    "Response": {
        "RequestId": "5fc4b004-890f-44dc-9c88-e6addd1cf146"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback