Weav

Manually trigger URL resync

POST https://api.weav.com/v1/training-data/{id}/resync-now

Requires a token with the external-api:write ability.

Path parameters

idstringrequired

URL training data UUID

Format: uuid.

Request

cURL
curl --request POST \
  --url 'https://api.weav.com/v1/training-data/{id}/resync-now' \
  --header "Authorization: Bearer ${WEAV_API_TOKEN}"
JavaScript
const response = await fetch("https://api.weav.com/v1/training-data/{id}/resync-now", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEAV_API_TOKEN}`
  }
});
console.log(await response.json());
Python
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['WEAV_API_TOKEN']}"}
response = requests.post("https://api.weav.com/v1/training-data/{id}/resync-now", headers=headers)
print(response.json())
PHP
use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('POST', 'https://api.weav.com/v1/training-data/{id}/resync-now', [
    'headers' => ['Authorization' => 'Bearer '.getenv('WEAV_API_TOKEN')],
]);
echo $response->getBody();

Response

200 OK
{
    "success": true,
    "message": "string",
    "data": {
        "training_data_id": "9b2f6c1e-3d4a-4f5b-8c7d-1e2f3a4b5c6d",
        "urls_count": 3
    }
}
404 Not Found
{
    "error": "Error message",
    "code": "ERROR_CODE",
    "errors": {}
}
422 Unprocessable Content
{
    "error": "Error message",
    "code": "ERROR_CODE",
    "errors": {}
}
  • 401 Unauthorized

Response fields

training_data_idstring

Format: uuid.

urls_countinteger