My Apps

    Update Webhook

    Update Webhook

    To update a webhook you will need to provide the API with the ID of the webhook to change, and the new target file or folder, as well as an optional new address to send webhooks to.

    cURL
    curl -X PUT https://api.box.com/2.0/webhooks/3321123 \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d '{
           "triggers": [
             "FILE.DOWNLOADED"
           ]
         }'
    .NET
    var updates = new BoxWebhookRequest()
    {
        Id = "12345",
        Address = "https://example.com/webhooks/fileActions
    };
    BoxWebhook updatedWebhook = await client.WebhooksManager.UpdateWebhookAsync(updates);
    Java
    BoxWebHook webhook = new BoxWebHook(api, id);
    BoxWebHook.Info info = webhook.getInfo();
    info.addPendingChange("address", url);
    webhook.update(info);
    Python
    update_object = {
        'triggers': ['FILE.COPIED'],
        'address': 'https://newexample.com',
    }
    webhook = client.webhook(webhook_id='12345').update_info(update_object)
    print('Updated the webhook info for triggers: {0} and address: {1}'.format(webhook.triggers, webhook.address))
    Node
    client.webhooks.update('678901', {address: "https://example.com/webhooks/fileActions"})
    	.then(webhook => {
    		/* webhook -> {
    			id: '1234',
    			type: 'webhook',
    			target: { id: '22222', type: 'folder' },
    			created_by: 
    			{ type: 'user',
    				id: '33333',
    				name: 'Example User',
    				login: 'user@example.com' },
    			created_at: '2016-05-09T17:41:27-07:00',
    			address: 'https://example.com/webhooks/fileActions',
    			triggers: [ 'FILE.DOWNLOADED', 'FILE.UPLOADED' ] }
    		*/
    	});

    Webhook ID

    To find the ID of the webhook, use the List all webhooks endpoint.