Webhooks

Webhooks deliver Filestack event messages as POST requests to an endpoint of your choice. Once configured, webhook endpoints will receive messages every time a given event is fired.

Usage

You can configure webhooks in your Developer Portal.

Retry logic

For every failed web hook delivery (response code different from 200, 201, 204) Filestack will retry webhook delivery three times:

  • in 5 minutes
  • in 30 minutes
  • in 12 hours

After that webhook is marked as not delivered.

Events and Messages

The following are examples of all event payloads that your application can receive.

Upload

Event triggers anytime a file is uploaded to your application.

{
    "id": 30813791,
    "action": "fp.upload",
    "timestamp": 1521733983,
    "text": {
        "container": "filestack-uploads-persist-production",
        "url": "https://cdn.filestackcontent.com/HANDLE",
        "filename": "FILENAME",
        "client": "Computer",
        "key": "S3_KEY",
        "type": "MIMETYPE",
        "status": "Stored",
        "size": 158584
    }
}

Convert

Event is triggered upon any image or document conversion.

{
    "id": 30814778,
    "action": "fp.converse",
    "timestamp": 1521734642,
    "text": {
        "url": "/CONVERSION_TASKS/HANDLE",
        "link": {
            "url": "https://www.filestackapi.com/api/file/HANDLE",
            "handle": "HANDLE",
            "filename": "FILENAME",
            "mimetype": "MIMETYPE",
            "path": "FILESTACK_S3_PATH",
            "provider": "internal_v2",
            "size": 158584
        }
    }
}

Overwrite

Event is triggered upon any file overwrite.

{
    "id": 30815340,
    "action": "fp.overwrite",
    "timestamp": 1521735062,
    "text": {
        "mimetype": "MIMETYPE",
        "url": "https://cdn.filestackcontent.com/HANDLE",
        "isWriteable": true,
        "filename": "FILENAME",
        "client": "Computer",
        "size": 436688
    }
}

Delete

Event is triggered upon any file deletion

{
    "id": 30814508,
    "action": "fp.delete",
    "timestamp": 1521734463,
    "text": {
        "url": "https://cdn.filestackcontent.com/HANDLE"
    }
}

Workflow

Event is triggered for every workflow job execution. This example includes results of the virus detection task.

{
    "id": 61380634,
    "action": "fs.workflow",
    "timestamp": 1548214263,
    "text": {
        "workflow": "687r07d2-5f84-44a0-b20b-1c29a1deb2ab",
        "createdAt": "2019-01-23T03:30:55.400729934Z",
        "updatedAt": "2019-01-23T03:30:57.437268735Z",
        "sources": [
            "VJQTvCboRVivWJ2BpKgd"
        ],
        "results": {
            "virus_detection_1548213592150": {
                "data": {
                    "infected": false,
                    "infections_list": []
                }
            }
        },
        "status": "Finished"
    }
}

Video Conversion

Event is triggered when an audio or video conversion is finished.

{
   "status":"completed",
   "message":"Done",
   "data":{
      "thumb":"https://cdn.filestackcontent.com/f1e8V88QDuxzOvtOAq1W",
      "thumb100x100":"https://process.filestackapi.com/AhTgLagciQByzXpFGRI0Az/resize=w:100,h:100,f:crop/output=f:jpg,q:66/https://cdn.filestackcontent.com/f1e8V88QDuxzOvtOAq1W",
      "thumb200x200":"https://process.filestackapi.com/AhTgLagciQByzXpFGRI0Az/resize=w:200,h:200,f:crop/output=f:jpg,q:66/https://cdn.filestackcontent.com/f1e8V88QDuxzOvtOAq1W",
      "thumb300x300":"https://process.filestackapi.com/AhTgLagciQByzXpFGRI0Az/resize=w:300,h:300,f:crop/output=f:jpg,q:66/https://cdn.filestackcontent.com/f1e8V88QDuxzOvtOAq1W",
      "url":"https://cdn.filestackcontent.com/VgvFVdvvTkml0WXPIoGn"
   },
   "metadata":{
      "result":{
         "audio_channels":2,
         "audio_codec":"vorbis",
         "audio_sample_rate":44100,
         "created_at":"2015/12/21 20:45:19 +0000",
         "duration":10587,
         "encoding_progress":100,
         "encoding_time":8,
         "extname":".webm",
         "file_size":293459,
         "fps":24,
         "height":260,
         "mime_type":"video/webm",
         "started_encoding_at":"2015/12/21 20:45:22 +0000",
         "updated_at":"2015/12/21 20:45:32 +0000",
         "video_bitrate":221,
         "video_codec":"vp8",
         "width":300
      },
      "source":{
         "audio_bitrate":125,
         "audio_channels":2,
         "audio_codec":"aac",
         "audio_sample_rate":44100,
         "created_at":"2015/12/21 20:45:19 +0000",
         "duration":10564,
         "extname":".mp4",
         "file_size":875797,
         "fps":24,
         "height":360,
         "mime_type":"video/mp4",
         "updated_at":"2015/12/21 20:45:32 +0000",
         "video_bitrate":196,
         "video_codec":"h264",
         "width":480
      }
   },
   "timestamp":"1453850583",
   "uuid":"638311d89d2bc849563a674a45809b7c"
}