Manage Applications

    Create a webhook

    Create a webhook

    To attach a webhook to an item, call the Create webhook endpoint with the type and ID of the item, a URL to send webhook notifications to, and a list of triggers that will cause the webhook to activate.

    curl -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d '{
           "target": {
             "id": "21322", 
             "type": "file"
           "address": "",
           "triggers": [
    var webhookParams = new BoxWebhookRequest()
        Target = new BoxRequestEntity()
            Type = BoxType.folder,
            Id = "22222"
        Triggers = new List<string>()
        Address = "
    BoxWebhook webhook = await client.WebhooksManager.CreateWebhookAsync(webhookParams);
    // Listen for preview events for a file
    BoxFile file = new BoxFile(api, id);
    BoxWebHook.Info webhookInfo = BoxWebHook.create(file, url, BoxWebHook.Trigger.FILE.PREVIEWED);
    file = client.file(file_id='12345')
    webhook = client.create_webhook(file, ['FILE.PREVIEWED'], '')
    print('Webhook ID is {0} and the address is {1}'.format(, webhook.address))
    // Attach a webhook that sends a notification to when
    //   file 11111 is renamed or downloaded.
    	.then(webhook => {
    		/* webhook -> {
    			id: '12345',
    			type: 'webhook',
    			target: { id: '11111', type: 'file' },
    			{ type: 'user',
    				id: '33333',
    				name: 'Example User',
    				login: '' },
    			created_at: '2016-05-09T17:41:27-07:00',
    			address: '',
    			triggers: [ 'FILE.RENAMED', 'FILE.UPLOADED' ] }

    The current types supported are file and folder.

    The notification URL must be a valid HTTPS URL that you specify when you create a webhook. Every time one of the triggers is activated, this URL will be called.

    The triggers are a list of strings that specify the events that will cause the webhook to be triggered. For example, if you want the webhook to be triggered when a user uploads a file you'd pass in the FILE.UPLOADED trigger name.

    A list of available triggers is available in the in this guide.