# 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 326 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, minus the ones a token limited to specific sites can never use. [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, AI credits, and the spending caps and alerts.

| 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_workspace_spending`](https://modulify.ai/docs/api/workspaces/get-workspace-spending) | `workspaces:read` | Reads the monthly spending caps of a workspace, what this month's spending counts against them, the spending alerts and the auto top-up settings. |
| [`update_workspace_spending`](https://modulify.ai/docs/api/workspaces/update-workspace-spending) | `workspaces:write` | Sets or removes the monthly spending caps of a workspace and its spending alerts, changing only what you send. |
| [`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. |
| [`list_github_accounts`](https://modulify.ai/docs/api/workspaces/list-github-accounts) | `workspaces:read` | Lists the GitHub accounts connected to a workspace, with the id that create_site and move_site_code_to_github take. |
| [`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 and a fresh expiry. |
| [`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, the permissions or the default site role 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. |
| [`get_workspace_transfer`](https://modulify.ai/docs/api/workspaces/get-workspace-transfer) | `workspaces:read` | Reads the ownership transfer invitation you sent for a workspace that is still waiting for its recipient. |
| [`transfer_workspace`](https://modulify.ai/docs/api/workspaces/transfer-workspace) | `workspaces:write` | Emails another person an invitation to take over a workspace, which changes hands only once they accept it in the product. |
| [`cancel_workspace_transfer`](https://modulify.ai/docs/api/workspaces/cancel-workspace-transfer) | `workspaces:write` | Withdraws the open ownership transfer invitation of a workspace, so its emailed link stops working. |

## 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 infrastructure 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` | 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 in one call. |
| [`unarchive_sites`](https://modulify.ai/docs/api/sites/unarchive-sites) | `sites:write` | Brings one or more archived sites back out of the Archive in one 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. |
| [`clone_site`](https://modulify.ai/docs/api/sites/clone-site) | `sites:create` | Copies a template, or any site its owner shared for cloning, into one of your workspaces as a new site of your own. |
| [`move_site_to_workspace`](https://modulify.ai/docs/api/sites/move-site-to-workspace) | `sites:delete` | Moves one site into another workspace you belong to, a heavy one-way move that makes you its creator there. |
| [`get_site_transfer`](https://modulify.ai/docs/api/sites/get-site-transfer) | `sites:read` | Reads the transfer invitation you sent for a site that is still waiting for its recipient. |
| [`transfer_site`](https://modulify.ai/docs/api/sites/transfer-site) | `sites:delete` | Emails another person an invitation to take a site, which moves only once they accept it in the product. |
| [`cancel_site_transfer`](https://modulify.ai/docs/api/sites/cancel-site-transfer) | `sites:delete` | Withdraws the open transfer invitation of a site, so its emailed link stops working. |
| [`list_site_member_access`](https://modulify.ai/docs/api/sites/list-site-member-access) | `sites:read` | Lists every member of the site's workspace with the role they hold on that one site. |
| [`set_site_member_access`](https://modulify.ai/docs/api/sites/set-site-member-access) | `members:write` | Gives one workspace member a different role on one site. |

## 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, 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, 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, in the same chats the editor shows, and start, rename, clear, close and merge the chats of a site. 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 chat 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 people on a site and the agent that builds it, in one chat. |
| [`list_queued_messages`](https://modulify.ai/docs/api/chat/list-queued-messages) | `chat:read` | Reads the messages waiting to run in one chat of 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 chat'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 chat'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 chat's queue so it runs earlier or later. |
| [`move_queued_message`](https://modulify.ai/docs/api/chat/move-queued-message) | `chat:write` | Moves a message that is still waiting in one chat's queue to the end of another chat's queue. |
| [`resume_queue`](https://modulify.ai/docs/api/chat/resume-queue) | `chat:write` | Releases the parked message queue of one chat and runs the message at the front of it. |
| [`clear_site_chat`](https://modulify.ai/docs/api/chat/clear-site-chat) | `sites:delete` | Clears the entire transcript of one chat of a site for everyone and throws away every message queued to run next in it. The chat stays open. |
| [`list_chats`](https://modulify.ai/docs/api/chat/list-chats) | `chat:read` | Lists the open chats of a site with each one's key, title, mode, running generation and unmerged changes, and whether another chat can be started. |
| [`create_chat`](https://modulify.ai/docs/api/chat/create-chat) | `chat:write` | Starts a new chat on a site and returns its chatId, or opens the chat every site comes with again when it is closed. |
| [`rename_chat`](https://modulify.ai/docs/api/chat/rename-chat) | `chat:write` | Gives a chat of a site a new title, for everyone in the workspace. |
| [`archive_chat`](https://modulify.ai/docs/api/chat/archive-chat) | `sites:delete` | Closes a chat of a site for everyone, and clears its messages and everything queued in it. |
| [`merge_chat_changes`](https://modulify.ai/docs/api/chat/merge-chat-changes) | `chat:write` | Tries again to merge the unmerged changes of a chat into the site. |
| [`discard_chat_changes`](https://modulify.ai/docs/api/chat/discard-chat-changes) | `sites:delete` | Throws away the unmerged changes of a chat, keeping everything it already merged into the site. |
| [`show_live_changes`](https://modulify.ai/docs/api/chat/show-live-changes) | `chat:write` | Picks the running chat whose unfinished changes the preview shows on top of the merged site, or shows the merged site alone. |

## 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. |
| [`get_site_repository`](https://modulify.ai/docs/api/code/get-site-repository) | `code:read` | Reads whether the code of a site lives with Modulify or in a GitHub account of the workspace, and how a move stands. |
| [`move_site_code_to_github`](https://modulify.ai/docs/api/code/move-site-code-to-github) | `code:write` | Copies the repository of a site into a connected GitHub account, after which Modulify edits and publishes from there. |
| [`move_site_code_to_modulify`](https://modulify.ai/docs/api/code/move-site-code-to-modulify) | `code:write` | Copies the code of a site that lives in your GitHub back into a repository Modulify manages. |
| [`rename_publish_branch`](https://modulify.ai/docs/api/code/rename-publish-branch) | `code:write` | Renames the GitHub branch every publish of a site writes to and builds from. |

## 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. |
| [`set_primary_domain`](https://modulify.ai/docs/api/domains/set-primary-domain) | `config:write` | Chooses which of a site's connected custom domains is the one address shown wherever only one is shown. |

## Bought domains

These work on the domains a workspace bought through Modulify, rather than on a site. Each bought domain carries an `_id`, which the methods that act on one take as `domainId`, and prices are in US cents. `buy_domain` and `renew_domain` never charge a card: they return a Stripe checkout link for a person to pay on, and paying on it does not save the card to the owner's account. `set_domain_auto_renew` turns auto-renew on or off: while it is on, Modulify renews the domain before it expires on the saved card of whoever the token belongs to. `get_domain_transfer_code` needs both the `credentials:reveal` and `domains:write` scopes. See [Buy a domain](https://modulify.ai/docs/publish/buy-a-domain).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`list_bought_domains`](https://modulify.ai/docs/api/bought-domains/list-bought-domains) | `domains:read` | Lists the domains a workspace bought through Modulify, newest first, 25 at a time. |
| [`get_bought_domain`](https://modulify.ai/docs/api/bought-domains/get-bought-domain) | `domains:read` | Reads one domain the workspace bought, with its registrant for the workspace owner. |
| [`list_domain_extensions`](https://modulify.ai/docs/api/bought-domains/list-domain-extensions) | `domains:read` | Lists the extensions Modulify sells with what each one costs to register and renew, the price list the Domains page shows. |
| [`search_available_domains`](https://modulify.ai/docs/api/bought-domains/search-available-domains) | `domains:read` | Checks which domains can be bought for a name, with what each one costs, the same search as the Domains page. |
| [`get_domain_price`](https://modulify.ai/docs/api/bought-domains/get-domain-price) | `domains:read` | Prices buying a domain, or renewing one the workspace bought, for a term in whole years. |
| [`buy_domain`](https://modulify.ai/docs/api/bought-domains/buy-domain) | `domains:buy` | Starts buying a domain for a workspace and returns a Stripe checkout link for a person to pay on. |
| [`renew_domain`](https://modulify.ai/docs/api/bought-domains/renew-domain) | `domains:buy` | Starts renewing a bought domain for more years and returns a Stripe checkout link for a person to pay on. |
| [`cancel_domain_checkout`](https://modulify.ai/docs/api/bought-domains/cancel-domain-checkout) | `domains:buy` | Closes a checkout link that buy_domain or renew_domain opened, so it can no longer be paid. |
| [`list_dns_records`](https://modulify.ai/docs/api/bought-domains/list-dns-records) | `domains:read` | Lists every DNS record a bought domain holds, with the ones Modulify manages marked as locked. |
| [`create_dns_record`](https://modulify.ai/docs/api/bought-domains/create-dns-record) | `domains:write` | Adds one DNS record to a domain the workspace bought. |
| [`update_dns_record`](https://modulify.ai/docs/api/bought-domains/update-dns-record) | `domains:write` | Replaces one DNS record of a domain the workspace bought, chosen by its Id from list_dns_records. |
| [`delete_dns_record`](https://modulify.ai/docs/api/bought-domains/delete-dns-record) | `domains:write` | Deletes one DNS record of a domain the workspace bought, chosen by its Id from list_dns_records. |
| [`preview_dns_records`](https://modulify.ai/docs/api/bought-domains/preview-dns-records) | `domains:read` | Checks what a set of DNS records would do to a domain the workspace bought, without changing anything. |
| [`apply_dns_records`](https://modulify.ai/docs/api/bought-domains/apply-dns-records) | `domains:write` | Saves a set of DNS records to a domain the workspace bought in one call, replacing the records the set asks to replace. |
| [`set_domain_nameservers`](https://modulify.ai/docs/api/bought-domains/set-domain-nameservers) | `domains:write` | Points a domain the workspace bought at the nameservers of another DNS host, or back at Modulify's. |
| [`update_domain_registrant`](https://modulify.ai/docs/api/bought-domains/update-domain-registrant) | `domains:write` | Replaces the registrant of a domain the workspace bought, the person or company that legally owns it. |
| [`set_domain_transfer_lock`](https://modulify.ai/docs/api/bought-domains/set-domain-transfer-lock) | `domains:write` | Turns the transfer lock of a domain the workspace bought on or off. |
| [`set_domain_auto_renew`](https://modulify.ai/docs/api/bought-domains/set-domain-auto-renew) | `domains:buy` | Turns auto-renew of a domain the workspace bought on or off. |
| [`get_domain_transfer_code`](https://modulify.ai/docs/api/bought-domains/get-domain-transfer-code) | `credentials:reveal` | Returns the transfer code of a domain the workspace bought, which the registrar it moves to asks for. |
| [`remove_domain_from_list`](https://modulify.ai/docs/api/bought-domains/remove-domain-from-list) | `domains:write` | Clears a domain whose registration failed, or that the workspace no longer holds, from the workspace's list. |

## Secrets

These are the environment variables on the editor's **Secrets** tab. Reading a value back takes the `credentials:reveal` scope and the **Delete projects** permission. 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. |

## Agent automations

These are the site's agents: a standing instruction the agent carries out on a schedule, with its report emailed to the person who set it up. See [Agents](https://modulify.ai/docs/automations/agents).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`create_agent_automation`](https://modulify.ai/docs/api/agent-automations/create-agent-automation) | `config:write` | Creates an agent automation on a site, once the person has agreed to its preview. |
| [`update_agent_automation`](https://modulify.ai/docs/api/agent-automations/update-agent-automation) | `config:write` | Changes the name, instruction or schedule of one agent automation, once the person has agreed to the preview. |
| [`list_agent_automations`](https://modulify.ai/docs/api/agent-automations/list-agent-automations) | `config:read` | Lists the agent automations on a site, with whether each is on and how its last run went. |
| [`list_agent_automation_runs`](https://modulify.ai/docs/api/agent-automations/list-agent-automation-runs) | `config:read` | Lists recent runs of the agent automations on a site, newest first, 25 to a page. |
| [`toggle_agent_automation`](https://modulify.ai/docs/api/agent-automations/toggle-agent-automation) | `config:write` | Switches one agent automation on a site on or off. |
| [`run_agent_automation`](https://modulify.ai/docs/api/agent-automations/run-agent-automation) | `config:write` | Starts one run of an agent automation on a site, outside its schedule. |
| [`delete_agent_automation`](https://modulify.ai/docs/api/agent-automations/delete-agent-automation) | `config:write` | Permanently deletes one agent automation on a site, along with its run history. |

## 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. |

## Environment

The environment is the list of system packages and setup commands a site adds on top of the Modulify base, on a paid plan. These methods read it, change it and read its build logs. See [Environment](https://modulify.ai/docs/editor/environment).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_environment`](https://modulify.ai/docs/api/environment/get-site-environment) | `config:read` | Returns the lines of a site's environment, how its last build went and which build its machines use. |
| [`update_site_environment`](https://modulify.ai/docs/api/environment/update-site-environment) | `config:write` | Replaces every line of a site's environment and starts a build. |
| [`undo_site_environment`](https://modulify.ai/docs/api/environment/undo-site-environment) | `config:write` | Goes back to the last environment of a site that worked and starts a build of its lines. |
| [`get_site_environment_log`](https://modulify.ai/docs/api/environment/get-site-environment-log) | `config:read` | Returns the full output of one environment build. |

## Emails

These cover what the **Emails** tab does: sending, bulk emails, the history and its insights, blocked addresses, the site's email domains and forwarding. See [Emails](https://modulify.ai/docs/built-in/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 of any kind 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. |
| [`send_site_email_bulk`](https://modulify.ai/docs/api/emails/send-site-email-bulk) | `config:write` | Queues one email to many people from a site's own sending address, such as a newsletter or a campaign, each with their own copy and an unsubscribe link. |
| [`get_site_email_bulk`](https://modulify.ai/docs/api/emails/get-site-email-bulk) | `config:read` | Reads one bulk email of a site with its status, its recipient and delivery counts, what it said and a page of its recipients. |
| [`list_site_email_bulks`](https://modulify.ai/docs/api/emails/list-site-email-bulks) | `config:read` | Lists the bulk emails of a site, newest first, each with its status, subject, recipient counts and delivery counts. |
| [`cancel_site_email_bulk`](https://modulify.ai/docs/api/emails/cancel-site-email-bulk) | `config:write` | Stops a bulk email that is still going out, so whoever it has not reached yet gets nothing. |

## Messages

These cover what the **Messages** tab does: texting on or off, the countries and the sender name, the templates and their review, sending and pricing a text, the counts over a period, the history and the blocked numbers. See [Messages](https://modulify.ai/docs/built-in/messages).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_messages`](https://modulify.ai/docs/api/messages/get-site-messages) | `config:read` | Reads whether a site sends texts, the countries it may text, its sender name, prices, limits and this month's usage. |
| [`update_site_messages`](https://modulify.ai/docs/api/messages/update-site-messages) | `config:write` | Turns texting on or off for a site, or sets the countries it may text. |
| [`update_site_message_sender`](https://modulify.ai/docs/api/messages/update-site-message-sender) | `config:write` | Sets the name people see on a site's texts, where their country allows it. |
| [`quote_site_message`](https://modulify.ai/docs/api/messages/quote-site-message) | `config:read` | Works out what one text would cost before it is sent. |
| [`send_site_message`](https://modulify.ai/docs/api/messages/send-site-message) | `config:write` | Sends one text from a site to one phone number with one of its templates. |
| [`list_site_message_sends`](https://modulify.ai/docs/api/messages/list-site-message-sends) | `config:read` | Lists the texts a site sent, newest first, with their status, credits and errors. |
| [`get_site_message_send`](https://modulify.ai/docs/api/messages/get-site-message-send) | `config:read` | Reads one text in full, with every delivery update. |
| [`cancel_site_message_send`](https://modulify.ai/docs/api/messages/cancel-site-message-send) | `config:write` | Cancels a text that has not gone out yet, and its credits come back. |
| [`list_site_message_opt_outs`](https://modulify.ai/docs/api/messages/list-site-message-opt-outs) | `config:read` | Lists the numbers a site never texts, from people who replied STOP to numbers blocked by hand. |
| [`block_site_message_number`](https://modulify.ai/docs/api/messages/block-site-message-number) | `config:write` | Blocks a phone number so the site never texts it. |
| [`unblock_site_message_number`](https://modulify.ai/docs/api/messages/unblock-site-message-number) | `config:write` | Takes a number that was blocked by hand off the blocked list, so the site can text it again. |
| [`list_site_message_templates`](https://modulify.ai/docs/api/messages/list-site-message-templates) | `config:read` | Lists a site's text templates, built-in and its own, with each one's text and review state. |
| [`save_site_message_template`](https://modulify.ai/docs/api/messages/save-site-message-template) | `config:write` | Creates a text template of the site's own, or changes the text of one, and sends it for review. |
| [`submit_site_message_template`](https://modulify.ai/docs/api/messages/submit-site-message-template) | `config:write` | Sends one text template for review, a built-in one included. |
| [`delete_site_message_template`](https://modulify.ai/docs/api/messages/delete-site-message-template) | `config:write` | Deletes a text template the site added of its own, for good. |
| [`get_site_message_key`](https://modulify.ai/docs/api/messages/get-site-message-key) | `credentials:reveal` | Reveals the texting 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_message_key`](https://modulify.ai/docs/api/messages/rotate-site-message-key) | `config:write` | Replaces the texting key of a site with a new one, so the old key stops working at once and everywhere. |
| [`list_site_message_countries`](https://modulify.ai/docs/api/messages/list-site-message-countries) | `config:read` | Lists every country texts can go to, with its code, its name, what one SMS part to it costs and whether the site may text it now. |
| [`get_site_message_stats`](https://modulify.ai/docs/api/messages/get-site-message-stats) | `config:read` | Counts the texts a site sent over a period, split into delivered, in progress and failed, with the credits they took. |
| [`get_site_message_registration`](https://modulify.ai/docs/api/messages/get-site-message-registration) | `config:read` | Reads where a site's business registration for texting the United States stands, and the details the form starts from. |
| [`register_site_message_business`](https://modulify.ai/docs/api/messages/register-site-message-business) | `config:write` | Sends a site's business details to US carriers so the site can text people in the United States, on a Pro plan. |

## Payments

These read a site's **Payments** tab: whether payments are on for the site, the payment accounts of the workspace and whether a checkout from the site would be accepted now, and the payments the site took. Turning payments on or off and connecting an account are done in the tab itself. [Payments](https://modulify.ai/docs/built-in/payments) are in alpha, so on a site without them these methods are refused with `Payments are not available on this site yet!`.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_payment_status`](https://modulify.ai/docs/api/payments/get-site-payment-status) | `config:read` | Reads whether a site takes payments, its payment accounts and their status, and whether a checkout from the site would be accepted now. |
| [`list_site_payments`](https://modulify.ai/docs/api/payments/list-site-payments) | `config:read` | Lists the payments a site took, newest first, with their status, amounts, refunds and disputes. |
| [`get_site_payment_analytics`](https://modulify.ai/docs/api/payments/get-site-payment-analytics) | `config:read` | Totals the payments a site took over a period, per currency, with refunds, disputes and failed payments. |

## 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 and whether it is running. |
| [`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. |
| [`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 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. `read_storage_backup_file` returns the text of one file in a storage backup, up to a size cap.

| Tool | Scope | What it does |
| --- | --- | --- |
| [`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. |

## AI

These do what a site's **AI** tab does: read and change the switch, count and list the AI requests, and read or rotate the key. The monthly caps are set for the whole workspace with `update_workspace_spending`. Reading the key takes the `credentials:reveal` scope, and reading or rotating it the **Delete projects** permission. See [AI](https://modulify.ai/docs/built-in/ai).

| Tool | Scope | What it does |
| --- | --- | --- |
| [`get_site_ai_settings`](https://modulify.ai/docs/api/ai/get-site-ai-settings) | `config:read` | Reads whether AI is on for a site, where it stands, this month's usage, the workspace caps that limit it and the address the site calls, without the key. |
| [`get_site_ai_stats`](https://modulify.ai/docs/api/ai/get-site-ai-stats) | `config:read` | Counts the AI requests, tokens and credits of a site over a period, per hour, day or month and per model, the way the Insights tab shows them. |
| [`list_site_ai_requests`](https://modulify.ai/docs/api/ai/list-site-ai-requests) | `config:read` | Lists the AI requests a site made, newest first, 50 to a page, with each one's model, status, tokens, credits and time taken. |
| [`update_site_ai_settings`](https://modulify.ai/docs/api/ai/update-site-ai-settings) | `config:write` | Turns AI on or off for a site. Monthly caps are set for the whole workspace with update_workspace_spending. |
| [`get_site_ai_key`](https://modulify.ai/docs/api/ai/get-site-ai-key) | `credentials:reveal` | Reveals the AI key of a site in plain text, with the base URL it goes with, creating the key when the site has none yet. |
| [`rotate_site_ai_key`](https://modulify.ai/docs/api/ai/rotate-site-ai-key) | `config:write` | Replaces the AI key of a site with a new one, so the old key stops working within a minute, everywhere. |

## 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, each with a private link. |
| [`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 workspaces that started a paid subscription with your referral code, with their status and your 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. |
| [`get_share_and_earn`](https://modulify.ai/docs/api/account/get-share-and-earn) | `account:read` | Reads your Share and Earn invite code and the three figures the Share and Earn window shows. |

## 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.