Analytics
The Analytics tab shows usage of your published app. Because it lives in the app editor, only people who can edit the app see it.
All figures cover the last 7 weeks, and the charts group them by week, starting on Monday. You can’t change the date range.
What counts as a page view
A page view is counted when a signed-in person loads a page of the published app: opening the app or a link to one of its pages, or reloading. Opening the app inside Duet Agents or from Slack counts too. These aren’t counted:- visits to the editor’s Preview
- data the app loads in the background while you use it
- calls made with an API token
APIs
The APIs tab lets other systems call your app’s API routes from outside Duet Agents, for example a script, a spreadsheet or another internal tool. It has three sections. APIs lists the app’s API routes by Path and Methods. Routes with a variable part in their path are marked dynamic. To learn what a route expects and returns, ask the AI:Write documentation for the /api/deals route: its parameters, its response format and an example request.Usage shows what you need to make a call:
- Base URL: your app’s published URL
- Authentication Header:
x-duet-personal-access-token - Example: a ready-made
curlcommand
Create an API token
1
Open the dialog
In API Tokens, click Create Token.
2
Name the token and set its expiration
Give it a Name (up to 32 characters) that says where it’s used. Choose an Expiration: 7 days, 30 days (the default), 90 days, 1 year or Never.
3
Choose allowed endpoints
Under Allowed Endpoints, tick each route and method the token may call. You must pick at least one. Use the search box or Select all for apps with many routes.
4
Copy the token
Click Create Token, then copy the token. You won’t see it again. The button reads Copy token first until you copy it.
Call your app’s API
Send the token in thex-duet-personal-access-token header:
- One app, chosen endpoints. A token works only for this app, and only for the routes and methods you picked. You can’t change a token’s endpoints later; create a new token instead.
- API routes only. Tokens work for paths that start with
/api/, not for the app’s pages. - Calls run as you. Duet Agents treats each call as made by the person who created the token.
- Calls reach the published app. After you change an API route, publish the app before callers can use the change. If you change a route that others call, they need to update how they call it.
- Tokens stop working when they expire, when you delete them, if you leave the organization, or if you lose access to the app.
Common errors
A token that is wrong, expired or deleted is rejected. Check that you copied all of it. Other errors you may see:
Need an API route that doesn’t exist yet? Ask the AI:
Add an API route that returns open deals as JSON so our finance team can pull them into a spreadsheet.
Connect one app to another
One Duet Agents app can use another app’s data through that app’s API. An AI coworker that has access to both apps sets this up for you. Ask it in its chat or in Slack:Show the open tasks from our To-Do List app on the Project Tracker dashboard.The coworker posts a card titled Let Project Tracker call To-Do List, with the reason and the Allowed endpoints. Click Approve connection or Decline. In Slack, a request expires after 24 hours. When you approve:
- Duet Agents creates an API token for the other app in your name, limited to the allowed endpoints. It appears in that app’s API Tokens list, named after the first app. Anyone who uses or edits the first app can call those endpoints as you.
- The first app gets a Custom API for the other app, and the coworker builds the feature on top of it. The token never appears in the app’s code.

