Connect AFI Backup
Afi is a SaaS backup platform for Microsoft 365, Google Workspace, Salesforce, Microsoft Azure and AWS. An MSP uses it to back up each customer tenant under one Afi organization. StackJack connects an…
Written By Christopher Scaminaci
Last updated About 2 hours ago
Afi is a SaaS backup platform for Microsoft 365, Google Workspace, Salesforce, Microsoft Azure and AWS. An MSP uses it to back up each customer tenant under one Afi organization. StackJack connects an AI assistant to Afi's public API.
Connecting AFI Backup to StackJack gives your AI assistant a family of afi_ MCP tools. MCP (Model Context Protocol) tools are the standardized commands an AI assistant can call through StackJack.
With them, your AI can:
- Find what the app reaches - the organizations and tenants where your Afi app is installed, child organizations, and each tenant's usage and quotas
- Check protection - the resources of a tenant, which backup policy protects each one, and protection statistics by resource kind
- Follow backup work - read a task and count tasks by status over a period, and read the tenant's audit events
- Read licensing - the subscriptions of an organization and their usage history
- Act (on Pro plans) - protect or unprotect a resource, run a job now, schedule an archive for deletion, and create a child organization
The Afi API manages and reports on backups. It never returns backup data itself.
How StackJack authenticates to Afi
Afi uses apps. An app has a set of roles and up to two API keys. StackJack sends the key with every call; there is nothing to sign in to and no token to refresh.
Creating the app and its key
Sign in to the Afi portal and open Configuration, then the Apps tab (an organization-wide app). A tenant-level app is under Service, then Settings, then Apps.
Click Create app. Give it a name and choose its roles:
- Read configuration for every read tool.
- Write configuration to protect and unprotect resources and to run jobs.
- Manage data to delete archives.
- Billing access to read licensing.
Afi does not let you change an app's roles after it is created, so choose every role you will want now.
Install the app in your organization (or in each tenant it should reach). An organization-wide app reaches every tenant under the Afi organization where it is installed.
Edit the app and click Generate key in the Keys section. Copy the key right away: Afi stores only a hash of it and cannot show it again.
Connect it in StackJack
- Open Connectors, then AFI Backup.
- Paste the API key. The address is fixed, so there is nothing else to enter.
- Click Test connection. StackJack reads the list of the app's installations, which changes nothing.
Paste the key again whenever you save the connection, including when you only rename it.
What is worth knowing before you start
Start with the installations
afi_list_app_installations lists every organization and tenant where the app is installed. Every other tool takes one of those ids. A multi-geo Microsoft 365 or Google Workspace tenant appears as one
Afi tenant per region, with the same external id.
Paging
Lists take limit and pageToken and answer next_page_token. Pass that value back as pageToken until it comes back empty: a short page does not mean the list is complete.
Tasks and polling
Protecting a resource answers the id of the backup job it starts, and running a job answers the id of the task it spawns. Read the task with afi_get_task, and wait longer between each read
(15 seconds, then 30, 60, 2 minutes and 4 minutes): Afi says faster polling does not change the answer sooner and only spends the rate limit.
Changes that ask for approval
These tools are Pro and are marked destructive, so an agent asks for approval before it runs them:
- Create an organization - when you give an administrator email, Afi emails that person an invitation to become the organization's administrator.
- Protect a resource - Afi starts backing it up and licenses it.
- Unprotect a resource - Afi stops backing it up under that policy.
- Run a job - Afi runs the job now, outside its schedule. The job id can name any job of the tenant.
- Delete an archive - Afi schedules the archive for deletion after 7 days, during which you can cancel it in Afi. A reason of up to 128 bytes is required.
The invitation link
When an organization is created, Afi answers an invitation link that lets someone become that organization's administrator. StackJack leaves the link out of the answer unless the agent asks for it with
includeSecrets. The invitation email reaches the administrator either way.
Rate limit
Afi does not publish a rate limit. It asks callers not to poll, and says that an app that ignores its request to back off can be throttled harder or suspended. StackJack paces one connection at about one call a second and backs off when Afi answers that the limit is reached.
When Afi refuses a call
- The key is refused (401): the key was deleted from the app, or the app was removed. Generate a new key and paste it again.
- The app lacks a role (403): the app does not have the role the call needs, or it is not installed in that organization or tenant. Roles cannot be changed later: create a new app with the roles you need, install it, and paste its key.
- Something is not found (404): check the id with the list tools. A resource can be read by its external id only with the
ext$prefix, and protect and unprotect accept only Afi ids. - A value is rejected (400): the answer names it, for example a time window longer than Afi allows.
- Rate limited (429) or an outage (5xx): wait and try again.
Plans and limits
Every read is available on the Free tier. Every change is Pro. Business reaches the same tools as Pro and differs by monthly call quota.
See the generated AFI Backup tool reference for the current inventory, plan assignment, input schemas and destructive-action labels.
AFI Backup tools
afi_ · 22 tools · Free 17 · Pro 5
Organizations and tenants
Licensing
Resources and protections
Tasks and audit
Archives
Was this helpful?
More in Connector guides
Connect 3CXConnect AbleSignConnect Acronis Cyber Protect CloudConnect Action1Still need help? Ask the team