# site\_update

Source: https://zotonic.com/docs/2208/site_update

URI: https://zotonic.com/id/2208

Language: en



Model for checking if a site has version control enabled.

Also implements the webhook to force a pull of new code from the version control system.

The URL for the webhook is:

```erlang
https://yoursite.test/api/model/site_update/post/webhook/<token>
```

Where `<token>` should be replaced with your configured token.

The token can be configured in the admin on System > Modules and then the config of the mod\_site\_update module.

The token is saved in the config key `mod_site_update.webhook_token`.

Available Model API Paths
-------------------------

| Method | Path pattern             | Description                                                                      |
| ------ | ------------------------ | -------------------------------------------------------------------------------- |
| `get`  | `/user_modules/...`      | Admin-only map of known modules with independent Git repositories; includes inactive modules and excludes the Zotonic repository. |
| `get`  | `/is_vcs_site/...`       | Return whether the current site source directory resolves to a VCS checkout (`.git`, `.hg`, or symlinked checkout). |
| `get`  | `/vcs_site/+site/...`    | Return admin-only VCS tuple for site `+site` (\`\{git                            |
| `get`  | `/vcs_zotonic/...`       | Return admin-only VCS tuple for the Zotonic core library directory (\`\{git      |
| `get`  | `/deployment_status/...` | Return node-wide coordinator status (`active`, `deployment`, `blocked`, `restart_required`). Requires administrator or `use mod_site_update` permission. A deployment is running only when both `active` and `deployment` are true. |
| `post` | `/webhook`               | Read webhook token from query arg `token`; if it matches `mod_site_update.webhook_token`, run the protected pull/build/activation deployment for the current site. No further lookups. |
| `post` | `/webhook/+token`        | Use path token `+token`; if it matches `mod_site_update.webhook_token`, run the protected pull/build/activation deployment for the current site. No further lookups. |

`/+name` marks a variable path segment. A trailing `/...` means extra path segments are accepted for further lookups.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2208?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2208?language=en>)
