PATCH
/
api
/
request-logs
/
batch-update
import requests

url = "https://api.keywordsai.co/api/request-logs/batch-update/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
data = {
    "logs": [
        {   "unique_id": "xxxxxx",
            "metadata": {
                "metadata_key": "updated_value"
            },
            "note": "updated note"
        }
        # other logs to update
    ]
}
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers, json=data)
print(response.json())

You may want to update logs to add more information or correct the existing information. In order to protect the integrity of the logs, you can only update the metadata and notes of the logs.

unique_id
string

You can get a log’s unique_id from the Logs list endpoint. Then pass this unique_id to update the log.

{
    "unique_id": "xxxxxx"
}
metadata
dict

You can update the log’s metadata with this parameter.

note
string

You can also update a log’s note

positive_feedback
boolean

Update the log’s positive_feedback field.

import requests

url = "https://api.keywordsai.co/api/request-logs/batch-update/"
api_key = "YOUR_KEY" # Replace with your actual Keywords AI API key
data = {
    "logs": [
        {   "unique_id": "xxxxxx",
            "metadata": {
                "metadata_key": "updated_value"
            },
            "note": "updated note"
        }
        # other logs to update
    ]
}
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers, json=data)
print(response.json())