Webhooks
Linear provides webhooks which allow you to receive HTTP push notifications whenever data is created or updated. This allows you to build integrations on top of Linear. You could trigger CI builds, perform calculations on issue data, or send messages on specific conditions – you name it.
Webhooks are specific to an Organization, but you can configure webhooks to provide updates from all public teams, or a single team to satisfy the needs of each team in your organization.
Additionally, OAuth applications can configure webhook settings. Once those settings are configured, each time a new organization authorizes the given application, a webhook will be created for that organization that posts to the provided webhook URL, as described below. Please visit your application's settings to configure webhooks.
Webhook updates are currently supported for the following models:
    Issue
    Issue attachments - Documentation
    Issue comments
    Comment reaction
    Projects
    Cycles
    Issue labels

How does a Webhook work?

A Webhook push is simply a HTTP POST request, sent to the URL of your choosing. The push is automatically triggered by Linear when data updates. For an example of what data a payload contains, see The Webhook Payload.
Your webhook consumer is a simple HTTP endpoint. It must satisfy the following conditions:
    It's available in a publicly accessible HTTPS, non-localhost URL
    It will respond to the Linear Webhook push (HTTP POST request) with a HTTP 200 ("OK") response
If a delivery fails (i.e. server unavailable or responded with a non-200 HTTP status code), the push will be retried a couple of times. Here an exponential backoff delay is used: the attempt will be retried after approximately 10 minutes, then 30 minutes, and so on. If the webhook URL continues to be unresponsive the webhook might be disabled by Linear, and must be re-enabled again manually.
To make sure a Webhook POST is truly created by Linear, you can check the request to originates from one of the following IPs: 35.231.147.226 or 35.243.134.228.
For additional information on Webhooks, there are a number of good resources:

Getting started with Linear Webhooks

You will first need to create a Webhook endpoint ("consumer") to be called by the Linear Webhook agent. This can be a simple HTTP server you deploy yourself, or a URL endpoint configured by a service such as Zapier (or for testing purposes, RequestBin).
Once your consumer is ready to receive updates, you can enable it for your Linear team. Webhooks can be enabled in Linear both via the Team Settings UI.

Creating a simple Webhook consumer

You might consider using something like Netlify Functions, which provides a straightforward way of deploying simple HTTP(S) endpoints: https://www.netlify.com/blog/2018/09/13/how-to-run-express.js-apps-with-netlify-functions/.
Keeping the requirements in mind, a simple but workable Node.js/Express (v4) webhook consumer might look something like this:
1
const express = require("express");
2
const bodyParser = require("body-parser");
3
const app = express();
4
const port = 3000;
5
6
// Parse the request body
7
app.use(bodyParser.json());
8
9
// Receive HTTP POST requests
10
app.post("/my-linear-webhook", (req, res) => {
11
const payload = req.body;
12
const { action, data, type, createdAt } = payload;
13
14
// Do something neat with the data received!
15
16
// Finally, respond with a HTTP 200 to signal all good
17
res.sendStatus(200);
18
});
19
20
app.listen(port, () => console.log(`My webhook consumer listening on port ${port}!`));
Copied!

Configuring with the Settings UI

The easiest way to configure a Webhook is via API Settings. Open Settings and find "API".
Webhooks configuration in API Settings UI
Click on "New webhook", and specify the URL in which you have an endpoint ready to receive HTTP POST requests. Label is used to identify webhooks and describe their purpose.
Your newly created webhook will be listed and is ready to be used. Your defined URL of http://example.com/webhooks/linear-updates will now get notified of any updates for your chosen models.

Configuring via GraphQL API

Refer to the Linear GraphQL API documentation for information on the endpoint and authentication.
Once you've created an API token and found out the teamId that will own the Webhook (if it is not going to be for all teams on that organization), you're ready to get going.
Creating a new Webhook
To create a new Webhook via the API, you can create a new Webhook with by calling a webhookCreate mutation with the teamId (or allPublicTeams: true) and url of your webhook, and the preferred resourceTypes ([Comment, Issue, IssueLabel, Project, Cycle, Reaction]):
1
mutation {
2
webhookCreate(
3
input: {
4
url: "http://example.com/webhooks/linear-consumer"
5
teamId: "72b2a2dc-6f4f-4423-9d34-24b5bd10634a"
6
resourceTypes: ["Issue"]
7
}
8
) {
9
success
10
webhook {
11
id
12
enabled
13
}
14
}
15
}
Copied!
The server should respond with a success flag, along the id of your newly created webhook:
1
{
2
"data": {
3
"webhookCreate": {
4
"success": true,
5
"webhook": {
6
"id": "790ce3f6-ea44-473d-bbd9-f3c73dc745a9",
7
"enabled": true
8
}
9
}
10
}
11
}
Copied!
That's it! Your webhook is now ready to use and enabled by default. You can try it out e.g. by commenting on an Issue on your team, or maybe creating a new Issue.
Querying existing webhooks
Your webhooks belong to an Organization. You can either query all webhooks in your organization, or find them via their respective teams.
Querying all webhooks in your organization (the results are paginated, so you will need to include the nodes property.):
1
query {
2
webhooks {
3
nodes {
4
id
5
url
6
enabled
7
team {
8
id
9
name
10
}
11
}
12
}
13
}
Copied!
Querying webhooks via their associated teams:
1
query {
2
teams {
3
nodes {
4
webhooks {
5
nodes {
6
id
7
url
8
enabled
9
creator {
10
name
11
}
12
}
13
}
14
}
15
}
16
}
Copied!
Deleting a webhook
Deleting a webhook is done with the webhookDelete mutation, by supplying the id of the webhook in question:
1
mutation {
2
webhookDelete(
3
id: "1087f03a-180a-4c31-b7dc-03dbe761ff59"
4
) {
5
success
6
}
7
}
Copied!

The Webhook Payload

The webhook HTTP payload will include information both in its HTTP headers and its request body.
The format of the payload body reflects that of the corresponding GraphQL entity. To get a hang of the data contained in the various objects, feel free to play around with GraphQL queries against Linear's API.
The payload will be sent with the following HTTP headers:
1
Accept-Charset: utf-8
2
Content-Type: application/json; charset=utf-8
3
Linear-Delivery: 234d1a4e-b617-4388-90fe-adc3633d6b72
4
Linear-Event: Issue
5
User-Agent: Linear-Webhook
Copied!
Where the custom headers include:
Name
Description
Linear-Delivery
An UUID (v4) uniquely identifying this payload.
Linear-Event
The Entity type which triggered this event: Issue, Comment etc
The Payload body has the following structure:
Field
Description
action
The type of the action that took place: create, update or remove.
type
The type of entity that was targeted by the action.
createdAt
The date and time that the action took place.
data
The serialized value of the subject entity.
url
URL where you can open up the subject entity.
updatedFrom
For update actions, an object containing the previous values of all updated properties.
For example:
1
{
2
"action": "create",
3
"data": {
4
"id": "2174add1-f7c8-44e3-bbf3-2d60b5ea8bc9",
5
"createdAt": "2020-01-23T12:53:18.084Z",
6
"updatedAt": "2020-01-23T12:53:18.084Z",
7
"archivedAt": null,
8
"body": "Indeed, I think this is definitely an improvement over the previous version.",
9
"edited": false,
10
"issueId": "539068e2-ae88-4d09-bd75-22eb4a59612f",
11
"userId": "aacdca22-6266-4c0a-ab3c-8fa70a26765c"
12
},
13
"type": "Comment",
14
"url": "https://linear.app/issue/LIN-1778/foo-bar#comment-77217de3-fb52-4dad-bb9a-b356beb93de8",
15
"createdAt": "2020-01-23T12:53:18.084Z"
16
}
Copied!
Last modified 1mo ago