# Let AI agents create and read your app links

> Assistants create app links, preview them with dry runs, retry safely with idempotency keys, and read clicks and installs over MCP or REST.

Page: https://warplink.app/use-cases/links-for-ai-agents

An assistant can create a link for a user, share it, and read how it performed, through 47 MCP tools or the REST API. Dry runs preview a change, idempotency keys make retries safe, and error responses carry a fix and a docs link. The links open your app and count clicks and installs like any other.

## How it works

1. **Connect the assistant.** Point an MCP client at https://api.warplink.app/mcp and sign in once in the browser, or pass an API key for non-interactive use. Claude Code and other MCP clients connect the same way.
2. **Give the assistant an app.** Links belong to an app. The assistant calls list_apps to find one, or create_app when the organization has none yet.
3. **Preview with a dry run.** create_link with dry_run set to true returns the result without saving it, so the person can approve the link before it exists.
4. **Create the link safely.** Send an idempotency_key with create_link. The key is kept for 24 hours, so a retry after a dropped connection does not create a duplicate.
5. **Mark the source.** Set utm_source to the assistant, for example assistant, and add a tag such as agent. Clicks from agent-made links are then easy to separate in analytics.
6. **Read the results.** get_link_analytics and query_analytics return clicks and installs. An AI assistant breakdown shows the clicks that arrive from assistants, matched by referrer host first and utm_source second.

## Create, then read

### MCP tool call

```json
{
  "tool": "create_link",
  "input": {
    "app_id": "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    "slug": "ana-trip-to-lisbon",
    "destination_url": "https://app.example/trips/lisbon",
    "utm_source": "assistant",
    "tags": ["agent"],
    "idempotency_key": "trip-lisbon-ana-01",
    "dry_run": true
  }
}
```

### MCP tool call

```json
{
  "tool": "get_link_analytics",
  "input": {
    "link_id": "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    "days": 7
  },
  "output": {
    "total_clicks": 1842,
    "unique_clicks": 1290,
    "time_series": [
      { "date": "2026-09-15", "total": 240, "unique": 178 },
      { "date": "2026-09-16", "total": 265, "unique": 191 }
    ],
    "sources": [
      { "source": "app_open", "total": 322, "unique": 210 },
      { "source": "redirect", "total": 1520, "unique": 1080 }
    ]
  }
}
```

### REST API (TypeScript)

```typescript
// One link per channel. The UTM fields are added to the destination on redirect.
const response = await fetch("https://api.warplink.app/v1/links", {
  method: "POST",
  headers: {
    // API key from Keys > API
    Authorization: "Bearer wl_live_YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    app_id: "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    slug: "spring-newsletter",
    destination_url: "https://app.example/spring",
    utm_source: "newsletter",
    utm_medium: "email",
    utm_campaign: "spring",
    tags: ["spring"],
  }),
});

const link = (await response.json()) as { short_url: string };
```

## What you get

- **Linking.** Links an agent creates open your app through Universal Links and App Links, with the same iOS, Android and web routing, UTM fields and previews as links made by hand.
- **Attribution.** Installs that follow a tap on an agent-made link, in any channel, are matched back to that link like any other install.
- **Analytics.** Link analytics are available to the assistant over MCP and REST, including an AI assistant breakdown for clicks that arrive from assistants.

## Questions

### How many MCP tools does WarpLink have?

47 MCP tools cover links, apps, domains, keys, analytics and organization details. The list on this site is generated from the same catalog the server registers.

### Which assistants can connect?

Any MCP client. Most connect with the server URL and a one-time browser sign-in, and an API key works for non-interactive use.

### Can an agent sign up on its own?

Yes. Post an agent_name and an email to /v1/agent/signup. We create a Free workspace, email the person a claim link and return an access token for the MCP server. Until the person claims it, the workspace holds one app and ten links, and links stay paused.

### How do I stop an assistant from creating duplicates?

Send an idempotency_key on create_link or create_app. The key is kept for 24 hours, so a retried call does not make a second link.

### Can I preview a link before it is created?

Yes. Set dry_run to true on create_link, create_app or update_link. The response returns the result with dry_run set to true and saves nothing.

### Is this the same as agent-assisted SDK setup?

No. SDK setup is an assistant adding WarpLink to your app's code. This page covers assistants that create, share and read links for the people they work with.

## Related

- [AI agents overview](https://warplink.app/ai)
- [AI agents guide](https://warplink.app/docs/ai-agents)
- [AI access reference](https://warplink.app/docs/ai-access)
- [Agent sign-up API](https://warplink.app/docs/api/agent-signup)
- [Designing an API for agents](https://warplink.app/blog/agent-ready-api-design)
- [Tracking AI assistant clicks](https://warplink.app/blog/track-ai-assistant-clicks-on-app-links)
