Get your API key
All integrations Project Mgmt

Linear + MailKite

Linear is a modern issue tracker. Use MailKite to turn inbound email into Linear issues — customer support requests, bug reports, and feature requests land directly in your backlog.

What you need

How it works

MailKite POSTs inbound email to a webhook handler that creates a Linear issue via the GraphQL API. The email subject becomes the issue title, and the body becomes the description — formatted with the sender's address for context.

Set up the webhook

Deploy this handler as a serverless function or Cloudflare Worker. It receives inbound email and creates a Linear issue using the GraphQL API. Set LINEAR_API_KEY and LINEAR_TEAM_ID as environment variables.

linear-webhook.js
// Linear inbound email → issue handler
// Deploy this as a serverless function or worker

const LINEAR_API = 'https://api.linear.app/graphql';

async function handleInbound(email) {
const mutation = `mutation IssueCreate($input: IssueCreateInput!) {
issueCreate(input: $input) { success issue { id identifier url } }
}`;

const res = await fetch(LINEAR_API, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': process.env.LINEAR_API_KEY,
},
body: JSON.stringify({
query: mutation,
variables: {
input: {
title: email.subject || `Email from ${email.from}`,
description: `**From:** ${email.from}\n\n${email.text}`,
teamId: process.env.LINEAR_TEAM_ID,
},
},
}),
});
return res.json();
}

Receive inbound email

Configure your MailKite domain's webhook URL to point at your handler. Every inbound email delivers this payload:

  • from — sender address
  • to — recipient address
  • subject — email subject
  • text — plain text body
  • html — HTML body
  • attachments — array of file objects

Test it

test
curl -X POST https://your-worker.example.com/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"customer@example.com","to":"support@yourdomain.com","subject":"Bug: Login fails","text":"When I try to login, I get a 500 error."}'

Troubleshooting

  • Linear API keys are per-workspace; ensure the team ID matches your target team.
  • Use Linear's Sandbox for testing — create issues without affecting your real backlog.
  • Check that the API key has issues:write scope in Linear Settings → API.

See the SMTP relay docs for connection details, or Inbound webhooks for the full payload.