Delete Table Data
Delete Table Data
This API allows you to batch delete specified records from Agent database tables, with a maximum limit of 1000 records per request.
Request Method
POST
Request URL
https://api-${endpoint}/v2/database/delete/record
Authentication
For authentication details, please refer to the Authentication section in the API Overview.
Request
Request Example
curl -X POST 'https://api-${endpoint}/v2/database/delete/record' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"table_id": "673af861ed69656ac0895b07",
"delete_data":[
{
"record_id":"123456",
},
{
"filter": {
"id": "789"
}
]
}'
curl -X POST 'https://api-${endpoint}/v2/database/delete/record' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"table_id": "673af861ed69656ac0895b07",
"delete_data":[
{
"record_id":"123456",
},
{
"filter": {
"id": "789"
}
]
}'
บล็อกโค้ดนี้ในหน้าต่างลอย
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${API Key} | Use Authorization: Bearer ${API Key} for authentication. Obtain your API key from the API Keys page. |
Content-Type | application/json | Data type, must be application/json. |
Request Body
Field | Type | Required | Description |
---|---|---|---|
table_id | string | Yes | The ID of the table. |
delete_data | array | Yes | Array of records to delete. |
record_id | string | No | Choose either record_id or filter condition. record_id is recommended. |
filter | map | No | Custom filter conditions (must use custom unique primary key fields). |
Note: You must specify either record_id or filter condition, with record_id being the recommended option. When both are provided, record_id takes precedence.
Response
Response Example
{
"code": 0,
"message": "OK"
}
{
"code": 0,
"message": "OK"
}
บล็อกโค้ดนี้ในหน้าต่างลอย
Successful Response
Field | Type | Description |
---|---|---|
code | int | Response code indicating the type of message. |
message | string | Response message description. |
Error Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Detailed error message. |
Error Codes
Code | Message |
---|---|
40000 | Invalid parameters |
50000 | Internal system error |
403106 | Table not found |
403131 | No permission to access table |