# All methods

Source: https://modulify.ai/docs/api/methods

Every method the Modulify API offers, grouped by area, with the scope each one needs.

The API offers 239 methods. Each one is called with a `POST` to `https://api.modulify.ai/v1/` followed by its name, and each has its own page with what it does, whether it only reads, makes changes or is destructive, every argument it takes and a request you can copy.

A token can call only the methods its scopes allow, and `GET /v1/tools` lists exactly those. [Authentication](https://modulify.ai/docs/api/authentication) maps every scope to its methods.

## Workspaces

These act on the workspace itself and the people in it, rather than on any one site: members, invitations, roles and AI credits.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_workspaces`](https://modulify.ai/docs/api/workspaces/list-workspaces) | `workspaces:read` | Lists every Modulify workspace your account can reach, with the name, plan and your role in each. |
| [`get_workspace`](https://modulify.ai/docs/api/workspaces/get-workspace) | `workspaces:read` | Reads one workspace with its name, plan and AI credits, including a ready-made balance. |
| [`list_workspace_members`](https://modulify.ai/docs/api/workspaces/list-workspace-members) | `workspaces:read` | Lists the members of a workspace and its pending invitations, with each person's name, email, role and when they joined. |
| [`check_member_email`](https://modulify.ai/docs/api/workspaces/check-member-email) | `workspaces:read` | Checks one email address before inviting it, reporting whether it is already a member, already invited or free to invite. |
| [`get_workspace_credits`](https://modulify.ai/docs/api/workspaces/get-workspace-credits) | `workspaces:read` | Reads the reconciled AI credit balance of a workspace, the figure to trust right after a renewal or a top up. |
| [`get_workspace_credit_usage`](https://modulify.ai/docs/api/workspaces/get-workspace-credit-usage) | `workspaces:read` | Reads what a workspace spent its credits on over a period, so you can see where they went rather than only how many are left. |
| [`list_workspace_credit_activity`](https://modulify.ai/docs/api/workspaces/list-workspace-credit-activity) | `workspaces:read` | Lists the individual credit charges and refunds of a workspace, newest first, 20 at a time. |
| [`get_role_member_counts`](https://modulify.ai/docs/api/workspaces/get-role-member-counts) | `workspaces:read` | Counts how many people hold each role in a workspace. |
| [`create_workspace`](https://modulify.ai/docs/api/workspaces/create-workspace) | `workspaces:write` | Creates a new, empty workspace owned by you, on the Free plan and with no AI credits of its own. |
| [`rename_workspace`](https://modulify.ai/docs/api/workspaces/rename-workspace) | `workspaces:write` | Changes the name of a workspace, and optionally its logo. |
| [`set_default_workspace`](https://modulify.ai/docs/api/workspaces/set-default-workspace) | `workspaces:write` | Makes a workspace your default, the one the dashboard opens on and the one the Free plan grants its allowance to. |
| [`leave_workspace`](https://modulify.ai/docs/api/workspaces/leave-workspace) | `workspaces:write` | Removes you from a workspace you were invited to, ending your access to every site in it. |
| [`invite_workspace_member`](https://modulify.ai/docs/api/workspaces/invite-workspace-member) | `members:write` | Invites one or more people to a workspace by email, each with a join link. |
| [`resend_workspace_invite`](https://modulify.ai/docs/api/workspaces/resend-workspace-invite) | `members:write` | Sends the invitation email again for a pending invitation, with a fresh link that expires 7 days later. |
| [`cancel_workspace_invite`](https://modulify.ai/docs/api/workspaces/cancel-workspace-invite) | `members:write` | Withdraws an invitation that has not been accepted yet, so its link stops working. |
| [`remove_workspace_member`](https://modulify.ai/docs/api/workspaces/remove-workspace-member) | `members:write` | Removes a person from a workspace, ending their access to every site in it immediately. |
| [`assign_member_role`](https://modulify.ai/docs/api/workspaces/assign-member-role) | `members:write` | Puts an existing member on a different role, which changes what they can do across the whole workspace. |
| [`create_workspace_role`](https://modulify.ai/docs/api/workspaces/create-workspace-role) | `workspaces:write` | Creates a custom role in a workspace with a chosen set of permissions. |
| [`update_workspace_role`](https://modulify.ai/docs/api/workspaces/update-workspace-role) | `workspaces:write` | Changes the name or the permissions of a custom role, for everyone who holds it at once. |
| [`delete_workspace_role`](https://modulify.ai/docs/api/workspaces/delete-workspace-role) | `workspaces:write` | Deletes a custom role from a workspace and moves everyone holding it back to the stock Member role. |

## Sites

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_sites`](https://modulify.ai/docs/api/sites/list-sites) | `sites:read` | Lists the sites in a workspace, newest first, with the name, description, web addresses and last publish date of each. |
| [`get_site`](https://modulify.ai/docs/api/sites/get-site) | `sites:read` | Reads one site in full by its workspace and subdomain. |
| [`create_site`](https://modulify.ai/docs/api/sites/create-site) | `sites:create` | Creates a new site in a workspace and starts building it from your prompt straight away. |
| [`rename_site`](https://modulify.ai/docs/api/sites/rename-site) | `sites:write` | Changes the name, description or server location of a site. |
| [`check_subdomain_available`](https://modulify.ai/docs/api/sites/check-subdomain-available) | `sites:read` | Checks whether a free modulify.website subdomain is still available before change_subdomain takes it. |
| [`list_templates`](https://modulify.ai/docs/api/sites/list-templates) | `sites:read` | Browses the public Modulify site templates, the published and cloneable sites Modulify showcases. |
| [`duplicate_site`](https://modulify.ai/docs/api/sites/duplicate-site) | `sites:create` | Copies an existing site into a workspace as a new, independent site with its own subdomain and URL. |
| [`delete_site`](https://modulify.ai/docs/api/sites/delete-site) | `sites:delete` | Permanently deletes a site and takes the live site offline. |
| [`archive_sites`](https://modulify.ai/docs/api/sites/archive-sites) | `sites:write` | Puts one or more sites in the Archive of their workspace, at most 200 per call. |
| [`unarchive_sites`](https://modulify.ai/docs/api/sites/unarchive-sites) | `sites:write` | Brings one or more archived sites back out of the Archive, at most 200 per call. |
| [`set_show_badge`](https://modulify.ai/docs/api/sites/set-show-badge) | `sites:write` | Turns the Modulify badge on the published site on or off. |
| [`get_ai_preferences`](https://modulify.ai/docs/api/sites/get-ai-preferences) | `sites:read` | Reads the AI media preferences of a site, the settings that decide what its generated pictures and clips cost. |
| [`update_ai_preferences`](https://modulify.ai/docs/api/sites/update-ai-preferences) | `sites:write` | Changes the AI media preferences of a site, from whether paid media is on to the image and video models it uses. |
| [`change_subdomain`](https://modulify.ai/docs/api/sites/change-subdomain) | `sites:write` | Changes the free modulify.website address a site is served on, and the old address stops working at once. |
| [`update_sharing`](https://modulify.ai/docs/api/sites/update-sharing) | `sites:write` | Replaces every sharing setting of a site at once, from who can view it to what a clone takes along. |

## Folders

Folders group sites in the dashboard. A site sits in at most one, and a folder only ever holds sites from its own workspace. See [Folders](https://modulify.ai/docs/projects/folders).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_folders`](https://modulify.ai/docs/api/folders/list-folders) | `sites:read` | Lists the folders in a workspace with the name, slug, position, creator and a stored count of the sites in each. |
| [`create_folder`](https://modulify.ai/docs/api/folders/create-folder) | `sites:write` | Creates a folder in a workspace to group sites in the dashboard. |
| [`rename_folder`](https://modulify.ai/docs/api/folders/rename-folder) | `sites:write` | Changes the name of one folder and leaves its slug, and with it the dashboard URL, as it is. |
| [`update_folder_slug`](https://modulify.ai/docs/api/folders/update-folder-slug) | `sites:write` | Changes the slug of one folder, the part of the dashboard URL that identifies it. |
| [`check_folder_slug_available`](https://modulify.ai/docs/api/folders/check-folder-slug-available) | `sites:read` | Checks whether a folder slug is free in a workspace before update_folder_slug takes it. |
| [`move_sites_to_folder`](https://modulify.ai/docs/api/folders/move-sites-to-folder) | `sites:write` | Puts one or more sites into a folder, at most 200 per call, moving them out of whichever folder they were in. |
| [`remove_sites_from_folder`](https://modulify.ai/docs/api/folders/remove-sites-from-folder) | `sites:write` | Takes one or more sites out of whatever folder they are in, at most 200 per call, so they sit loose in the dashboard. |
| [`reorder_folders`](https://modulify.ai/docs/api/folders/reorder-folders) | `sites:write` | Sets the order the folders of a workspace appear in on the dashboard. |
| [`delete_folder`](https://modulify.ai/docs/api/folders/delete-folder) | `sites:delete` | Permanently deletes one folder without deleting the sites inside it. |
| [`move_folder_to_workspace`](https://modulify.ai/docs/api/folders/move-folder-to-workspace) | `sites:delete` | Moves a folder and every site inside it into a different workspace, in a one-way move that cannot be undone. |

## Site chat

These talk to the agent that builds a site, the same conversation the editor's chat shows. See [Building with prompts](https://modulify.ai/docs/api/building-with-prompts).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`send_message`](https://modulify.ai/docs/api/chat/send-message) | `chat:write` | Sends a prompt to the agent that builds a site, starting a generation at once or adding it to the queue when the site is busy. |
| [`get_job`](https://modulify.ai/docs/api/chat/get-job) | `chat:read` | Reads the progress of a site generation and the events it has produced since your last call. |
| [`cancel_job`](https://modulify.ai/docs/api/chat/cancel-job) | `chat:write` | Stops a generation that is currently running on a site. |
| [`list_messages`](https://modulify.ai/docs/api/chat/list-messages) | `chat:read` | Reads the conversation between the site owner and the agent that builds the site. |
| [`list_queued_messages`](https://modulify.ai/docs/api/chat/list-queued-messages) | `chat:read` | Reads the messages waiting to run on a site, oldest first, from the same queue everyone in the workspace sees. |
| [`edit_queued_message`](https://modulify.ai/docs/api/chat/edit-queued-message) | `chat:write` | Rewrites a message that is still waiting in a site's queue, before the site agent picks it up. |
| [`remove_queued_message`](https://modulify.ai/docs/api/chat/remove-queued-message) | `sites:delete` | Takes a message out of a site's queue so the site agent never runs it. |
| [`reorder_queued_message`](https://modulify.ai/docs/api/chat/reorder-queued-message) | `chat:write` | Moves a message that is still waiting in a site's queue so it runs earlier or later. |
| [`resume_queue`](https://modulify.ai/docs/api/chat/resume-queue) | `chat:write` | Releases a site's parked message queue and runs the message at the front of it. |
| [`clear_site_chat`](https://modulify.ai/docs/api/chat/clear-site-chat) | `sites:delete` | Deletes the entire chat transcript of a site for everyone and throws away every message queued to run next. |

## Source code

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_files`](https://modulify.ai/docs/api/code/list-files) | `code:read` | Lists the source files of a site with their sizes. |
| [`read_file`](https://modulify.ai/docs/api/code/read-file) | `code:read` | Reads one text file from a site's source code by its exact path. |
| [`get_site_logs`](https://modulify.ai/docs/api/code/get-site-logs) | `logs:read` | Reads the recent server logs of a site, the same stream the Logs panel shows. |
| [`write_file`](https://modulify.ai/docs/api/code/write-file) | `code:write` | Writes one or more source files straight into the running preview of a site, replacing whatever was at each path. |

## Publishing

See [Long-running work](https://modulify.ai/docs/api/long-running-work#publishes) for following a publish to the end.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`publish_site`](https://modulify.ai/docs/api/publishing/publish-site) | `publish:write` | Publishes a site so its current build goes live on its public address. |
| [`get_publish_status`](https://modulify.ai/docs/api/publishing/get-publish-status) | `sites:read` | Reads the state of a site's most recent publish, plus its public subdomain and custom domains. |
| [`list_deployments`](https://modulify.ai/docs/api/publishing/list-deployments) | `sites:read` | Lists the past publishes of a site, newest first, with their status and timings. |
| [`unpublish_site`](https://modulify.ai/docs/api/publishing/unpublish-site) | `publish:write` | Takes a published site off its public address, so visitors can no longer reach it. |
| [`get_publish_logs`](https://modulify.ai/docs/api/publishing/get-publish-logs) | `logs:read` | Reads the build output of a publish, which is where the reason for a failed publish actually lives. |
| [`get_publish_timeline`](https://modulify.ai/docs/api/publishing/get-publish-timeline) | `sites:read` | Reads a publish step by step, with when each step started and finished and how long it took. |
| [`stop_publish`](https://modulify.ai/docs/api/publishing/stop-publish) | `publish:write` | Stops a publish that is still running, so nothing from it reaches the live site. |

## Custom domains

A site can have up to 10 custom domains, and every connected one serves the same site. Each domain carries an `_id`, which the methods that act on one domain take as `domainId`. See [Connect a custom domain](https://modulify.ai/docs/publish/custom-domains).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_domain_status`](https://modulify.ai/docs/api/domains/get-domain-status) | `config:read` | Reads the custom domains of a site, with whether each one is connected and the exact DNS records each hostname needs. |
| [`get_domain_connect_url`](https://modulify.ai/docs/api/domains/get-domain-connect-url) | `config:read` | Returns a link that has the DNS provider add the records one custom domain needs automatically, where the provider supports it. |
| [`add_custom_domain`](https://modulify.ai/docs/api/domains/add-custom-domain) | `config:write` | Adds a custom domain to a site, alongside any it already has. |
| [`remove_custom_domain`](https://modulify.ai/docs/api/domains/remove-custom-domain) | `config:write` | Removes one custom domain from a site, deleting the domain and its TLS certificate. |
| [`add_www_domain`](https://modulify.ai/docs/api/domains/add-www-domain) | `config:write` | Adds the www version of one of a site's custom domains, so the root and the www address both reach the site. |
| [`remove_www_domain`](https://modulify.ai/docs/api/domains/remove-www-domain) | `config:write` | Detaches only the www companion of one custom domain, leaving that domain and every other domain of the site connected. |
| [`start_domain_verification`](https://modulify.ai/docs/api/domains/start-domain-verification) | `config:write` | Begins the ownership check for a domain before it is attached to a site, returning one TXT record to add. |
| [`verify_domain`](https://modulify.ai/docs/api/domains/verify-domain) | `config:write` | Finishes a domain ownership check and adds the domain to the site once its TXT record matches. |
| [`cancel_domain_verification`](https://modulify.ai/docs/api/domains/cancel-domain-verification) | `config:write` | Abandons the domain a site is waiting to verify, deleting the pending domain and its verification token. |

## Secrets

These are the environment variables on the editor's **Secrets** tab. Reading a value back takes the `credentials:reveal` scope. See [Secrets](https://modulify.ai/docs/data/secrets).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_secrets`](https://modulify.ai/docs/api/secrets/list-secrets) | `config:read` | Lists the environment variables configured for a site, the same set the Secrets tab shows. |
| [`set_secret`](https://modulify.ai/docs/api/secrets/set-secret) | `config:write` | Creates or replaces one environment variable on a site. |
| [`set_secrets`](https://modulify.ai/docs/api/secrets/set-secrets) | `config:write` | Creates, replaces and deletes environment variables on a site in one call, which is how a whole .env file is applied. |
| [`get_secret`](https://modulify.ai/docs/api/secrets/get-secret) | `credentials:reveal` | Returns the value of one environment variable in plain text, decrypting it when it is stored encrypted. |
| [`get_all_secrets`](https://modulify.ai/docs/api/secrets/get-all-secrets) | `credentials:reveal` | Returns every environment variable a person set on a site in plain text at once, keyed by variable id. |
| [`delete_secret`](https://modulify.ai/docs/api/secrets/delete-secret) | `config:write` | Deletes one environment variable from a site. |
| [`rename_secret`](https://modulify.ai/docs/api/secrets/rename-secret) | `config:write` | Renames one environment variable on a site and keeps its value, without reading the value. |

## Skills and connectors

These are the [skills](https://modulify.ai/docs/build/skills) and [connectors](https://modulify.ai/docs/build/connectors) a site's chat uses while it builds.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_site_skills`](https://modulify.ai/docs/api/skills-and-connectors/list-site-skills) | `config:read` | Lists every skill a site can use, the built-in ones and the workspace's own. |
| [`set_site_skill`](https://modulify.ai/docs/api/skills-and-connectors/set-site-skill) | `config:write` | Turns one skill on or off for a site. |
| [`list_site_connectors`](https://modulify.ai/docs/api/skills-and-connectors/list-site-connectors) | `config:read` | Lists the connectors installed in a site's workspace and whether each one is on for the site. |
| [`set_site_connector`](https://modulify.ai/docs/api/skills-and-connectors/set-site-connector) | `config:write` | Turns one connector on or off for a site. |

## Scheduled jobs

These are the site's own scheduled jobs, the ones configured in the editor. See [Scheduled jobs](https://modulify.ai/docs/automations/scheduled-jobs).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_site_crons`](https://modulify.ai/docs/api/scheduled-jobs/list-site-crons) | `config:read` | Lists the scheduled jobs configured on a site, with their schedules, their state and how their last scheduled run went. |
| [`list_site_cron_runs`](https://modulify.ai/docs/api/scheduled-jobs/list-site-cron-runs) | `config:read` | Lists recent runs of the scheduled jobs on a site, newest first, 25 to a page. |
| [`toggle_site_cron`](https://modulify.ai/docs/api/scheduled-jobs/toggle-site-cron) | `config:write` | Turns one scheduled job on a site on or off. |
| [`run_site_cron`](https://modulify.ai/docs/api/scheduled-jobs/run-site-cron) | `config:write` | Fires one scheduled job on a site immediately, without waiting for its schedule. |
| [`create_site_cron`](https://modulify.ai/docs/api/scheduled-jobs/create-site-cron) | `config:write` | Creates a scheduled job on a site that calls a URL on a repeating schedule. |
| [`update_site_cron`](https://modulify.ai/docs/api/scheduled-jobs/update-site-cron) | `config:write` | Changes the name, the schedule or the step of one scheduled job on a site. |
| [`preview_cron_schedule`](https://modulify.ai/docs/api/scheduled-jobs/preview-cron-schedule) | `config:read` | Works out the next 5 times a schedule would fire, without saving anything. |
| [`delete_site_cron`](https://modulify.ai/docs/api/scheduled-jobs/delete-site-cron) | `config:write` | Permanently deletes one scheduled job from a site, along with its whole run history. |
| [`delete_all_site_crons`](https://modulify.ai/docs/api/scheduled-jobs/delete-all-site-crons) | `config:write` | Permanently deletes every scheduled job on a site and all of their run history in one call. |
| [`delete_site_cron_run`](https://modulify.ai/docs/api/scheduled-jobs/delete-site-cron-run) | `config:write` | Hides one run from the scheduled job history of a site. |
| [`clear_site_cron_runs`](https://modulify.ai/docs/api/scheduled-jobs/clear-site-cron-runs) | `config:write` | Hides the stored run history of the scheduled jobs on a site. |
| [`export_site_crons`](https://modulify.ai/docs/api/scheduled-jobs/export-site-crons) | `config:read` | Exports every scheduled job on a site as plain data. |

## Webhooks

Destination addresses come back stripped to their host, because a webhook address is itself a credential. See [Webhooks](https://modulify.ai/docs/automations/webhooks).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_site_webhooks`](https://modulify.ai/docs/api/webhooks/list-site-webhooks) | `config:read` | Lists the webhook endpoints on a site and the events each one listens to. |
| [`list_webhook_deliveries`](https://modulify.ai/docs/api/webhooks/list-webhook-deliveries) | `config:read` | Lists recent webhook delivery attempts on a site, newest first, 30 to a page. |
| [`get_webhook_delivery_stats`](https://modulify.ai/docs/api/webhooks/get-webhook-delivery-stats) | `config:read` | Counts the webhook deliveries of a site over a period, split into delivered, in progress and failed. |
| [`toggle_site_webhook`](https://modulify.ai/docs/api/webhooks/toggle-site-webhook) | `config:write` | Turns one webhook on a site on or off without deleting it. |
| [`test_site_webhook`](https://modulify.ai/docs/api/webhooks/test-site-webhook) | `config:write` | Sends a publish.succeeded test payload to one webhook endpoint so you can confirm it is wired up. |
| [`create_site_webhook`](https://modulify.ai/docs/api/webhooks/create-site-webhook) | `config:write` | Creates a webhook on a site, a URL Modulify calls when something happens to that site. |
| [`update_site_webhook`](https://modulify.ai/docs/api/webhooks/update-site-webhook) | `config:write` | Changes the name, destination URL, payload type or event list of one webhook. |
| [`delete_site_webhook`](https://modulify.ai/docs/api/webhooks/delete-site-webhook) | `config:write` | Permanently deletes one webhook from a site, along with its delivery history and signing secret. |
| [`delete_all_site_webhooks`](https://modulify.ai/docs/api/webhooks/delete-all-site-webhooks) | `config:write` | Permanently deletes every webhook on a site, with all of their delivery history and signing secrets. |
| [`delete_webhook_delivery`](https://modulify.ai/docs/api/webhooks/delete-webhook-delivery) | `config:write` | Hides a single delivery record from a site's webhook delivery log. |
| [`clear_webhook_deliveries`](https://modulify.ai/docs/api/webhooks/clear-webhook-deliveries) | `config:write` | Clears a site's stored webhook delivery log from view and reports how many entries went. |
| [`export_site_webhooks`](https://modulify.ai/docs/api/webhooks/export-site-webhooks) | `config:read` | Exports every webhook on a site as plain data, without signing secrets or full URLs. |
| [`get_site_webhook_secret`](https://modulify.ai/docs/api/webhooks/get-site-webhook-secret) | `credentials:reveal` | Returns the signing secret of one webhook in plain text. |
| [`rotate_site_webhook_secret`](https://modulify.ai/docs/api/webhooks/rotate-site-webhook-secret) | `credentials:reveal` | Replaces the signing secret of one webhook with a freshly generated one and returns it. |

## Deploy hooks

A deploy hook is a secret address that starts a publish of the site when anything calls it. These methods manage the hooks and read their call log. See [Deploy hooks](https://modulify.ai/docs/automations/deploy-hooks).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_deploy_hooks`](https://modulify.ai/docs/api/deploy-hooks/list-deploy-hooks) | `config:read` | Lists the deploy hooks on a site with their name, whether each is on and how their calls went. |
| [`list_deploy_hook_calls`](https://modulify.ai/docs/api/deploy-hooks/list-deploy-hook-calls) | `config:read` | Lists the calls made to a site's deploy hooks, 30 to a page. |
| [`get_deploy_hook_call_stats`](https://modulify.ai/docs/api/deploy-hooks/get-deploy-hook-call-stats) | `config:read` | Counts the calls to a site's deploy hooks over a period, split into builds started, already building and rejected. |
| [`toggle_deploy_hook`](https://modulify.ai/docs/api/deploy-hooks/toggle-deploy-hook) | `config:write` | Turns one deploy hook on or off without deleting it. |
| [`trigger_deploy_hook`](https://modulify.ai/docs/api/deploy-hooks/trigger-deploy-hook) | `publish:write` | Calls one deploy hook now, exactly as its URL would be called, which starts a real publish of the site. |
| [`create_deploy_hook`](https://modulify.ai/docs/api/deploy-hooks/create-deploy-hook) | `config:write` | Creates a deploy hook, a secret URL that publishes the site whenever something calls it with a plain GET. |
| [`rename_deploy_hook`](https://modulify.ai/docs/api/deploy-hooks/rename-deploy-hook) | `config:write` | Changes the name of one deploy hook. |
| [`delete_deploy_hook`](https://modulify.ai/docs/api/deploy-hooks/delete-deploy-hook) | `config:write` | Permanently deletes one deploy hook and its whole call log. |
| [`delete_all_deploy_hooks`](https://modulify.ai/docs/api/deploy-hooks/delete-all-deploy-hooks) | `config:write` | Permanently deletes every deploy hook on a site, with all of their call logs. |
| [`delete_deploy_hook_call`](https://modulify.ai/docs/api/deploy-hooks/delete-deploy-hook-call) | `config:write` | Hides one call from a site's deploy hook call log and from the counts. |
| [`clear_deploy_hook_calls`](https://modulify.ai/docs/api/deploy-hooks/clear-deploy-hook-calls) | `config:write` | Hides a site's stored deploy hook call log and reports how many calls went. |
| [`export_deploy_hooks`](https://modulify.ai/docs/api/deploy-hooks/export-deploy-hooks) | `config:read` | Exports every deploy hook on a site as plain data, with each URL masked. |
| [`get_deploy_hook_url`](https://modulify.ai/docs/api/deploy-hooks/get-deploy-hook-url) | `credentials:reveal` | Returns the full URL of one deploy hook in plain text. |
| [`rotate_deploy_hook_url`](https://modulify.ai/docs/api/deploy-hooks/rotate-deploy-hook-url) | `credentials:reveal` | Replaces the URL of one deploy hook with a freshly generated one and returns it. |

## Emails

These cover what the **Emails** tab does: sending, the history and its insights, blocked addresses, the site's email domains and forwarding. See [Emails](https://modulify.ai/docs/automations/emails).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_email_settings`](https://modulify.ai/docs/api/emails/get-site-email-settings) | `config:read` | Reads how a site sends email, from its address, usage and limits to its own email domains and where mail sent to it is forwarded. |
| [`get_site_email_usage`](https://modulify.ai/docs/api/emails/get-site-email-usage) | `config:read` | Reads this calendar month's email usage of a site on its own, with the sends used, included and left and when the count resets. |
| [`list_site_email_sends`](https://modulify.ai/docs/api/emails/list-site-email-sends) | `config:read` | Lists the emails a site has sent, 30 to a page, with each one's recipients, status, source and opens and clicks. |
| [`get_site_email`](https://modulify.ai/docs/api/emails/get-site-email) | `config:read` | Reads one email a site sent in full, with every recipient's own status, the delivery events, the stored body and the clicked links. |
| [`get_site_email_stats`](https://modulify.ai/docs/api/emails/get-site-email-stats) | `config:read` | Counts the emails a site sent over a period, split into delivered, still pending and failed, with open and click rates and the top links. |
| [`list_site_email_suppressions`](https://modulify.ai/docs/api/emails/list-site-email-suppressions) | `config:read` | Lists the addresses and domains a site is blocked from emailing, 50 to a page, newest first, with why each one is there. |
| [`toggle_site_emails`](https://modulify.ai/docs/api/emails/toggle-site-emails) | `config:write` | Turns email sending on or off for a site, keeping its address, settings, blocked list and history either way. |
| [`update_site_email_settings`](https://modulify.ai/docs/api/emails/update-site-email-settings) | `config:write` | Changes how a site's email appears in an inbox, from the sender name and sending address to the reply-to and open and click tracking. |
| [`send_site_email`](https://modulify.ai/docs/api/emails/send-site-email) | `config:write` | Sends one real email from a site's own sending address, right now, to the recipients you named. |
| [`send_test_site_email`](https://modulify.ai/docs/api/emails/send-test-site-email) | `config:write` | Sends one free test email from a site to the email address of the connected account, and to no other address. |
| [`block_site_email_address`](https://modulify.ai/docs/api/emails/block-site-email-address) | `config:write` | Adds one address, or one whole domain, to a site's blocked list by hand, so the site never emails it again. |
| [`delete_site_email_suppression`](https://modulify.ai/docs/api/emails/delete-site-email-suppression) | `config:write` | Takes one address, or one whole domain blocked by hand, off a site's blocked list, so the site emails it again from the next message on. |
| [`add_site_email_domain`](https://modulify.ai/docs/api/emails/add-site-email-domain) | `config:write` | Adds a domain you own, or a subdomain of it, to a site so the site can send email from it and, when you want, receive email at it. |
| [`check_site_email_domain`](https://modulify.ai/docs/api/emails/check-site-email-domain) | `config:write` | Checks one email domain of a site again now, looking up its DNS records and asking the mail provider where it stands. |
| [`remove_site_email_domain`](https://modulify.ai/docs/api/emails/remove-site-email-domain) | `config:write` | Removes an email domain from a site, so the site stops sending from it and mail sent to it is no longer forwarded. |
| [`set_site_email_sending_domain`](https://modulify.ai/docs/api/emails/set-site-email-sending-domain) | `config:write` | Chooses the domain a site sends its email from, one of its verified email domains or its built-in sending domain. |
| [`set_site_email_domain_receiving`](https://modulify.ai/docs/api/emails/set-site-email-domain-receiving) | `config:write` | Turns receiving on or off for one verified email domain of a site, which decides whether mail sent to that domain is forwarded. |
| [`restart_site_email_domain_verification`](https://modulify.ai/docs/api/emails/restart-site-email-domain-verification) | `config:write` | Starts the verification of an email domain over when the mail provider gave up on it, which changes its three DKIM records. |
| [`get_site_email_domain_connect_url`](https://modulify.ai/docs/api/emails/get-site-email-domain-connect-url) | `config:write` | Checks whether the DNS provider of an email domain offers one-click setup and, when it does, returns the link that adds its records there. |
| [`set_site_email_forwarding`](https://modulify.ai/docs/api/emails/set-site-email-forwarding) | `config:write` | Turns the forwarding of incoming mail on or off for a site, which is on by default for every site. |
| [`add_site_email_forward_address`](https://modulify.ai/docs/api/emails/add-site-email-forward-address) | `config:write` | Adds an address to the forwarding addresses of a site, which every forwarded email goes to once the address is confirmed. |
| [`resend_site_email_forward_address`](https://modulify.ai/docs/api/emails/resend-site-email-forward-address) | `config:write` | Sends a new confirmation link to a forwarding address that is still pending, for example when the first link expired or never arrived. |
| [`remove_site_email_forward_address`](https://modulify.ai/docs/api/emails/remove-site-email-forward-address) | `config:write` | Takes one address off the forwarding addresses of a site, so mail sent to the site stops reaching it at once. |
| [`list_site_email_engagement`](https://modulify.ai/docs/api/emails/list-site-email-engagement) | `config:read` | Lists the emails a site sent with open and click tracking on, 30 to a page, the way the Opens and clicks view of the Emails tab shows them. |
| [`list_site_email_credits`](https://modulify.ai/docs/api/emails/list-site-email-credits) | `config:read` | Lists the AI credits a site's email used, newest first and 20 to a page, with every block of extra emails it bought and every refund. |
| [`get_site_email_credit_stats`](https://modulify.ai/docs/api/emails/get-site-email-credit-stats) | `config:read` | Counts the AI credits a site's email used over a period and the extra emails they bought. |
| [`delete_site_email_send`](https://modulify.ai/docs/api/emails/delete-site-email-send) | `config:write` | Removes one email from a site's history, without unsending it or changing this month's allowance. |
| [`clear_site_email_history`](https://modulify.ai/docs/api/emails/clear-site-email-history) | `config:write` | Clears the whole email history of a site, while sending, this month's allowance and the blocked addresses stay as they are. |
| [`get_site_email_key`](https://modulify.ai/docs/api/emails/get-site-email-key) | `credentials:reveal` | Reveals the email key of a site in plain text, with the API URL it goes with, creating the key when the site has none yet. |
| [`rotate_site_email_key`](https://modulify.ai/docs/api/emails/rotate-site-email-key) | `config:write` | Replaces the email key of a site with a new one, so the old key stops working at once and everywhere. |

## Database

These read and change the collections, schemas and rows of a site's database, the same data the CMS edits. None of them returns the credentials to the database. See [Site databases](https://modulify.ai/docs/data/databases).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_database`](https://modulify.ai/docs/api/database/get-site-database) | `data:read` | Checks whether a site has a database, whether it is running and which engine it runs. |
| [`list_collections`](https://modulify.ai/docs/api/database/list-collections) | `data:read` | Lists the tables in a site database with an exact row count for each. |
| [`get_collection_schema`](https://modulify.ai/docs/api/database/get-collection-schema) | `data:read` | Reads the columns of one table in a site database, with their types, nullability, primary key and CMS field type. |
| [`list_rows`](https://modulify.ai/docs/api/database/list-rows) | `data:read` | Reads rows from one table in a site database, ordered by primary key. |
| [`create_row`](https://modulify.ai/docs/api/database/create-row) | `data:write` | Inserts one row into a table in a site database. |
| [`update_row`](https://modulify.ai/docs/api/database/update-row) | `data:write` | Overwrites fields on one existing row in a site database, identified by its primary key. |
| [`delete_row`](https://modulify.ai/docs/api/database/delete-row) | `data:write` | Permanently deletes one row from a table in a site database, identified by its primary key. |
| [`clear_collection`](https://modulify.ai/docs/api/database/clear-collection) | `sites:delete` | Deletes every row in one table of a site database in a single irreversible step, keeping the table and its columns. |
| [`create_site_database`](https://modulify.ai/docs/api/database/create-site-database) | `data:write` | Gives a site a database if it does not have one yet. |
| [`list_reference_options`](https://modulify.ai/docs/api/database/list-reference-options) | `data:read` | Lists the rows another collection offers as targets for a reference column. |
| [`list_enum_options`](https://modulify.ai/docs/api/database/list-enum-options) | `data:read` | Lists every value a database enum type accepts. |
| [`clear_site_database`](https://modulify.ai/docs/api/database/clear-site-database) | `sites:delete` | Drops every collection in a site database, destroying the tables along with their columns and relationships. |
| [`execute_sql`](https://modulify.ai/docs/api/database/execute-sql) | `data:sql` | Runs a SQL statement against a site database and returns the rows. |
| [`export_collection`](https://modulify.ai/docs/api/database/export-collection) | `data:read` | Reads every row of one collection in a single call, with the column names and types alongside. |

## Storage

These reach the site's file storage. While a storage backup is being restored, the methods that change storage are refused until it finishes, and the ones that only read keep working. See [Storage](https://modulify.ai/docs/data/storage).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_storage_files`](https://modulify.ai/docs/api/storage/list-storage-files) | `data:read` | Browses a site's storage bucket one folder at a time, returning the folders and files directly under a path. |
| [`get_storage_stats`](https://modulify.ai/docs/api/storage/get-storage-stats) | `data:read` | Reads how much a site is storing, with the total number of files, the number of folders and the combined size in bytes. |
| [`get_storage_info`](https://modulify.ai/docs/api/storage/get-storage-info) | `data:read` | Reads how a site's storage is served to the public, from its CDN address to the traffic it has served over a period. |
| [`get_storage_file_url`](https://modulify.ai/docs/api/storage/get-storage-file-url) | `data:read` | Returns a link to one stored file so it can be opened or downloaded. |
| [`read_storage_file`](https://modulify.ai/docs/api/storage/read-storage-file) | `data:read` | Returns the contents of one stored file, base64 encoded. |
| [`upload_storage_file`](https://modulify.ai/docs/api/storage/upload-storage-file) | `data:write` | Puts a file into a site's storage bucket, as a public or a private file. |
| [`create_storage_folder`](https://modulify.ai/docs/api/storage/create-storage-folder) | `data:write` | Creates an empty folder in a site's storage bucket, so files can be organized before they are uploaded. |
| [`move_storage_files`](https://modulify.ai/docs/api/storage/move-storage-files) | `data:write` | Moves files and folders to another folder in a site's storage bucket, or renames a single file. |
| [`delete_storage_files`](https://modulify.ai/docs/api/storage/delete-storage-files) | `data:write` | Permanently deletes files from a site's storage bucket. |
| [`delete_storage_folder`](https://modulify.ai/docs/api/storage/delete-storage-folder) | `data:write` | Permanently deletes a folder from a site's storage bucket, along with everything inside it, nested subfolders included. |
| [`clear_storage`](https://modulify.ai/docs/api/storage/clear-storage) | `data:write` | Permanently deletes the files and folders in a site's storage bucket, public and private alike. |
| [`set_storage_visibility`](https://modulify.ai/docs/api/storage/set-storage-visibility) | `data:write` | Makes stored files or whole folders public or private. |
| [`set_storage_root_visibility`](https://modulify.ai/docs/api/storage/set-storage-root-visibility) | `data:write` | Sets whether new files uploaded with no visibility default to public or private at the top level of a site's storage. |
| [`get_storage_key`](https://modulify.ai/docs/api/storage/get-storage-key) | `credentials:reveal` | Returns a site's private storage key in plain text, minting one if the site never had one. |
| [`rotate_storage_key`](https://modulify.ai/docs/api/storage/rotate-storage-key) | `credentials:reveal` | Replaces a site's private storage key with a freshly generated one and returns it in plain text. |

## Backups

These reach project backups, the code backup history, and the storage and database archives under [Backups](https://modulify.ai/docs/editor/backups). None of them downloads a backup, or a file out of one: downloading happens only in the editor.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_backups`](https://modulify.ai/docs/api/backups/list-backups) | `sites:read` | Lists the snapshots taken of a site, newest first, with the name, who took it, when, its size and how many pages and components it holds. |
| [`create_backup`](https://modulify.ai/docs/api/backups/create-backup) | `sites:write` | Takes a snapshot of a site's pages and components as they are right now, so restore_backup can roll the site back to it later. |
| [`restore_backup`](https://modulify.ai/docs/api/backups/restore-backup) | `sites:write` | Replaces the entire current content of a site with the content of an earlier backup. |
| [`delete_backup`](https://modulify.ai/docs/api/backups/delete-backup) | `sites:delete` | Permanently deletes one backup of a site, removing a restore point you may be relying on. |
| [`list_code_backups`](https://modulify.ai/docs/api/backups/list-code-backups) | `chat:read` | Lists the code backup history of a site, newest first, with the title, file count and author of each code backup. |
| [`restore_code_backup`](https://modulify.ai/docs/api/backups/restore-code-backup) | `sites:delete` | Rolls the source code of a site back to an earlier code backup and reloads the preview from it, deleting the whole site chat history. |
| [`list_storage_backups`](https://modulify.ai/docs/api/backups/list-storage-backups) | `sites:read` | Lists the archives taken of a site's file storage, newest first, with the state of each and the site's manual backup allowance. |
| [`create_storage_backup`](https://modulify.ai/docs/api/backups/create-storage-backup) | `sites:write` | Takes an archive of a site's whole file storage, public and private files alike, so its files can be put back from it later. |
| [`delete_storage_backup`](https://modulify.ai/docs/api/backups/delete-storage-backup) | `sites:delete` | Permanently deletes one storage backup of a site, leaving the live storage of the site untouched. |
| [`clear_storage_backups`](https://modulify.ai/docs/api/backups/clear-storage-backups) | `sites:delete` | Permanently deletes every storage backup of a site in one call, leaving the live storage of the site untouched. |
| [`set_storage_backup_schedule`](https://modulify.ai/docs/api/backups/set-storage-backup-schedule) | `sites:write` | Turns the automatic daily storage backup of a site on or off, the same as the Daily backups switch in Storage configuration. |
| [`browse_storage_backup`](https://modulify.ai/docs/api/backups/browse-storage-backup) | `data:read` | Looks inside one storage backup without changing anything, a folder at a time or by searching the whole archive. |
| [`read_storage_backup_file`](https://modulify.ai/docs/api/backups/read-storage-backup-file) | `data:read` | Reads one file out of a storage backup as plain text, without changing anything. |
| [`restore_storage_backup`](https://modulify.ai/docs/api/backups/restore-storage-backup) | `data:write` | Puts files back into a site's storage from one of its backups, after a first call that only answers the plan. |
| [`get_storage_restore_status`](https://modulify.ai/docs/api/backups/get-storage-restore-status) | `data:read` | Reads how a storage restore is going, from its status and current step to the files written back and removed so far. |
| [`list_database_backups`](https://modulify.ai/docs/api/backups/list-database-backups) | `sites:read` | Lists the archives taken of a site's database, newest first, with the state of each and whether the site can be backed up at all. |
| [`create_database_backup`](https://modulify.ai/docs/api/backups/create-database-backup) | `sites:write` | Takes an archive of a site's database, a plain SQL dump of every table and row, so the data can be recovered by hand later. |
| [`delete_database_backup`](https://modulify.ai/docs/api/backups/delete-database-backup) | `sites:delete` | Permanently deletes one database backup of a site, leaving the live database of the site untouched. |
| [`clear_database_backups`](https://modulify.ai/docs/api/backups/clear-database-backups) | `sites:delete` | Permanently deletes every database backup of a site in one call, leaving the live database of the site untouched. |
| [`set_database_backup_schedule`](https://modulify.ai/docs/api/backups/set-database-backup-schedule) | `sites:write` | Turns the automatic daily database backup of a site on or off, the same as the Daily backups switch in CMS settings. |

## Analytics

The methods here that read numbers share 1,200 analytics lookups per site per hour across every token and AI client. See [Rate limits](https://modulify.ai/docs/api/rate-limits).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_analytics`](https://modulify.ai/docs/api/analytics/get-site-analytics) | `analytics:read` | Reads a site's visitor numbers over a fixed period, the six headline metrics plus a visitors series to chart. |
| [`get_site_analytics_overview`](https://modulify.ai/docs/api/analytics/get-site-analytics-overview) | `analytics:read` | Reads everything the Analytics tab shows for a site in one call, from the headline totals and series to the top lists and live count. |
| [`get_analytics_status`](https://modulify.ai/docs/api/analytics/get-analytics-status) | `analytics:read` | Reads whether visitor analytics is on for a site, whether the published site carries the tracking script, and whether it is collecting now. |
| [`get_site_realtime_visitors`](https://modulify.ai/docs/api/analytics/get-site-realtime-visitors) | `analytics:read` | Reads how many people are on a published site at this moment, as a single visitor count. |
| [`check_analytics_installation`](https://modulify.ai/docs/api/analytics/check-analytics-installation) | `analytics:read` | Checks whether analytics is installed and collecting on a site, and whether the site is published yet. |
| [`query_site_analytics`](https://modulify.ai/docs/api/analytics/query-site-analytics) | `analytics:read` | Asks an arbitrary question of a site's visitor analytics as a Plausible Stats v2 query, such as its top pages, sources or countries. |
| [`export_site_analytics`](https://modulify.ai/docs/api/analytics/export-site-analytics) | `analytics:read` | Exports the all-time visitor analytics of a site in one call, as top pages, sources, countries, browsers, operating systems and devices. |
| [`set_analytics_enabled`](https://modulify.ai/docs/api/analytics/set-analytics-enabled) | `sites:write` | Turns visitor analytics collection on or off for a site, reaching visitors only once the site is published again. |
| [`clear_site_analytics`](https://modulify.ai/docs/api/analytics/clear-site-analytics) | `sites:delete` | Permanently deletes the entire visitor history of a site, with no export taken first. |
| [`get_analytics_key`](https://modulify.ai/docs/api/analytics/get-analytics-key) | `credentials:reveal` | Returns the analytics API key of a site in plain text, minting one if the site never had one. |
| [`rotate_analytics_key`](https://modulify.ai/docs/api/analytics/rotate-analytics-key) | `credentials:reveal` | Replaces the analytics API key of a site with a freshly generated one and returns the new key in plain text. |

## Comments

Review comments are pinned to a spot on the site preview. See [Comments](https://modulify.ai/docs/editor/comments).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_comments`](https://modulify.ai/docs/api/comments/list-comments) | `comments:read` | Lists the review comments left on a site, with each one's author, status, reply count, reactions and attachments. |
| [`get_comment`](https://modulify.ai/docs/api/comments/get-comment) | `comments:read` | Reads one comment in full together with its replies, reactions and attachments. |
| [`count_open_comments`](https://modulify.ai/docs/api/comments/count-open-comments) | `comments:read` | Counts the open comment threads on a site, the number the product shows on the comments badge. |
| [`create_comment`](https://modulify.ai/docs/api/comments/create-comment) | `comments:write` | Leaves a new review comment pinned to a spot on the preview of a site. |
| [`reply_to_comment`](https://modulify.ai/docs/api/comments/reply-to-comment) | `comments:write` | Adds a reply to an existing comment thread. |
| [`update_comment`](https://modulify.ai/docs/api/comments/update-comment) | `comments:write` | Changes the text of a comment or a reply you wrote. |
| [`resolve_comment`](https://modulify.ai/docs/api/comments/resolve-comment) | `comments:write` | Marks a comment thread as resolved, signing off a reviewer's point once it has been dealt with. |
| [`reopen_comment`](https://modulify.ai/docs/api/comments/reopen-comment) | `comments:write` | Puts a resolved comment thread back to open, for when what it asked for turned out not to be done. |
| [`delete_comment`](https://modulify.ai/docs/api/comments/delete-comment) | `comments:write` | Deletes a comment or a reply you wrote, or one left by someone outside the workspace. |
| [`move_comment_pin`](https://modulify.ai/docs/api/comments/move-comment-pin) | `comments:write` | Moves the pin of a comment to a different spot on the preview. |
| [`add_comment_reaction`](https://modulify.ai/docs/api/comments/add-comment-reaction) | `comments:write` | Adds an emoji reaction to a comment or a reply. |
| [`remove_comment_reaction`](https://modulify.ai/docs/api/comments/remove-comment-reaction) | `comments:write` | Removes your own emoji reaction from a comment or a reply. |
| [`list_comment_attachments`](https://modulify.ai/docs/api/comments/list-comment-attachments) | `comments:read` | Lists the images attached to one comment or reply, with their public URLs. |
| [`upload_comment_attachment`](https://modulify.ai/docs/api/comments/upload-comment-attachment) | `comments:write` | Attaches one or more images to a comment or a reply. |
| [`delete_comment_attachment`](https://modulify.ai/docs/api/comments/delete-comment-attachment) | `comments:write` | Permanently removes one image from a comment or reply. |

## Your account

These act on the account the token belongs to and cannot be pointed at anybody else.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_account`](https://modulify.ai/docs/api/account/get-account) | `account:read` | Reads the account the token belongs to, with its name, email, avatar, phone and email, notification and sound preferences. |
| [`update_account`](https://modulify.ai/docs/api/account/update-account) | `account:write` | Changes the display name, phone number, avatar or notification preferences of the account the token belongs to. |
| [`get_site_usage`](https://modulify.ai/docs/api/account/get-site-usage) | `workspaces:read` | Reads how many sites the default workspace you own has used against its plan's site limit. |
| [`list_pending_invitations`](https://modulify.ai/docs/api/account/list-pending-invitations) | `account:read` | Lists the invitations waiting for you, from workspace invitations to workspace and site transfers. |
| [`list_referrals`](https://modulify.ai/docs/api/account/list-referrals) | `account:read` | Lists the accounts that subscribed through your referral code, with their status and monthly earnings. |
| [`list_payouts`](https://modulify.ai/docs/api/account/list-payouts) | `account:read` | Lists the payouts made to you for referrals, with their status. |
| [`check_affiliate_code`](https://modulify.ai/docs/api/account/check-affiliate-code) | `account:read` | Checks whether a referral code is free before you claim it. |
| [`update_affiliate`](https://modulify.ai/docs/api/account/update-affiliate) | `account:write` | Sets the referral code people use to sign up under you, and the email your payouts go to. |

## Next

- [Requests and responses](https://modulify.ai/docs/api/requests-and-responses) for how to call any of them.
- [OpenAPI](https://modulify.ai/docs/api/openapi) for the same catalog in a form tools can read.