Skip to main content
The Asana 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

  • challenge
    • challenge (challenge.challenge)
  • tasks
    • taskEvent (tasks.taskEvent)

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

Challenge

Challenge

challenge.challenge Asana initial webhook verification handshake via X-Hook-Secret header Payload: empty object
{
  hookSecret: string
}
webhookHooks example
asana({
    webhookHooks: {
        challenge: {
            challenge: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})

Tasks

Task Event

tasks.taskEvent A task event occurred — task was added, changed, or removed Payload
NameTypeRequiredDescription
eventsobject[]Yes
{
  action: string,
  created_at?: string,
  resource?: {
    gid: string,
    resource_type: task,
    resource_subtype?: string,
    name?: string
  },
  parent?: {
    gid: string,
    resource_type?: string,
    resource_subtype?: string,
    name?: string
  } | null,
  user?: {
    gid: string,
    resource_type?: string,
    name?: string
  } | null,
  change?: {
    field?: string,
    action?: string,
    new_value?: any,
    added_value?: any,
    removed_value?: any
  }
}[]
{
  action: string,
  created_at?: string,
  resource?: {
    gid: string,
    resource_type?: string,
    resource_subtype?: string,
    name?: string
  },
  parent?: {
    gid: string,
    resource_type?: string,
    resource_subtype?: string,
    name?: string
  } | null,
  user?: {
    gid: string,
    resource_type?: string,
    name?: string
  } | null,
  change?: {
    field?: string,
    action?: string,
    new_value?: any,
    added_value?: any,
    removed_value?: any
  }
}
webhookHooks example
asana({
    webhookHooks: {
        tasks: {
            taskEvent: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})