Show examples in:
JavascriptHTTP
Content Management API > Build trigger

Build trigger

Configuration for different build triggers. You can have different staging and production environments in order to test your site before final deploy

Object payload

idstring

ID of build_trigger

Example:"1822"
typestring

Must be exactly "build_trigger".

attributes.namestring

Name of the build trigger

Example:"Custom build trigger"
attributes.adapterenum

The type of build trigger

Example:"custom"
custom

adapter_settings must include the following properties: trigger_url, headers and payload. The custom adapter also supports CircleCI webhooks for backward compatibility.

netlify

adapter_settings must include the following properties: trigger_url, access_token, branch, site_id

vercel

adapter_settings must include the following properties: project_id, token, branch, team_id, deploy_hook_url

gitlab

adapter_settings must include the following properties: trigger_url, token, ref, build_parameters

attributes.adapter_settingsnull, object

Additional settings for the build trigger. The value depends on the adapter. It returns null if the credentials you are using cannot manage the build triggers of the project.

Example:{ trigger_url: "http://some-url.com/trigger", headers: { Authorization: "Bearer abc123" }, payload: { type: "build_request" }, }
attributes.last_build_completed_at

Timestamp of the last build

Type:date-time, null
Example:"2017-03-30T09:29:14.872Z"
attributes.build_statusstring

Status of last build

Example:"success"
attributes.webhook_tokennull, string

Unique token for the webhook (it's the same token present in webhook_url). It returns null if the credentials you are using cannot manage the build triggers of the project.

Example:"xA1239ajsk123"
attributes.webhook_urlnull, string

The URL of the webhook your service has to call when the build completes to report it's status (success or error). It returns null if the credentials you are using cannot manage the build triggers of the project.

Example:"https://webhooks.datocoms.com/xA1239ajsk123/deploy-results"
attributes.frontend_urlstring, null

The public URL of the frontend.

Example:"https://www.mywebsite.com/"
attributes.enabledboolean

Whether the build trigger is enabled or not

attributes.autotrigger_on_scheduled_publicationsboolean

Wheter an automatic build request to webhook_url should be made on scheduled publications/unpublishings

attributes.indexing_statusstringDeprecated

Status of Site Search for the frontend

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

Example:"success"
attributes.indexing_enabledbooleanDeprecated

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

Available endpoints