# Update build trigger

## Body parameters

name string Optional

Name of the build trigger

Example: `"Custom build trigger"`

adapter enum Optional

The type of build trigger

Example: `"custom"`

Show enum values

custom Optional

`adapter_settings` must include the following properties: `trigger_url`, `headers` and `payload`.

netlify Optional

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

vercel Optional

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

circle\_ci Optional

`adapter_settings` must include the following properties: `project`, `token`, `revision`, `vcs`, `build_parameters`

gitlab Optional

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

travis Optional

`adapter_settings` must include the following properties: `api_token`, `repo`, `branch`, `config`

indexing\_enabled boolean Optional

Wether Site Search is enabled or not. With Site Search, everytime the website is built, DatoCMS will respider it to get updated content

frontend\_url string, null Optional

The public URL of the frontend. If Site Search is enabled (indicated by `indexing_enabled`), this is the starting point from which the website's spidering will start

Example: `"https://www.mywebsite.com/"`

autotrigger\_on\_scheduled\_publications boolean Optional

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

adapter\_settings object Optional

Additional settings for the build trigger. The value depends on the `adapter`.

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

## Returns

Returns a resource object of type [build\_trigger](https://www.datocms.com/docs/content-management-api/resources/build-trigger.md)

## Examples

Example Basic example

###### Code

```javascript
import { buildClient } from "@datocms/cma-client-node";

async function run() {
  const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });

  const buildTriggerId = "1822";

  const buildTrigger = await client.buildTriggers.update(buildTriggerId, {
    id: "1822",
  });

  // Check the 'Returned output' tab for the result ☝️
  console.log(buildTrigger);
}

run();
```

###### Returned output

```javascript
{
  id: "1822",
  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",
  indexing_status: "success",
  frontend_url: "https://www.mywebsite.com/",
  indexing_enabled: true,
  autotrigger_on_scheduled_publications: true,
}
```

## Related content in "Content Management API"

- [Content Management API Overview](https://www.datocms.com/docs/content-management-api.md)

- [Using the JavaScript client](https://www.datocms.com/docs/content-management-api/using-the-nodejs-clients.md)
- [API versioning](https://www.datocms.com/docs/content-management-api/api-versioning.md)

- [Authentication](https://www.datocms.com/docs/content-management-api/authentication.md)
- [Environments](https://www.datocms.com/docs/content-management-api/setting-the-environment.md)

- [Error codes & handling failures (CMA)](https://www.datocms.com/docs/content-management-api/errors.md)
- [Pagination](https://www.datocms.com/docs/content-management-api/pagination.md)

- [Asynchronous jobs](https://www.datocms.com/docs/content-management-api/async-jobs.md)
- [Technical Limits (CMA)](https://www.datocms.com/docs/content-management-api/technical-limits.md)

- [Record](https://www.datocms.com/docs/content-management-api/resources/item.md)
- [Scheduled publication](https://www.datocms.com/docs/content-management-api/resources/scheduled-publication.md)

- [Scheduled unpublishing](https://www.datocms.com/docs/content-management-api/resources/scheduled-unpublishing.md)
- [Upload](https://www.datocms.com/docs/content-management-api/resources/upload.md)

- [Site](https://www.datocms.com/docs/content-management-api/resources/site.md)
- [Model/Block](https://www.datocms.com/docs/content-management-api/resources/item-type.md)

- [Field](https://www.datocms.com/docs/content-management-api/resources/field.md)
- [Fieldset](https://www.datocms.com/docs/content-management-api/resources/fieldset.md)

- [Record version](https://www.datocms.com/docs/content-management-api/resources/item-version.md)
- [Upload permission](https://www.datocms.com/docs/content-management-api/resources/upload-request.md)

- [Upload track](https://www.datocms.com/docs/content-management-api/resources/upload-track.md)
- [Manual tags](https://www.datocms.com/docs/content-management-api/resources/upload-tag.md)

- [Smart tags](https://www.datocms.com/docs/content-management-api/resources/upload-smart-tag.md)
- [Upload Collection](https://www.datocms.com/docs/content-management-api/resources/upload-collection.md)

- [Search result](https://www.datocms.com/docs/content-management-api/resources/search-result.md)
- [Environment](https://www.datocms.com/docs/content-management-api/resources/environment.md)

- [Maintenance mode](https://www.datocms.com/docs/content-management-api/resources/maintenance-mode.md)
- [Menu Item](https://www.datocms.com/docs/content-management-api/resources/menu-item.md)

- [Schema Menu Item](https://www.datocms.com/docs/content-management-api/resources/schema-menu-item.md)
- [Uploads filter](https://www.datocms.com/docs/content-management-api/resources/upload-filter.md)

- [Model filter](https://www.datocms.com/docs/content-management-api/resources/item-type-filter.md)
- [Plugin](https://www.datocms.com/docs/content-management-api/resources/plugin.md)

- [Workflow](https://www.datocms.com/docs/content-management-api/resources/workflow.md)
- [Asynchronous job](https://www.datocms.com/docs/content-management-api/resources/job.md)

- [Job result](https://www.datocms.com/docs/content-management-api/resources/job-result.md)
- [Account](https://www.datocms.com/docs/content-management-api/resources/account.md)

- [Organization](https://www.datocms.com/docs/content-management-api/resources/organization.md)
- [Invitation](https://www.datocms.com/docs/content-management-api/resources/site-invitation.md)

- [Collaborator](https://www.datocms.com/docs/content-management-api/resources/user.md)
- [Role](https://www.datocms.com/docs/content-management-api/resources/role.md)

- [API token](https://www.datocms.com/docs/content-management-api/resources/access-token.md)
- [Webhook](https://www.datocms.com/docs/content-management-api/resources/webhook.md)

- [Webhook call](https://www.datocms.com/docs/content-management-api/resources/webhook-call.md)
- [Build trigger](https://www.datocms.com/docs/content-management-api/resources/build-trigger.md)

- [Deploy activity](https://www.datocms.com/docs/content-management-api/resources/build-event.md)
- [Subscription limit](https://www.datocms.com/docs/content-management-api/resources/subscription-limit.md)

- [Subscription feature](https://www.datocms.com/docs/content-management-api/resources/subscription-feature.md)
- [SSO Settings](https://www.datocms.com/docs/content-management-api/resources/sso-settings.md)

- [SSO User](https://www.datocms.com/docs/content-management-api/resources/sso-user.md)
- [SSO Group](https://www.datocms.com/docs/content-management-api/resources/sso-group.md)

- [White-label settings](https://www.datocms.com/docs/content-management-api/resources/white-label-settings.md)
- [Audit log event](https://www.datocms.com/docs/content-management-api/resources/audit-log-event.md)