Update build trigger
Body parameters
Must be exactly "build_trigger".
Name of the build trigger
"Custom build trigger"
The type of build trigger
"custom"
adapter_settings must include the following properties: trigger_url, headers and payload. The custom adapter also supports CircleCI webhooks for backward compatibility.
adapter_settings must include the following properties: trigger_url, access_token, branch, site_id
adapter_settings must include the following properties: project_id, token, branch, team_id, deploy_hook_url
adapter_settings must include the following properties: trigger_url, token, ref, build_parameters
Whether the build trigger is enabled or not
The public URL of the frontend.
"https://www.mywebsite.com/"
Wheter an automatic build request to webhook_url should be made on scheduled publications/unpublishings
Additional settings for the build trigger. The value depends on the adapter.
{
trigger_url: "http://some-url.com/trigger",
headers: { Authorization: "Bearer abc123" },
payload: { type: "build_request" },
}
Wether Site Search is enabled or not. With Site Search, everytime the website is built, DatoCMS will respider it to get updated content
Site Search features have been detached from build triggers. This attribute has no effect anymore: we keep it present for retrocompatibility. If you're programmatically using this field, please get in touch with support@datocms.com
Returns
Returns a resource object of type build_trigger.
Examples
PUT https://site-api.datocms.com/build-triggers/:build_trigger_id HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "build_trigger", "id": "1822", "attributes": {} }}curl -g 'https://site-api.datocms.com/build-triggers/:build_trigger_id' \ -X PUT \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"build_trigger","id":"1822","attributes":{}}}'await fetch("https://site-api.datocms.com/build-triggers/:build_trigger_id", { method: "PUT", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "build_trigger", id: "1822", attributes: {} }, }),});HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": { "type": "build_trigger", "id": "1822", "attributes": { "name": "Custom build trigger", "adapter": "custom", "adapter_settings": { "trigger_url": "http://some-url.com/trigger", "headers": { "Authorization": "Bearer abc123" }, "payload": { "type": "build_request" } }, "last_build_completed_at": "2017-03-30T09:29:14.872Z", "build_status": "success", "webhook_url": "https://webhooks.datocoms.com/xA1239ajsk123/deploy-results", "frontend_url": "https://www.mywebsite.com/", "enabled": true, "autotrigger_on_scheduled_publications": true } }}