openapi: 3.1.0
info:
title: Asana Allocations Webhooks API
description: The Asana Allocations API allows users to manage and allocate resources within their Asana project management system. An allocation object represents how much of a resource (e.g. person, team) is dedicated to a specific work object (e.g. project, portfolio) over a specific period of time. The effort value can be a percentage or number of hours.
version: '1.0'
termsOfService: https://asana.com/terms
contact:
name: Asana Support
url: https://asana.com/support
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://app.asana.com/api/1.0
description: Main endpoint.
security:
- personalAccessToken: []
- oauth2: []
tags:
- name: Webhooks
description: 'Webhooks allow you to subscribe to notifications about events that occur on Asana resources (e.g., tasks, projects, stories, etc.).
For a more detailed explanation of webhooks see the [overview of webhooks](/docs/webhooks-guide).'
paths:
/webhooks:
parameters:
- $ref: '#/components/parameters/pretty'
get:
summary: Asana Get multiple webhooks
description: Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace.
tags:
- Webhooks
operationId: getWebhooks
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
- name: workspace
in: query
required: true
description: The workspace to query for webhooks in.
schema:
type: string
example: '1331'
- name: resource
in: query
description: Only return webhooks for the given resource.
schema:
type: string
example: '51648'
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
required: false
example:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- offset
- path
- resource
- resource.name
- target
- uri
schema:
type: array
items:
type: string
enum:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- offset
- path
- resource
- resource.name
- target
- uri
style: form
explode: false
responses:
200:
description: Successfully retrieved the requested webhooks.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/WebhookResponse'
next_page:
$ref: '#/components/schemas/NextPage'
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalServerError'
x-readme:
code-samples:
- language: java
install: <dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>
code: "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Webhook> result = client.webhooks.getWebhooks(resource, workspace)\n .option(\"pretty\", true)\n .execute();"
- language: node
install: npm install asana
code: "const Asana = require('asana');\n\nlet client = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi();\nlet workspace = \"1331\"; // String | The workspace to query for webhooks in.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'resource': \"51648\", \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,offset,path,resource,resource.name,target,uri\"\n};\nwebhooksApiInstance.getWebhooks(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});"
name: node-sdk-v3
- language: node
install: npm install asana@1.0.5
code: "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.getWebhooks({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });"
name: node-sdk-v1
- language: python
install: pip install asana
code: "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nworkspace = \"1331\" # str | The workspace to query for webhooks in.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. *Note: You can only pass in an offset that was returned to you via a previously paginated request.*\n 'resource': \"51648\", # str | Only return webhooks for the given resource.\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,offset,path,resource,resource.name,target,uri\", # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.\n}\n\ntry:\n # Get multiple webhooks\n api_response = webhooks_api_instance.get_webhooks(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->get_webhooks: %s\\n\" % e)"
name: python-sdk-v5
- language: python
install: pip install asana==3.2.3
code: 'import asana
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = client.webhooks.get_webhooks({''param'': ''value'', ''param'': ''value''}, opt_pretty=True)'
name: python-sdk-v3
- language: php
install: composer require asana/asana
code: '<?php
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$result = $client->webhooks->getWebhooks(array(''param'' => ''value'', ''param'' => ''value''), array(''opt_pretty'' => ''true''))'
- language: ruby
install: gem install asana
code: "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.get_webhooks(workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
post:
summary: Asana Establish a webhook
description: "Establishing a webhook is a two-part process. First, a simple HTTP POST\nrequest initiates the creation similar to creating any other resource.\n\nNext, in the middle of this request comes the confirmation handshake.\nWhen a webhook is created, we will send a test POST to the target with an\n`X-Hook-Secret` header. The target must respond with a `200 OK` or `204\nNo Content` and a matching `X-Hook-Secret` header to confirm that this\nwebhook subscription is indeed expected. We strongly recommend storing\nthis secret to be used to verify future webhook event signatures.\n\nThe POST request to create the webhook will then return with the status\nof the request. If you do not acknowledge the webhook’s confirmation\nhandshake it will fail to setup, and you will receive an error in\nresponse to your attempt to create it. This means you need to be able to\nreceive and complete the webhook *while* the POST request is in-flight\n(in other words, have a server that can handle requests asynchronously).\n\nInvalid hostnames like localhost will receive a 403 Forbidden status code.\n\n```\n# Request\ncurl -H \"Authorization: Bearer <personal_access_token>\" \\\n-X POST https://app.asana.com/api/1.0/webhooks \\\n-d \"resource=8675309\" \\\n-d \"target=https://example.com/receive-webhook/7654\"\n```\n\n```\n# Handshake sent to https://example.com/\nPOST /receive-webhook/7654\nX-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\n```\n\n```\n# Handshake response sent by example.com\nHTTP/1.1 200\nX-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\n```\n\n```\n# Response\nHTTP/1.1 201\n{\n \"data\": {\n \"gid\": \"43214\",\n \"resource\": {\n \"gid\": \"8675309\",\n \"name\": \"Bugs\"\n },\n \"target\": \"https://example.com/receive-webhook/7654\",\n \"active\": false,\n \"last_success_at\": null,\n \"last_failure_at\": null,\n \"last_failure_content\": null\n },\n \"X-Hook-Secret\": \"b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\"\n}\n```"
tags:
- Webhooks
operationId: createWebhook
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
required: false
example:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
schema:
type: array
items:
type: string
enum:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
style: form
explode: false
requestBody:
description: The webhook workspace and target.
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/WebhookRequest'
responses:
201:
description: Successfully created the requested webhook.
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/WebhookResponse'
X-Hook-Secret:
type: string
description: The secret to be used to verify future webhook event signatures.
example: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalServerError'
x-readme:
code-samples:
- language: java
install: <dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>
code: "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.createWebhook()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
- language: node
install: npm install asana
code: "const Asana = require('asana');\n\nlet client = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi();\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The webhook workspace and target.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.createWebhook(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});"
name: node-sdk-v3
- language: node
install: npm install asana@1.0.5
code: "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.createWebhook({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });"
name: node-sdk-v1
- language: python
install: pip install asana
code: "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The webhook workspace and target.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.\n}\n\ntry:\n # Establish a webhook\n api_response = webhooks_api_instance.create_webhook(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->create_webhook: %s\\n\" % e)"
name: python-sdk-v5
- language: python
install: pip install asana==3.2.3
code: 'import asana
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = client.webhooks.create_webhook({''field'': ''value'', ''field'': ''value''}, opt_pretty=True)'
name: python-sdk-v3
- language: php
install: composer require asana/asana
code: '<?php
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$result = $client->webhooks->createWebhook(array(''field'' => ''value'', ''field'' => ''value''), array(''opt_pretty'' => ''true''))'
- language: ruby
install: gem install asana
code: "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.create_webhook(field: \"value\", field: \"value\", options: {pretty: true})"
/webhooks/{webhook_gid}:
parameters:
- $ref: '#/components/parameters/webhook_path_gid'
- $ref: '#/components/parameters/pretty'
get:
summary: Asana Get a webhook
description: Returns the full record for the given webhook.
tags:
- Webhooks
operationId: getWebhook
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
required: false
example:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
schema:
type: array
items:
type: string
enum:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
style: form
explode: false
responses:
200:
description: Successfully retrieved the requested webhook.
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/WebhookResponse'
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalServerError'
x-readme:
code-samples:
- language: java
install: <dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>
code: "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.getWebhook(webhookGid)\n .option(\"pretty\", true)\n .execute();"
- language: node
install: npm install asana
code: "const Asana = require('asana');\n\nlet client = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi();\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.getWebhook(webhook_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});"
name: node-sdk-v3
- language: node
install: npm install asana@1.0.5
code: "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.getWebhook(webhookGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });"
name: node-sdk-v1
- language: python
install: pip install asana
code: "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nwebhook_gid = \"12345\" # str | Globally unique identifier for the webhook.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.\n}\n\ntry:\n # Get a webhook\n api_response = webhooks_api_instance.get_webhook(webhook_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->get_webhook: %s\\n\" % e)"
name: python-sdk-v5
- language: python
install: pip install asana==3.2.3
code: 'import asana
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = client.webhooks.get_webhook(webhook_gid, {''param'': ''value'', ''param'': ''value''}, opt_pretty=True)'
name: python-sdk-v3
- language: php
install: composer require asana/asana
code: '<?php
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$result = $client->webhooks->getWebhook($webhook_gid, array(''param'' => ''value'', ''param'' => ''value''), array(''opt_pretty'' => ''true''))'
- language: ruby
install: gem install asana
code: "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.get_webhook(webhook_gid: 'webhook_gid', param: \"value\", param: \"value\", options: {pretty: true})"
put:
summary: Asana Update a webhook
description: An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request.
tags:
- Webhooks
operationId: updateWebhook
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
required: false
example:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
schema:
type: array
items:
type: string
enum:
- active
- created_at
- delivery_retry_count
- failure_deletion_timestamp
- filters
- filters.action
- filters.fields
- filters.resource_subtype
- last_failure_at
- last_failure_content
- last_success_at
- next_attempt_after
- resource
- resource.name
- target
style: form
explode: false
requestBody:
description: The updated filters for the webhook.
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/WebhookUpdateRequest'
responses:
200:
description: Successfully updated the webhook.
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/WebhookResponse'
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalServerError'
x-readme:
code-samples:
- language: java
install: <dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>
code: "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.updateWebhook(webhookGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
- language: node
install: npm install asana
code: "const Asana = require('asana');\n\nlet client = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi();\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated filters for the webhook.\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.updateWebhook(body, webhook_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});"
name: node-sdk-v3
- language: node
install: npm install asana@1.0.5
code: "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.updateWebhook(webhookGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });"
name: node-sdk-v1
- language: python
install: pip install asana
code: "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated filters for the webhook.\nwebhook_gid = \"12345\" # str | Globally unique identifier for the webhook.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.\n}\n\ntry:\n # Update a webhook\n api_response = webhooks_api_instance.update_webhook(body, webhook_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->update_webhook: %s\\n\" % e)"
name: python-sdk-v5
- language: python
install: pip install asana==3.2.3
code: 'import asana
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = client.webhooks.update_webhook(webhook_gid, {''field'': ''value'', ''field'': ''value''}, opt_pretty=True)'
name: python-sdk-v3
- language: php
install: composer require asana/asana
code: '<?php
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$result = $client->webhooks->updateWebhook($webhook_gid, array(''field'' => ''value'', ''field'' => ''value''), array(''opt_pretty'' => ''true''))'
- language: ruby
install: gem install asana
code: "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.update_webhook(webhook_gid: 'webhook_gid', field: \"value\", field: \"value\", options: {pretty: true})"
delete:
summary: Asana Delete a webhook
description: This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued.
tags:
- Webhooks
operationId: deleteWebhook
responses:
200:
description: Successfully retrieved the requested webhook.
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/EmptyResponse'
400:
$ref: '#/components/responses/BadRequest'
401:
$ref: '#/components/responses/Unauthorized'
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/InternalServerError'
x-readme:
code-samples:
- language: java
install: <dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>
code: "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.webhooks.deleteWebhook(webhookGid)\n .option(\"pretty\", true)\n .execute();"
- language: node
install: npm install asana
code: "const Asana = require('asana');\n\nlet client = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi();\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\n\nwebhooksApiInstance.deleteWebhook(webhook_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});"
name: node-sdk-v3
# --- truncated at 32 KB (48 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/asana/refs/heads/main/openapi/asana-webhooks-api-openapi.yml