Weav

Choose proposal version

POST https://api.weav.com/v1/kb-proposals/{id}/choose

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

Path parameters

idstringrequired

Format: uuid.

Body

choicestringrequired

One of: current, incoming, merged.

Request

cURL
curl --request POST \
  --url 'https://api.weav.com/v1/kb-proposals/{id}/choose' \
  --header "Authorization: Bearer ${WEAV_API_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{
  "choice": "current"
}'
JavaScript
const body = {
  "choice": "current"
};
const response = await fetch("https://api.weav.com/v1/kb-proposals/{id}/choose", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEAV_API_TOKEN}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(body)
});
console.log(response.status);
Python
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['WEAV_API_TOKEN']}"}
body = {"choice": "current"}
response = requests.post("https://api.weav.com/v1/kb-proposals/{id}/choose", headers=headers, json=body)
print(response.status_code)
PHP
use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('POST', 'https://api.weav.com/v1/kb-proposals/{id}/choose', [
    'headers' => ['Authorization' => 'Bearer '.getenv('WEAV_API_TOKEN')],
    'json' => array (
  'choice' => 'current',
),
]);
echo $response->getStatusCode();

Response

  • 200 OK
  • 409 Conflict