Automate posting media and manage social interactions.

Using the Instagram API with

You can use with any existing Node SDK or even just using fetch. Using io.runTask makes your Instagram background job resumable and appear in our dashboard.

  • Use io.runTask() and the official SDK or fetch.

  • Use our HTTP endpoint to subscribe to webhooks

  • Example code using Instagram

    Below are some working code examples of how you can use Instagram with These samples are open source and maintained by the community, you can copy and paste them into your own projects.

    import { TriggerClient, verifyRequestSignature } from "";
    // Create an HTTP endpoint to listen to Instagram webhooks
    // (This will create the endpoint URL on the `` dashboard)
    // Create a Meta developer account (if you don't have one).
    // Create an app on the Meta developer platform.
    // Copy the `App Secret` from Dashboard > App Settings > Basic.
    // Go to Dashboard > Webhooks and setup the subscriptions.
    // Provide the Webhook URL and Verification Token (random string).
    // Set the `INSTAGRAM_WEBHOOK_SIGNING_SECRET` (App Secret) and `INSTAGRAM_VERIFICATION_TOKEN` (Verification Token) in the .env file.
    const instagram = client.defineHttpEndpoint({
    id: "instagram",
    source: "",
    icon: "instagram",
    // This is only needed for certain APIs like Instagram which don't set up the webhook until you pass the test
    respondWith: {
    // Don't trigger runs if they match this filter
    skipTriggeringRuns: true,
    filter: {
    method: ["GET"],
    query: {
    "hub.mode": [{ $ignoreCaseEquals: "subscribe" }],
    // Handler for the webhook setup test
    handler: async (request, verify) => {
    const searchParams = new URL(request.url).searchParams;
    if (
    searchParams.get("hub.verify_token") !==
    ) {
    return new Response("Unauthorized", { status: 401 });
    return new Response(searchParams.get("hub.challenge") ?? "OK", {
    status: 200,
    verify: async (request) => {
    return await verifyRequestSignature({
    headerName: "x-hub-signature-256",
    secret: process.env.INSTAGRAM_WEBHOOK_SIGNING_SECRET!,
    algorithm: "sha256",
    id: "http-instagram",
    name: "HTTP Instagram",
    version: "1.0.0",
    enabled: true,
    trigger: instagram.onRequest(),
    run: async (request, io, ctx) => {
    const body = await request.json();
    await`Body`, body);