---
title: Message Subject
description: Fetch the parent resource that a message is about.
docs_index: /llms.txt
lastUpdated: 2026-10-27
type: guide
prerequisites:
  - /docs/handling-events
related:
  - /docs/history
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

When your bot receives a comment on a Linear issue, GitHub PR, GitLab merge request, or Notion page, `message.subject` resolves the parent resource so your handler knows what the conversation is about.

## Usage

```typescript title="lib/bot.ts" lineNumbers
bot.onNewMention(async (thread, message) => {
  const subject = await message.subject;

  if (subject) {
    await thread.post(
      `This is about: ${subject.title} (${subject.status})\n${subject.url}`
    );
  }
});
```

On Linear, GitHub, GitLab, and Notion, comment webhooks deliver the comment text but not the full parent resource, so `message.subject` fetches it from the platform API on first access and caches the result on the message instance. Chat platforms have no parent resource, so `message.subject` returns `null` there. It also returns `null` if the API call fails.

See [`MessageSubject`](/docs/api/message#messagesubject) for the full type shape.

### Platform support

| Platform | `message.subject` returns                             |
| -------- | ----------------------------------------------------- |
| Linear   | Parent issue (from comment webhooks)                  |
| GitHub   | Parent issue or PR (from comment webhooks)            |
| GitLab   | Parent merge request or issue (from comment webhooks) |
| Notion   | Parent page (from comment webhooks)                   |

All other platforms return `null`.

## User info

For user profile details, use [`bot.getUser`](/docs/api/chat#getuser):

```typescript title="lib/bot.ts" lineNumbers
bot.onNewMention(async (thread, message) => {
  const user = await bot.getUser(message.author);
  if (user) {
    await thread.post(`Hi ${user.fullName} (${user.email})`);
  }
});
```

For anything beyond `message.subject`, access the platform's typed API client via [`bot.getAdapter("github").octokit`](/docs/api/chat#getadapter) or [`bot.getAdapter("linear").linearClient`](/docs/api/chat#getadapter).

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)