Webhook map
commentscreate(comments.create)remove(comments.remove)update(comments.update)
issuescreate(issues.create)remove(issues.remove)update(issues.update)
projectscreate(projects.create)remove(projects.remove)update(projects.update)
HTTP handler setup
app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";
export async function POST(request: Request) {
const headers = Object.fromEntries(request.headers);
const body = await request.json();
const result = await processWebhook(corsair, headers, body);
return result.response;
}
Events
Comments
Create
comments.create
A comment was added to an issue
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | create | Yes | — |
type | Comment | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
}
Response data full type
Response data full type
{
action: create,
type: Comment,
data: {
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
comments: {
create: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Remove
comments.remove
A comment was deleted
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | remove | Yes | — |
type | Comment | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
}
Response data full type
Response data full type
{
action: remove,
type: Comment,
data: {
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
comments: {
remove: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Update
comments.update
A comment was updated
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | update | Yes | — |
type | Comment | Yes | — |
data | object | Yes | — |
updatedFrom | object | No | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
}
updatedFrom full type
updatedFrom full type
{
id?: string,
body?: string,
editedAt?: string,
createdAt?: string,
updatedAt?: string,
issueId?: string,
userId?: string
}
Response data full type
Response data full type
{
action: update,
type: Comment,
data: {
id: string,
body: string,
editedAt?: string,
createdAt: string,
updatedAt: string,
issueId: string,
userId: string
},
updatedFrom?: {
id?: string,
body?: string,
editedAt?: string,
createdAt?: string,
updatedAt?: string,
issueId?: string,
userId?: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
comments: {
update: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Issues
Create
issues.create
A new issue was created
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | create | Yes | — |
type | Issue | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
}
Response data full type
Response data full type
{
action: create,
type: Issue,
data: {
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
issues: {
create: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Remove
issues.remove
An issue was deleted
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | remove | Yes | — |
type | Issue | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
}
Response data full type
Response data full type
{
action: remove,
type: Issue,
data: {
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
issues: {
remove: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Update
issues.update
An issue was updated
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | update | Yes | — |
type | Issue | Yes | — |
data | object | Yes | — |
updatedFrom | object | No | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
}
updatedFrom full type
updatedFrom full type
{
id?: string,
identifier?: string,
title?: string,
description?: string,
priority?: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder?: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers?: string[],
createdAt?: string,
updatedAt?: string,
branchName?: string,
customerTicketCount?: number,
stateId?: string,
teamId?: string,
creatorId?: string
}
Response data full type
Response data full type
{
action: update,
type: Issue,
data: {
id: string,
identifier: string,
title: string,
description?: string,
priority: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers: string[],
createdAt: string,
updatedAt: string,
branchName: string,
customerTicketCount: number,
stateId: string,
teamId: string,
creatorId: string
},
updatedFrom?: {
id?: string,
identifier?: string,
title?: string,
description?: string,
priority?: 0 | 1 | 2 | 3 | 4,
estimate?: number,
sortOrder?: number,
startedAt?: string,
completedAt?: string,
canceledAt?: string,
autoArchivedAt?: string,
autoClosedAt?: string,
dueDate?: string,
trashed?: boolean,
snoozedUntilAt?: string,
previousIdentifiers?: string[],
createdAt?: string,
updatedAt?: string,
branchName?: string,
customerTicketCount?: number,
stateId?: string,
teamId?: string,
creatorId?: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
issues: {
update: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Projects
Create
projects.create
A new project was created
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | create | Yes | — |
type | Project | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
}
Response data full type
Response data full type
{
action: create,
type: Project,
data: {
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
projects: {
create: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Remove
projects.remove
A project was deleted
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | remove | Yes | — |
type | Project | Yes | — |
data | object | Yes | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
}
Response data full type
Response data full type
{
action: remove,
type: Project,
data: {
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
projects: {
remove: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Update
projects.update
A project was updated
Payload
| Name | Type | Required | Description |
|---|---|---|---|
action | update | Yes | — |
type | Project | Yes | — |
data | object | Yes | — |
updatedFrom | object | No | — |
url | string | Yes | — |
createdAt | string | Yes | — |
organizationId | string | Yes | — |
webhookId | string | Yes | — |
data full type
data full type
{
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
}
updatedFrom full type
updatedFrom full type
{
id?: string,
name?: string,
description?: string,
icon?: string,
color?: string,
priority?: 0 | 1 | 2 | 3 | 4,
sortOrder?: number,
state?: planned | started | paused | completed | canceled,
progress?: number,
url?: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory?: number[],
inProgressScopeHistory?: number[],
scope?: number,
createdAt?: string,
updatedAt?: string
}
Response data full type
Response data full type
{
action: update,
type: Project,
data: {
id: string,
name: string,
description?: string,
icon?: string,
color?: string,
priority: 0 | 1 | 2 | 3 | 4,
sortOrder: number,
state: planned | started | paused | completed | canceled,
progress: number,
url: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory: number[],
inProgressScopeHistory: number[],
scope: number,
createdAt: string,
updatedAt: string
},
updatedFrom?: {
id?: string,
name?: string,
description?: string,
icon?: string,
color?: string,
priority?: 0 | 1 | 2 | 3 | 4,
sortOrder?: number,
state?: planned | started | paused | completed | canceled,
progress?: number,
url?: string,
startDate?: string,
targetDate?: string,
completedAt?: string,
canceledAt?: string,
startedAt?: string,
completedScopeHistory?: number[],
inProgressScopeHistory?: number[],
scope?: number,
createdAt?: string,
updatedAt?: string
},
url: string,
createdAt: string,
organizationId: string,
webhookId: string
}
webhookHooks example
linear({
webhookHooks: {
projects: {
update: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})