Shortcut Open Agents
Shortcut Open Agents lets you build an agent that works inside a Shortcut workspace as a member of it. This page covers everything your service needs: creating the agent, getting an OAuth token, receiving webhooks, and reporting work in agent sessions. If you have questions, contact us.
What an agent is
An agent is an application that you register in Shortcut and run on your own servers. When a workspace admin activates it, Shortcut adds the agent to the workspace as a member with its own name, @handle, and icon. People can then assign Stories and Epics to the agent and @-mention it, if you allow that.
Your service talks to Shortcut in two directions:
- Shortcut sends signed webhooks to your service. Observer webhooks report changes to the entity types you subscribe to. Interaction webhooks report that someone assigned, mentioned, or replied to the agent.
- Your service calls REST API v4 with an OAuth access token that acts as the agent’s member.
An agent can also turn on agent sessions. A session shows the agent’s work on a Story or Epic in its Activity Feed: its plan, its actions, its questions, and its result. People reply to the agent or stop it from the same feed.
Platform status
Shortcut Open Agents is in closed beta. Your workspace must be in the beta to create and activate agents. To request access, contact us. The platform may still change in backwards-incompatible ways during the beta.
You build an agent in your own workspace and activate it there. Listing an agent for other workspaces is not available yet.
Examples and client library
The Shortcut Open Agents demos are complete agents that you can run and change. They include agents that only watch for changes, agents that answer mentions, and agents that bridge sessions to other AI services. Each demo’s README lists the exact field values to enter when you create it.
The @shortcut/client package for JavaScript and TypeScript has three parts that agents use:
ShortcutV4Client, from@shortcut/client/v4, calls REST API v4.ShortcutOAuth, from@shortcut/client/v4, exchanges authorization codes and refreshes tokens.ShortcutWebhookClient, from@shortcut/client/webhooks, verifies webhook signatures and parses typed payloads.
The client has no methods for the agent session endpoints. Call them with fetch or any HTTP client, as this page shows.
Building an agent
Create an agent application
An agent application holds your agent’s identity, the permissions it asks for, and where Shortcut sends its webhooks. You need the member role or higher in the workspace. Observers can’t create agent applications.
- In the Shortcut sidebar, open Agents.
- Under Agents Built By Your Organization, click the Add an agent card. You can also go to Settings, then Developer, then Agents, and click New Agent.
- Fill in the Identity, Permissions, and Connection sections. The tables below describe each field.
- Click Create Agent.
- In the Agent Created dialog, copy the Client ID and Client Secret or click Download JSON. Shortcut does not show the client secret again.
- In the Delivery section, which appears once the agent exists, enter your Webhook URL, validate it, and choose Entity Type Subscriptions.
- Click Save Changes.
- Activate the agent.
There is no public API to create or configure an agent application. Use the Shortcut web app.
Identity fields
The Identity section sets how the agent appears to people in a workspace.
| Field | Rules |
|---|---|
| Name | Optional. At most 128 characters. Set a name. Without one, the agent appears in a workspace under its Client ID. |
| Icon URL (optional) | An http or https URL of at most 2048 characters. Shown on the Agents page and in @-mention chips. Use a 256 by 256 pixel image. Instead of a URL, you can click the icon preview and pick an emoji. The default icon is the robot face emoji. |
| Handle | The agent’s username in a workspace. It appears on the agent’s comments, in member lists, and in @-mentions. Shortcut fills it in from Name, and you can change it. It may contain lowercase letters, numbers, periods, underscores, and hyphens. No other agent application can use the same handle. |
| Short Description (optional) | At most 256 characters. |
| Description (optional) | At most 1024 characters. |
Permissions fields
The Permissions section sets what the agent may do in a workspace, and what people there may do with the agent.
OAuth Scopes are the most access the agent can request. The workspace admin who activates the agent chooses which of them to grant. See Consent screen.
| Option | Scope | Grants |
|---|---|---|
| Read | read |
Read all workspace data. |
| Write | write |
Write to all workspace data. Includes Create Stories and Create Comments. |
| Create Stories | story-write |
Create and update Stories. |
| Create Comments | comment-write |
Create and update Story comments. |
New applications start with only Read selected. An agent that writes to agent sessions needs Write.
Capabilities set what people can do with the agent. Both are off by default. An agent that only watches for changes needs neither.
- Assignable. People can set the agent as an owner of Stories and Epics. Shortcut tells your service each time this happens.
- Mentionable. People can @-mention the agent in comments and descriptions. Shortcut tells your service each time this happens.
Shortcut always tells your service when someone replies to one of the agent’s comments, whatever the capabilities.
Assignment Prompt (optional) is the opening message of a session that starts when someone assigns the agent. It is available only when Assignable is on, and it applies only to agents that use agent sessions. It holds at most 256 characters. If you leave it blank, Shortcut uses Help me improve {entity_type} {entity_ref}. You can use these placeholders:
| Placeholder | Becomes |
|---|---|
{entity_type} |
Story or Epic |
{entity_id} |
The Story or Epic ID, such as 123 |
{entity_ref} |
SC-123 for a Story, or the bare ID for an Epic |
{entity_name} |
The Story or Epic name |
Connection fields
The Connection section holds what your service needs to complete the OAuth flow.
Redirect URIs takes one URI per line. Each URI may be at most 2048 characters and must be one of these:
- an
httpsURI http://localhostorhttp://127.0.0.1, with any port- a private-use scheme, such as
myapp://callback
When you activate the agent, Shortcut sends the authorization code to the first redirect URI only. Put the URI that should receive it first.
If an application has no redirect URI, activation adds the agent to the workspace without an OAuth flow. The agent then receives webhooks but never gets an access token, so it can’t call the API.
Delivery fields
The Delivery section appears after you create the agent. Shortcut sends webhooks only to an agent that has a webhook URL.
- Webhook URL must be an
httpsURL of at most 2048 characters. Shortcut sends every kind of agent webhook to this one URL. - Validate sends a validation request to the URL. The page also validates the URL one second after you stop typing.
- Entity Type Subscriptions become available after the URL validates. Choose any of Stories, Epics, Iterations, Labels, Projects, and Teams. Your agent receives observer webhooks for changes to entities of the types you choose.
Credentials
Shortcut issues three credentials when you create an agent application:
| Credential | Use | Where to find it |
|---|---|---|
| Client ID | Identifies your application in the OAuth flow. | The Credentials section, at any time. |
| Client secret | Authenticates your service at the token endpoint. | The Agent Created dialog, once. Shortcut stores only a hash of it. |
| Webhook signing secret | Verifies that a webhook came from Shortcut. | The Credentials section. Click Reveal Webhook Secret. |
Keep the client secret and the webhook signing secret on your server. Never put them in client-side code or a public repository.
Rotate credentials
To replace the client secret, click Rotate Client Secret in the Credentials section. The old secret stops working immediately, and Shortcut shows the new secret once. Update your service right after you rotate.
To replace the webhook signing secret, click Rotate Webhook Secret. The new secret takes effect immediately, and an application has only one webhook signing secret at a time. Webhooks that Shortcut signs after the rotation fail verification on a server that still has the old secret. To keep the gap short, reveal the new secret and deploy it to your service right away.
Activate the agent in your workspace
A workspace admin activates the agent on the agent’s page, in the Activation section.
- Save the agent’s configuration.
- In the Activation section, click Activate.
- Shortcut opens the OAuth consent screen. Choose the scopes to grant, then approve.
- Shortcut redirects to your first redirect URI with an authorization code.
- Your service exchanges the code for tokens.
Activation completes when your service exchanges the code. The code expires after one minute, so exchange it as soon as your redirect URI receives it. When activation completes, the section shows “Active in this workspace”. From then on, the agent receives webhooks in the workspace and, with the matching capabilities, people can assign and mention it.
Agent identity in the workspace
Activation adds the agent to the workspace as a member with the member role. The member uses the application’s name, handle, and icon.
- The member’s ID is the
permission_idin the token response. Your agent’s own writes show this ID asactor.member_idin observer webhooks. - In REST API v4, the agent’s Member has an
agentobject withassignableandmentionableflags. Theagentobject isnullfor a person. CallGET /api/v4/whoamiwith the agent’s token to read the flags. - People can assign the agent as an owner of Stories and Epics only when Assignable is on. People can @-mention the agent only when Mentionable is on.
- The agent is never added as a follower.
The first activation fails with agent_mention_name_taken when a person or another agent in the workspace’s Organization already uses the agent’s handle. Change Handle and activate again.
Changing Name or Handle later does not change the agent’s member in a workspace where it is already active.
Deactivate the agent
A workspace admin clicks Deactivate in the Activation section to deactivate the agent. Deactivation does these things:
- Stops all webhooks to the agent in the workspace.
- Disables the agent’s member and removes it from Teams.
- Makes all of the agent’s tokens fail with
401 Unauthorized. - Keeps the application’s configuration and credentials.
Deactivation does not remove the agent as an owner of Stories or Epics. To activate the agent again, click Activate.
Manage the application
Any owner of the application, or an admin of its workspace, can view and edit it. Admins see every agent application in the workspace. Members see only the applications they own.
Only the person who created the application, or a workspace admin, can delete it. Shortcut refuses to delete an application while it is active in any workspace, so deactivate it first. Deleting an application cannot be undone.
OAuth
Your agent gets its access token through the OAuth 2.0 authorization code flow. The token acts as the agent’s own member in one workspace.
Authorization flow
Shortcut starts the flow when a workspace admin clicks Activate. The flow has four steps:
- Shortcut sends the admin’s browser to the authorize URL with your client ID, your first redirect URI, and your application’s scopes.
- The admin chooses scopes on the consent screen and approves.
- Shortcut redirects the browser to your redirect URI with
codeandstatequery parameters. - Your service posts the code to the token endpoint and receives an access token and a refresh token.
When Shortcut starts the flow, state is a random UUID that Shortcut generates. Your service did not issue it, so don’t reject the callback because you don’t recognize its state.
If the admin denies access, Shortcut redirects to your redirect URI with error=access_denied and no state.
| Endpoint | URL |
|---|---|
| Authorize | https://app.shortcut.com/auth |
| Token | https://api.app.shortcut.com/oauth-authorization-code-flow/token |
| Revoke | https://api.app.shortcut.com/oauth-authorization-code-flow/revoke |
Authorize request
Authorize URL that Activate opens
https://app.shortcut.com/auth?client_id=<client-id>&response_type=code&redirect_uri=<first-redirect-uri>&state=<uuid>&workspace2_id=<workspace-id>&scope=read%20write
The authorize URL takes these query parameters. You can also send a workspace admin to this URL yourself, with a state of your own.
| Parameter | Required | Description |
|---|---|---|
client_id |
Yes | Your application’s Client ID. |
response_type |
Yes | Always code. |
redirect_uri |
Yes | Must exactly match one of your registered redirect URIs. For localhost and 127.0.0.1, Shortcut ignores the port when it compares them. |
state |
No | Returned unchanged to your redirect URI. |
scope |
No | Space-separated scopes. Each must be one of your application’s OAuth scopes, or the flow fails with error=invalid_scope. |
workspace2_id |
No | The ID of the workspace to install into. Without it, Shortcut asks the user to pick a workspace. |
code_challenge, code_challenge_method |
No | PKCE. If you send one, send both. Only S256 is supported. |
The user must be signed in to Shortcut. Only a workspace admin can activate an agent.
Consent screen
The consent screen lists the scopes in the request. Only Read starts out selected. To grant Write, Create Stories, or Create Comments, the admin must select them. At least one scope is required.
If the admin approves without changing the selection, the agent gets a read-only token. Tell admins which scopes your agent needs before they activate it. The scope field of the token response lists the scopes the admin granted.
Exchange the code for tokens
Exchange an authorization code
curl -X POST https://api.app.shortcut.com/oauth-authorization-code-flow/token \
-d grant_type=authorization_code \
-d code="$CODE" \
-d client_id="$CLIENT_ID" \
-d client_secret="$CLIENT_SECRET" \
-d redirect_uri="$REDIRECT_URI"
Post the code to the token endpoint as form-encoded parameters. The code expires one minute after Shortcut issues it, and it works once.
| Parameter | Description |
|---|---|
grant_type |
authorization_code |
code |
The code from the redirect. |
client_id |
Your Client ID. |
client_secret |
Your client secret. |
redirect_uri |
The same redirect URI as in the authorize request. |
code_verifier |
Required if the authorize request used PKCE. |
An error returns 400 Bad Request with a body of {"error": "<code>"}. Error codes include these:
| Code | Meaning |
|---|---|
invalid_request |
A required parameter is missing. |
invalid_client |
The client ID or client secret is wrong. |
invalid_grant |
The code or refresh token is expired, already used, or unknown, or the redirect URI doesn’t match. |
unsupported_grant_type |
grant_type is not authorization_code or refresh_token. |
agent_mention_name_taken |
Someone in the Organization already uses the agent’s handle. |
refresh_conflict |
Another refresh of the same token was in progress. |
Token response
Token response
{
"access_token": "<access token>",
"token_type": "Bearer",
"expires_in": 1800,
"access_token_expires_at": "2026-11-17T15:30:00Z",
"refresh_token": "<refresh token>",
"refresh_token_expires_at": "2027-02-15T15:00:00Z",
"scope": "read write",
"permission_id": "6400f1c2-6b0e-4a4f-9a51-2b1c0d3e4f5a",
"capabilities": {
"assignable": true,
"mentionable": true
},
"workspace2_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"workspace2_slug": "acme"
}
| Field | Description |
|---|---|
access_token |
The Bearer token for REST API v4. Treat it as an opaque string. |
token_type |
Always Bearer. |
expires_in |
Seconds until the access token expires. |
access_token_expires_at |
When the access token expires. |
refresh_token |
The token to get a new access token. |
refresh_token_expires_at |
When the refresh token expires. |
scope |
The granted scopes, separated by spaces. |
permission_id |
The ID of the agent’s member in the workspace. |
capabilities |
Whether the agent is assignable and mentionable. |
workspace2_id |
The ID of the workspace the token is for. |
workspace2_slug |
The slug of that workspace. Use it in REST API v4 paths. |
The response can contain other fields. Don’t depend on fields that this table doesn’t list.
Access tokens expire after 30 minutes. Refresh tokens expire after 90 days. Each activation replaces the agent’s earlier tokens in that workspace.
Refresh the access token
Refresh an access token
curl -X POST https://api.app.shortcut.com/oauth-authorization-code-flow/token \
-d grant_type=refresh_token \
-d refresh_token="$REFRESH_TOKEN" \
-d client_id="$CLIENT_ID" \
-d client_secret="$CLIENT_SECRET"
To get a new access token, post grant_type=refresh_token with the refresh token to the token endpoint. The response has the same fields as the code exchange, except that scope is empty. Keep the scope from the code exchange.
Each refresh returns a new refresh token and starts a new 90-day lifetime. Store the new refresh token. The previous refresh token keeps working until your service makes a successful API call with the new access token, so a refresh that fails partway does not lock your agent out.
Run one refresh at a time for each token. Two refreshes of the same token at once can fail with refresh_conflict.
A refresh fails with invalid_grant when the refresh token has expired or when an admin has deactivated the agent. A workspace admin must then activate the agent again.
Revoke a token
Revoke a token
curl -X POST https://api.app.shortcut.com/oauth-authorization-code-flow/revoke \
-d token="$REFRESH_TOKEN" \
-d client_id="$CLIENT_ID" \
-d client_secret="$CLIENT_SECRET"
To revoke the agent’s tokens, post token, client_id, and client_secret to the revoke endpoint. Revoking either token deletes both the access token and the refresh token. The endpoint returns 200 OK even for an unknown token. Revoking does not deactivate the agent.
Call the REST API
Call REST API v4 as the agent
curl -H "Authorization: Bearer $ACCESS_TOKEN" \
"https://api.app.shortcut.com/api/v4/$WORKSPACE_SLUG/stories/123"
Send the access token in the Authorization header as a Bearer token. Put the workspace slug from the token response in the path, as the REST API v4 reference describes. A token works only for its own workspace.
The token acts as the agent’s member, which has the member role. Endpoints that need a workspace admin fail whatever scopes the token has. The token is also limited to the scopes the admin granted. The REST API v4 Authentication section lists what each scope allows.
| Status | Cause |
|---|---|
401 Unauthorized |
The token is missing, expired, or revoked, the slug is not the token’s workspace, or the agent is deactivated. An expired token returns {"error": "invalid_token"}. |
403 Forbidden |
The token lacks the scope the endpoint needs. The body has "tag": "token_scope_denied" and a message that names the scopes the endpoint accepts. |
When a request returns 401 with invalid_token, refresh the access token and retry the request once.
Agent webhooks
Shortcut sends every agent webhook as an HTTPS POST with a JSON body to the application’s Webhook URL. Every webhook carries the same signature headers. Agent webhooks are not the workspace Outgoing Webhooks. Each agent application has its own webhook and receives only the entity types it subscribes to, and its payloads use a v2 envelope.
Webhook kinds
| Kind | Sent when | How to recognize it |
|---|---|---|
| Validation | You validate the webhook URL. | type is validation. |
| Observer | An entity of a subscribed type changes. | Has an actions array. |
| Interaction | Someone assigns, mentions, or replies to the agent, and the agent does not use sessions. | Has a trigger object. |
| Session event | A session starts or a person prompts it, and the agent uses sessions. | type is session.created or session.prompted. |
Turning on agent sessions replaces interaction webhooks with session events. Observer webhooks don’t change.
Validate the webhook URL
Validation request body
{
"type": "validation",
"application": {
"id": "a4c1e9f0-3b2d-4e5f-8a6b-7c8d9e0f1a2b",
"name": "Triage Bot"
},
"message": "This is a validation request from Shortcut to confirm your webhook endpoint is reachable."
}
When you validate the Webhook URL, Shortcut sends a validation request to it. Any 2xx response within 5 seconds passes. Any other result fails, and the page shows the error, such as “Webhook endpoint returned 404. Expected a 2xx status.”
The validation request is signed like every other webhook, and its Shortcut-Delivery is a new random UUID each time. A passing validation unlocks the Entity Type Subscriptions options. Shortcut does not validate the URL again before later deliveries.
Observer webhooks
Shortcut sends an observer webhook to your agent after each change in the workspace that affects an entity type the agent subscribes to. The webhook lists only the actions on subscribed entity types. If a change affects none of them, Shortcut sends nothing.
The agent receives webhooks for its own writes too. To avoid acting on your own changes in a loop, skip a webhook whose actor.member_id equals the agent’s permission_id from the token response.
Observer payload
Observer webhook body
{
"id": "5f7c1a4e-2b1d-4c3e-9a8f-6d2e1b0c9a7f",
"version": "v2",
"timestamp": "2026-11-17T15:04:05.123Z",
"actor": {
"displayable_name": "Ada Lovelace",
"member_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"mention_name": "ada"
},
"workspace2": {
"id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"url_slug": "acme"
},
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"actions": [
{
"action": "update",
"id": 123,
"entity_type": "story",
"global_id": "v2:s:5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b:123",
"app_url": "https://app.shortcut.com/acme/story/123",
"uri": "https://app.shortcut.com/acme/story/123",
"changes": [
{
"attribute": "workflow_state",
"adds": [
{"entity_type": "workflow-state:slim", "id": 500000010, "name": "In Progress"}
],
"removes": [
{"entity_type": "workflow-state:slim", "id": 500000008, "name": "Ready for Development"}
]
},
{
"attribute": "estimate",
"adds": [3],
"removes": []
}
]
}
]
}
| Field | Description |
|---|---|
id |
The ID of the change that caused the webhook. |
version |
Always v2. |
timestamp |
When the change happened, in ISO 8601 with milliseconds. |
actor |
Who made the change. See below. |
workspace2 |
The workspace’s id and url_slug. |
installation_id |
The ID of the agent’s installation in this workspace. |
actions |
The actions on subscribed entity types. |
The actor object always has displayable_name, which is “Unknown” when Shortcut can’t name the actor. It has member_id and mention_name when a member made the change, automation_id when an automation made it, and webhook_id when an incoming webhook made it. A field that doesn’t apply is left out, not set to null.
Observer action fields
| Field | Description |
|---|---|
action |
create, update, or delete. |
id |
The entity’s ID. An integer for most types, and a UUID string for Teams. |
entity_type |
story, epic, iteration, label, project, or group. A group is a Team. |
global_id |
A global ID for the entity, such as v2:s:<workspace-id>:123. |
app_url |
The entity’s URL in the Shortcut web app, the same value as app_url in the REST API. Can be null. |
uri |
Deprecated. Use app_url. For Stories, Epics, Iterations, Projects, and Teams it has the same value as app_url. For Labels it is null. |
changes |
What changed. Present only on Story update actions. See Story changes. |
An Epic health update arrives as an Epic update action.
Some changes affect Stories without changing them directly, such as deleting an Epic or Iteration, or moving many Stories at once. For those, Shortcut adds a Story update action for each affected Story, up to 100 Stories. If more than 100 Stories are affected, Shortcut adds none of these actions.
Story changes
The changes field lists what a Story update action changed. It has three states:
- A non-empty list holds one entry for each attribute that changed.
- An empty list,
[], means no attribute that Shortcut tracks changed. - A missing
changesfield means the details are not available for this action. Fetch the Story to learn its current state.
Each entry has these fields:
| Field | Description |
|---|---|
attribute |
The attribute name, as in the REST API v4 Story history endpoints. |
adds |
Values the change added. |
removes |
Values the change removed. |
truncated |
true when Shortcut cut a string value to 8192 characters. Present only then. |
Values have the same form as in the REST API v4 Story history endpoints. A reference is a slim entity, such as a workflow-state:slim. The example on the right leaves out some fields of each slim entity. A plain value is a number, string, or Boolean, and a time is an ISO 8601 string. A replaced single value has the new value in adds and the old value in removes. Setting an empty attribute gives an empty removes, and clearing one gives an empty adds.
changes covers these Story attributes:
name,description,story_type,estimate,deadline,requesterworkflow_state,started,completed,archivedowners,followers,mentioned_members,teamepic,iterations,project,labels,parent_storyblocked,blocker,story_links,checklist_itemsbranches,commits
Custom field values are not included. If the actions of one change would exceed 1,000,000 bytes of JSON, Shortcut leaves out changes and the added Story actions from that webhook.
The demos’ guide to working with observer deliveries shows how to use changes, how to rebuild a diff from Story history, and how to avoid feedback loops.
Interaction webhooks
Interaction webhooks tell your agent that someone addressed it directly. Shortcut sends them only while the agent has agent sessions turned off. With sessions on, the same interactions start sessions instead.
Interaction triggers
trigger.type |
Sent when | Requires |
|---|---|---|
assigned |
Someone adds the agent as an owner of a Story or Epic. | Assignable |
mentioned |
Someone @-mentions the agent in a new Story or Epic comment, or adds a mention of it to a Story or Epic description. | Mentionable |
comment-reply |
Someone replies to a comment the agent wrote on a Story or Epic. | Nothing |
When one Story comment both mentions the agent and replies to the agent’s comment, Shortcut sends only comment-reply.
Interaction webhooks are never sent for actions by other agents. An agent can call another agent only through sessions.
Interaction payload
Interaction webhook body for a mention
{
"id": "8e2f4a6b-1c3d-4e5f-9a7b-0c1d2e3f4a5b",
"version": "v2",
"timestamp": "2026-11-17T15:04:05.456Z",
"workspace2": {
"id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"url_slug": "acme"
},
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"actor": {
"member_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"displayable_name": "Ada Lovelace",
"mention_name": "ada"
},
"trigger": {
"type": "mentioned",
"context": "comment",
"entity_type": "story",
"entity_id": "123",
"comment_id": "456",
"comment_parent_id": null
}
}
An interaction payload has the same envelope as an observer payload, with a trigger object in place of actions. Two envelope fields differ. timestamp is when Shortcut sent the webhook, not when the change happened. actor never has automation_id or webhook_id.
Every ID in trigger is a string. entity_type is story or epic. Each trigger type adds its own fields:
trigger.type |
Extra fields |
|---|---|
assigned |
None. |
mentioned |
context is comment or description. With comment, the trigger also has comment_id and comment_parent_id. comment_parent_id is the ID of the comment it replies to, or null. It is always null on Epics. |
comment-reply |
comment_id is the reply, and parent_comment_id is the agent’s comment. |
Verify webhook signatures
Every agent webhook has these headers:
| Header | Value |
|---|---|
Shortcut-Timestamp |
The Unix time in seconds when Shortcut sent this attempt. Each retry gets a new value. |
Shortcut-Delivery |
A UUID for the delivery. It stays the same across retries. |
Shortcut-Signature |
The signature, as lowercase hex. |
Content-Type |
application/json |
To verify a webhook, follow these steps:
- Build the string
{Shortcut-Timestamp}.{Shortcut-Delivery}.{raw body}. Use the raw request body exactly as received, before any JSON parsing. - Compute the HMAC-SHA256 of that string’s UTF-8 bytes. Use the UTF-8 bytes of the application’s webhook signing secret as the key.
- Encode the result as lowercase hex, and compare it with
Shortcut-Signaturein constant time. - Reject the request if
Shortcut-Timestampis more than 300 seconds from your clock, earlier or later.
Shortcut no longer sends the Payload-Signature header on agent webhooks. Reject an agent webhook that has no Shortcut-Signature.
ShortcutWebhookClient from @shortcut/client/webhooks does all of these checks and returns the parsed payload.
Verify a signature in Node.js
Verify a webhook in Node.js
import { createHmac, timingSafeEqual } from "node:crypto";
import http from "node:http";
const SECRET = process.env.SHORTCUT_WEBHOOK_SECRET;
const TOLERANCE_SECONDS = 300;
function verify(headers, rawBody) {
const timestamp = headers["shortcut-timestamp"];
const delivery = headers["shortcut-delivery"];
const signature = headers["shortcut-signature"];
if (!timestamp || !delivery || !signature) return false;
if (!/^\d{1,18}$/.test(timestamp)) return false;
const now = Math.floor(Date.now() / 1000);
if (Math.abs(now - Number(timestamp)) > TOLERANCE_SECONDS) return false;
const expected = createHmac("sha256", SECRET)
.update(`${timestamp}.${delivery}.`)
.update(rawBody)
.digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(signature);
return a.length === b.length && timingSafeEqual(a, b);
}
http.createServer((req, res) => {
const chunks = [];
req.on("data", (chunk) => chunks.push(chunk));
req.on("end", () => {
const rawBody = Buffer.concat(chunks);
if (!verify(req.headers, rawBody)) {
res.writeHead(401).end();
return;
}
res.writeHead(200).end();
const payload = JSON.parse(rawBody.toString("utf8"));
enqueue(req.headers["shortcut-delivery"], payload);
});
}).listen(3000);
The example on the right verifies each webhook before it reads the body as JSON. It answers 200 OK at once and hands the payload to a queue, as Handle a delivery recommends. enqueue stands for your own queue.
Webhook delivery
Shortcut sends webhooks only to https URLs. It does not follow redirects and does not read the response body. The URL’s host must resolve only to public IP addresses. Shortcut refuses private, loopback, link-local, shared, documentation, and multicast addresses.
Any 2xx status is a success. Every other result is a failure, including a 3xx status, a timeout, and a DNS failure.
Shortcut sends the observer webhooks for each application one at a time, in order. It does the same, separately, for interaction webhooks. A slow response delays the next webhook of that kind to the same application.
Delivery by webhook kind
| Observer | Interaction | Session event | |
|---|---|---|---|
| Time limit for the whole request | 1 second | 5 seconds | 5 seconds |
| Retries | None | None | Up to 16 attempts in about 5 hours |
| Order | One at a time per application, in order | One at a time per application, in order | One at a time per session, in order |
| Queue | Up to 100 waiting per application | Up to 100 waiting per application | Stored until delivered |
| Guarantee | At most once | At most once | At least once |
Shortcut does not retry observer or interaction webhooks. If your endpoint fails, times out, or is down, that webhook is lost. For each application, Shortcut keeps up to 100 observer webhooks and 100 interaction webhooks waiting to be sent. While a queue is full, Shortcut drops new webhooks of that kind. Webhooks still waiting when Shortcut restarts are also lost. Fetch current state from the REST API rather than relying on every webhook arriving.
Session events are stored until they are delivered. Shortcut retries a failed session event with a delay that doubles from 2 seconds up to 1 hour, for up to 16 attempts. After five failures in a row to one installation, Shortcut pauses deliveries to it for 60 seconds and then sends one event to test it. Five failures and 60 seconds are the current values and may change. A paused event does not use up its attempts. If the last attempt fails for an event of the current turn, and your agent has not posted to that turn, Shortcut ends the turn. The session moves to error with the message “Shortcut could not deliver this turn to the agent. Please try again.” Shortcut also cancels the session’s queued events.
Session events for different sessions can arrive in parallel. The current limit is two at a time for each application and for each installation, and it may change. A session’s events arrive in order. Each event waits until the one before it is delivered or fails for good. A later prompt starts a new turn, so your agent can receive a session.prompted event for a session whose session.created event never arrived.
Deactivating the agent stops all webhooks. Its open sessions close with closed_reason access_revoked the next time Shortcut delivers to them or checks them.
Handle a delivery
- Verify the signature before you trust the body.
- Respond with
200 OKbefore you do the work. The 1-second limit for observer webhooks includes connecting, so do the work after you respond, in a queue or background job. - Use
Shortcut-Deliveryto find duplicates. A session event retry has the sameShortcut-Delivery, which equals the event’sid. When Shortcut processes the same change twice, the observer or interaction webhook also has the sameShortcut-Delivery. Record each value you handle and skip repeats. - Treat each webhook as a hint. Before you act, fetch the current state of the Story or Epic from the REST API.
Agent sessions
An agent session is a conversation between people and your agent about one Story or Epic. The session appears in the entity’s Activity Feed, where people see the agent’s plan, its thoughts and actions, its questions, and its final response. People reply to the agent or stop it from the same place.
A session moves forward in turns. A person’s prompt starts a turn, and your agent answers it with activities that it posts through REST API v4. Shortcut tells your agent about each new session and each new prompt with a signed session event.
Enable session events
Enable session events
curl -X PUT \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true}' \
"https://api.app.shortcut.com/api/v4/$WORKSPACE_SLUG/agent-sessions/subscription"
Response
{
"workspace_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"enabled": true,
"enabled_at": "2026-11-17T15:00:00Z",
"enabled_after_t": 1234567
}
Sessions are off until your agent turns them on in each workspace where it is active. To turn them on, call PUT /api/v4/{workspace-slug}/agent-sessions/subscription with {"enabled": true}. Use the agent’s own token, with the write scope. The agent must have a webhook URL and a signing secret.
| Status | Cause |
|---|---|
403 |
The token is not the agent’s own token, or the workspace is not in the beta. |
422 |
The agent has no webhook URL or no signing secret. The message is “Configure a webhook URL and signing secret before enabling sessions.” |
503 |
Shortcut could not check beta access. Retry later. |
Shortcut starts sessions only for interactions that happen after you turn sessions on. It does not replay earlier ones. Calling the endpoint again while sessions are on changes nothing.
To turn sessions off, send {"enabled": false}. The agent then receives interaction webhooks again. Shortcut closes the agent’s sessions whose turn is still in progress, with closed_reason installation_unavailable. A person who prompts one of the agent’s sessions gets 422 with “Enable session events before prompting a session.”
How a session starts
While sessions are on, each of these interactions starts a new session:
- Someone assigns the agent to a Story or Epic. The agent must be Assignable.
- Someone @-mentions the agent in a Story or Epic comment or description. The agent must be Mentionable.
- Someone replies to a comment the agent wrote.
An interaction does not start a session when the agent already has 10 sessions on that Story or Epic that started in the last hour. Shortcut drops the interaction, and your agent receives no event for it.
Your agent can also start a session itself with POST /api/v4/{workspace-slug}/agent-sessions. Use the agent’s own token, and turn sessions on first. Send entity_type (story or epic), entity_id, and an idempotency_key. Without the agent’s own token, the request fails with 403 and “An agent installation token is required.” While sessions are off, it fails with 422 and “Enable session events before creating a session.” A session that your agent creates has no opening prompt, and its created_by is the agent. Shortcut still sends your agent a session.created event for it.
Opening prompt
A session that a person starts has an opening prompt, which is the first activity of turn 1:
- For a mention in a comment, or a reply, the prompt is the comment text.
- For an assignment, the prompt is the application’s Assignment Prompt, or
Help me improve {entity_type} {entity_ref}when it is blank. - For a mention in a description, the prompt is always
Help me improve {entity_type} {entity_ref}.
Shortcut fills in the placeholders before it sends the prompt. When an automation starts a session, there is no opening prompt, and created_by is the agent.
Agents calling other agents
An agent can start a session for another agent the same way a person does, by assigning, mentioning, or replying to it. During the beta, this is available on request for each workspace. To turn it on, contact us. Until it is on, an interaction by an agent starts no session. Only agents with sessions turned on receive these sessions. In a session that another agent starts, created_by and the author of the opening prompt are the calling agent’s member ID. An agent never starts a session for itself.
When a Story or Epic already has 6 sessions that started in the last hour, an interaction by an agent does not start another session there. This rule stops two agents from calling each other without end.
Session events
Shortcut sends two event types to the agent’s webhook URL:
type |
Sent when |
|---|---|
session.created |
A session starts. |
session.prompted |
A person prompts an existing session, or asks the agent to stop. |
Each event has these fields:
| Field | Description |
|---|---|
id |
The event ID. It equals the Shortcut-Delivery header and stays the same across retries. |
version |
Always v1. |
type |
session.created or session.prompted. |
workspace_id |
The workspace ID. |
installation_id |
The agent’s installation ID in the workspace. |
session |
The session as of this event, including the turn the event belongs to. |
activity |
The prompt activity. Left out of session.created when the session has no opening prompt. |
prompt_context |
Only on session.created. Context about the Story or Epic. |
Session events are signed and delivered with retries. See Webhook delivery.
Created event
session.created event
{
"id": "0b6c2f1e-8d4a-4e3b-9c5f-7a1d2e3f4b5c",
"version": "v1",
"type": "session.created",
"workspace_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"session": {
"id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
"workspace_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"agent_member_id": "6400f1c2-6b0e-4a4f-9a51-2b1c0d3e4f5a",
"created_by": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"entity_type": "story",
"entity_id": 123,
"thread_comment_id": 456,
"status": "pending",
"turn": 1,
"version": 1,
"plan": [],
"external_urls": [],
"created_at": "2026-11-17T15:04:05Z",
"updated_at": "2026-11-17T15:04:05Z",
"last_agent_activity_at": null,
"first_delivery_at": null,
"last_delivery_failed_at": null,
"last_delivery_error": null,
"acknowledged_at": null,
"stop_requested_at": null,
"closed_reason": null
},
"activity": {
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"workspace_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"session_id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
"sequence": 1,
"turn": 1,
"author_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_reply_to": null,
"content": {
"type": "prompt",
"body": "@triage-bot can you split this Story into smaller ones?"
},
"signal": null,
"signal_metadata": null,
"ephemeral": false,
"superseded": false,
"created_at": "2026-11-17T15:04:05Z"
},
"prompt_context": {
"text": "Story 123: Rebuild the billing page\n\nRequested in comment:\n@triage-bot can you split this Story into smaller ones?\n\nThe billing page needs a new layout and a new export.",
"truncated": false,
"entity_name": "Rebuild the billing page",
"comment_text": "@triage-bot can you split this Story into smaller ones?",
"trigger": {
"type": "mentioned",
"context": "comment",
"entity_type": "story",
"entity_id": "123",
"comment_id": "456",
"comment_parent_id": null
}
}
}
prompt_context gives your agent enough to start work without another request:
| Field | Description |
|---|---|
text |
The Story or Epic ID and name, the comment that started the session if any, and the description. At most 16,000 characters. |
truncated |
true when Shortcut cut text to 16,000 characters. |
entity_name |
The Story or Epic name. |
comment_text |
The comment that started the session. Present only when a comment started it. At most 32,768 characters. |
trigger |
The interaction that started the session, with the same fields as an interaction webhook trigger. Left out when your agent created the session. |
To read the context again later, call GET /api/v4/{workspace-slug}/agent-sessions/{agent-session-id}/context. It returns only the current text, truncated, and entity_name. Its text has no comment section.
Prompted event
session.prompted event, with fields left out of session and activity
{
"id": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"version": "v1",
"type": "session.prompted",
"workspace_id": "5f9a3b2c-1d4e-4f60-8a7b-9c0d1e2f3a4b",
"installation_id": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"session": {
"id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
"status": "pending",
"turn": 2,
"version": 7
},
"activity": {
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"session_id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7",
"sequence": 6,
"turn": 2,
"author_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"in_reply_to": null,
"content": {
"type": "prompt",
"body": "Also add a Story for the CSV export."
},
"signal": null,
"signal_metadata": null
}
}
A session.prompted event carries the new prompt in activity. A normal prompt starts a new turn, so session.turn goes up by one and session.status is pending. A person can prompt a session in any open status, including while your agent is still working. When that happens, stop the old work. Writes for the old turn fail with 409.
A prompt that answers a question has in_reply_to set to the question’s activity ID.
Stop requests
There is no separate stop event. When a person stops the agent, Shortcut sends a session.prompted event whose activity.signal is "stop". A stop does not start a new turn or change the status.
After a stop, Shortcut accepts only a response or an error activity for the current turn. Post one within 5 minutes. Otherwise Shortcut closes the session with status error and closed_reason stop_timed_out.
Session endpoints
Every endpoint is under https://api.app.shortcut.com/api/v4/{workspace-slug}/agent-sessions. The REST API v4 reference documents each request and response.
| Method and path | Use |
|---|---|
PUT /subscription |
Turn session events on or off. |
POST / |
Start a session on a Story or Epic. |
GET /?entity_type=story&entity_id=123 |
List sessions on a Story or Epic, newest first. An agent sees only its own sessions. |
GET /{agent-session-id} |
Get a session. |
PATCH /{agent-session-id} |
Replace the session’s plan or external links. |
GET /{agent-session-id}/activities |
List activities in order, oldest first. Use after with the last sequence you read. |
POST /{agent-session-id}/activities |
Post an activity. |
GET /{agent-session-id}/context |
Get the current text, truncated, and entity_name of the Story or Epic. |
POST /{agent-session-id}/prompts |
Prompt a session. Only people can call it. An agent’s token gets 403. |
Writes need a token with the write scope. The story-write and comment-write scopes don’t allow them. Errors return {"message": "..."} with status 403, 404, 409, 422, 429, or 503. A malformed request returns 400 with the message “The request included invalid or missing parameters.” and an errors object that names each bad field. List responses have a data array and a next_cursor that is null on the last page.
An agent can read and write only the sessions of its own installation. When someone deletes the Story or Epic, its sessions can no longer be read. If the Story or Epic no longer exists when Shortcut delivers an event, Shortcut closes the session with closed_reason access_revoked.
Session fields
| Field | Description |
|---|---|
id |
The session ID. |
workspace_id, installation_id |
The workspace and the agent’s installation in it. |
agent_member_id |
The agent’s member ID. |
created_by |
The member who started the session. |
entity_type, entity_id |
The Story or Epic. entity_type is story or epic. |
thread_comment_id |
The comment that started the session, or null. |
status |
See Session status. |
turn |
The current turn, starting at 1. |
version |
Goes up on every change, except a change to first_delivery_at, last_delivery_failed_at, or last_delivery_error. Send it with PATCH. |
plan, external_urls |
The lists your agent set with PATCH. |
last_agent_activity_at |
When your agent last posted. |
first_delivery_at, acknowledged_at |
When Shortcut first delivered the current turn’s event, and when your agent first answered it. |
last_delivery_failed_at, last_delivery_error |
The last failed delivery of the current turn. |
stop_requested_at |
When a person asked the agent to stop, or null. |
closed_reason |
Why the session closed, or null. See Closed sessions. |
created_at, updated_at |
Timestamps. |
An activity has id, session_id, workspace_id, sequence, turn, author_id, in_reply_to, content, signal, signal_metadata, ephemeral, superseded, and created_at. sequence orders the activities of a session, starting at 1.
Post activities
Post a thought
curl -X POST \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "3e4f5a6b-turn-1-thought-1",
"turn": 1,
"ephemeral": true,
"content": {
"type": "thought",
"body": "Reading the Story and the Stories linked to it."
}
}' \
"https://api.app.shortcut.com/api/v4/$WORKSPACE_SLUG/agent-sessions/$SESSION_ID/activities"
An activity is one step of your agent’s work. Post it to POST /api/v4/{workspace-slug}/agent-sessions/{agent-session-id}/activities with these fields:
| Field | Required | Description |
|---|---|---|
idempotency_key |
Yes | Your key for this activity. 1 to 256 characters. Must not start with shortcut:. |
turn |
Yes | The session’s current turn. |
content |
Yes | The activity. See Activity types. |
ephemeral |
No | true to replace this activity with the next one. Only for thought and action. |
signal |
No | select or auth. Only for elicitation. |
signal_metadata |
No | The options for select, or the URL for auth. |
The response is the stored activity, with its id and sequence.
Activity types
content.type |
Use | Fields | Sets status to |
|---|---|---|---|
thought |
Share what the agent is thinking. | body |
active |
action |
Report a step the agent took. | action, parameter, and optionally result |
active |
elicitation |
Ask the person a question. | body |
awaiting_input |
response |
Give the final answer for this turn. | body |
complete |
error |
Report that the turn failed. | body |
error |
A body holds 1 to 32,768 characters of Markdown. An action’s action holds at most 512 characters, parameter at most 8192, and result at most 32,768. A field in content other than type, body, action, parameter, and result returns 400. A field that does not belong to the activity’s type, such as action on a thought, returns 422.
prompt activities come only from people, through POST /{agent-session-id}/prompts. POST /activities refuses them with 403.
Activity content examples
{"type": "thought", "body": "The export needs its own Story."}
{"type": "action", "action": "Created Story", "parameter": "Add CSV export to the billing page", "result": "Created SC-125."}
{"type": "elicitation", "body": "Should the new Stories go in the current Iteration?"}
{"type": "response", "body": "I split this Story into SC-124 and SC-125."}
{"type": "error", "body": "I couldn't read the linked design document."}
After a response or an error, the turn is over. Shortcut refuses further activities with 409 until a person prompts the session again.
Ephemeral activities
Set ephemeral: true on a thought or action to show progress that the next step replaces. When your agent posts its next activity, Shortcut marks earlier ephemeral activities superseded. One day after a superseded activity was created, Shortcut replaces its content. A thought gets the body “Temporary activity expired”. An action gets the action “Temporary activity expired” and the parameter “Expired”, and loses its result.
Ask a question
Offer choices
{
"idempotency_key": "3e4f5a6b-turn-1-question-1",
"turn": 1,
"content": {
"type": "elicitation",
"body": "Where should the new Stories go?"
},
"signal": "select",
"signal_metadata": {
"options": [
{"label": "Current Iteration", "value": "current"},
{"label": "Backlog", "value": "backlog"}
]
}
}
Ask the person to sign in
{
"idempotency_key": "3e4f5a6b-turn-1-auth-1",
"turn": 1,
"content": {
"type": "elicitation",
"body": "Connect your GitHub account so I can open a pull request."
},
"signal": "auth",
"signal_metadata": {
"url": "https://agent.example.com/connect/github?session=3e4f5a6b"
}
}
An elicitation asks the person a question and sets the session to awaiting_input. The session waits for an answer with no time limit. The answer arrives as a session.prompted event whose activity.in_reply_to is the question’s ID.
Add a signal to give the person a control:
selectshows buttons. Send 1 to 20 options, each with alabelof at most 256 characters and a uniquevalueof at most 1024 characters. When the person clicks a button, the prompt’sbodyis that option’svalue.authshows a sign-in link. Send anhttpsurlof at most 2048 characters. Use it when the person must connect an account in your service before the agent can go on.
The person can also type an answer instead.
Update the plan and links
Replace the plan
{
"version": 7,
"plan": [
{"content": "Read the Story and its links", "status": "completed"},
{"content": "Create the export Story", "status": "in_progress"},
{"content": "Update the original Story", "status": "pending"}
],
"external_urls": [
{"label": "Pull request", "url": "https://github.com/acme/billing/pull/42"}
]
}
PATCH /api/v4/{workspace-slug}/agent-sessions/{agent-session-id} replaces the session’s plan, its external_urls, or both. Each field replaces the whole list.
versionis required and must equal the session’s currentversion. If the session has changed, or it is closed, the request fails with409and “Session has changed; reload before updating.” Get the session and try again.planholds at most 100 items. Each hascontentof at most 2048 characters and astatusofpending,in_progress,completed, orcanceled.external_urlsholds at most 20 links, each with alabelof at most 128 characters and aurl. Each URL must be unique.
Turns and idempotency keys
Every activity names the turn it belongs to. Use the turn from the latest event for the session. If a person prompts the session while your agent works, the turn goes up and Shortcut refuses writes for the old turn.
Each idempotency key is unique for your agent within one session. If you repeat a request with the same key and the same body, Shortcut returns the stored activity and does not write it again. A repeat with the same key and a different body returns 409. Generate each key before the first attempt and reuse it on every retry.
A 409 response explains why Shortcut refused the write:
| Message | Meaning |
|---|---|
| “Session is closed.” | The session closed. Stop writing to it. |
| “Activity belongs to an outdated turn.” | A person prompted the session. Switch to the new turn. |
| “A completed turn requires a new human prompt.” | The turn ended with a response or error. |
| “Stop requested; only a final response or error is accepted.” | A person asked the agent to stop. |
| “This question is no longer awaiting a reply.” | The in_reply_to question is not the latest open question. |
| “Idempotency key already used with different activity content.” | A key was reused with a different body. |
| “Idempotency key already used with different session content.” | A POST /agent-sessions key was reused for a different Story or Epic. |
Session status
The session’s status shows where the current turn stands:
status |
Meaning |
|---|---|
pending |
A turn started and the agent has not posted to it yet. |
active |
The agent posted a thought or action. |
awaiting_input |
The agent asked a question. |
complete |
The agent posted a response. |
error |
The agent posted an error, or Shortcut ended the turn. |
stale |
The agent has been silent for 30 minutes. |
A plan item’s status is completed, but a session’s status is complete.
Acknowledge each turn
Post an activity or a non-empty PATCH within 10 seconds after your endpoint first accepts a turn’s event. If you don’t, the session tells people that it is waiting for your agent to pick up the turn. While deliveries to your endpoint fail, it tells them that Shortcut could not reach your agent and is retrying.
Session timeouts
Shortcut checks open sessions every 30 seconds:
- A session that is
active, orpendingafter delivery, becomesstaleafter 30 minutes with no agent activity. - A session that stays
stalefor 24 hours becomeserror, and Shortcut adds the activity “The agent stopped responding. Please try again.” - A stop that gets no
responseorerrorwithin 5 minutes closes the session. - A session in
awaiting_inputnever times out.
Your agent can still post to a stale session, which makes it active again. Activities that Shortcut adds have idempotency keys that start with shortcut:, and their author is the agent’s member.
Closed sessions
A closed session has a closed_reason and rejects every write with 409. If it was not already complete or error, its status becomes error.
closed_reason |
Cause |
|---|---|
stop_timed_out |
The agent did not answer a stop within 5 minutes. |
installation_unavailable |
The agent turned session events off, or Shortcut had an event to deliver and the agent had no webhook URL. |
access_revoked |
The agent was deactivated in the workspace, or the Story or Epic no longer existed when Shortcut delivered an event. |
Session write limits
Shortcut limits how fast an agent writes to sessions. Each limit refills evenly over a minute.
| Limit | Writes per minute |
|---|---|
| Each installation of the agent | 600 |
| Each session | 60 |
POST /agent-sessions and PUT /subscription count toward the installation limit. Posting an activity and PATCH count toward both limits. Every well-formed request counts, including one that then fails with 403, 404, 409, or 422. A request refused for a missing scope or a malformed body does not count. A repeat of a stored activity or session with the same idempotency key and body is free, but a repeated PATCH counts. Reads don’t count, and neither do people’s prompts.
Over a limit, Shortcut returns 429 with a Retry-After header that gives the seconds to wait. Wait that long, then retry with the same idempotency key.
The demo session bridges show a complete client, including an outbox for idempotency keys, events that arrive out of order, and the write limits.
