Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt

Use this file to discover all available pages before exploring further.

The Linear plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see Overview for setup context and the exact URL shape).
New to Corsair? See webhooks and hooks.

Webhook map

  • comments
    • create (comments.create)
    • remove (comments.remove)
    • update (comments.update)
  • issues
    • create (issues.create)
    • remove (issues.remove)
    • update (issues.update)
  • projects
    • create (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
NameTypeRequiredDescription
actioncreateYes
typeCommentYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  id: string,
  body: string,
  editedAt?: string,
  createdAt: string,
  updatedAt: string,
  issueId: string,
  userId: string
}
{
  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
NameTypeRequiredDescription
actionremoveYes
typeCommentYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  id: string,
  body: string,
  editedAt?: string,
  createdAt: string,
  updatedAt: string,
  issueId: string,
  userId: string
}
{
  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
NameTypeRequiredDescription
actionupdateYes
typeCommentYes
dataobjectYes
updatedFromobjectNo
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  id: string,
  body: string,
  editedAt?: string,
  createdAt: string,
  updatedAt: string,
  issueId: string,
  userId: string
}
{
  id?: string,
  body?: string,
  editedAt?: string,
  createdAt?: string,
  updatedAt?: string,
  issueId?: string,
  userId?: string
}
{
  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
NameTypeRequiredDescription
actioncreateYes
typeIssueYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
NameTypeRequiredDescription
actionremoveYes
typeIssueYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
NameTypeRequiredDescription
actionupdateYes
typeIssueYes
dataobjectYes
updatedFromobjectNo
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
}
{
  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
NameTypeRequiredDescription
actioncreateYes
typeProjectYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
NameTypeRequiredDescription
actionremoveYes
typeProjectYes
dataobjectYes
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
NameTypeRequiredDescription
actionupdateYes
typeProjectYes
dataobjectYes
updatedFromobjectNo
urlstringYes
createdAtstringYes
organizationIdstringYes
webhookIdstringYes
{
  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
}
{
  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
}
{
  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) {
                },
            },
        },
    },
})