In this tutorial, you'll convert one of these webhooks into an action flow that uses Zendesk actions, which don't require credentials. Zendesk is removing API tokens as an authentication method. All API tokens stop working on April 30, 2027, including tokens used by webhooks that call back into your own Zendesk account.

What you'll need

To complete this tutorial, you'll need the following:

  • A Zendesk account on Suite Growth plans and above, or Support Team plans and above
  • Admin access, or an agent in a custom role with permission to manage webhooks and action flows
  • An existing webhook that's connected to a trigger and authenticates to the Zendesk API with an API token. See Managing webhooks.
  • Familiarity with HTTP methods and JSON request bodies

A trigger is a business rule that runs when a ticket is created or updated. A webhook connected to a trigger sends an HTTP request each time the trigger's conditions are met. An action flow is a user-defined automated workflow. Each action flow consists of an action flow trigger, which initiates the flow, and one or more actions. You create action flows in the action builder, a visual workflow builder in Admin Center. Admin Center is where admins configure a Zendesk account.

About the conversion

Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Post any issues you have in the comments section or try searching for a solution online.

This tutorial converts one example webhook. The example webhook Escalate incidents connects to a trigger. It has the following configuration:

  • Endpoint URL: https://{subdomain}.zendesk.com/api/v2/tickets/{{ticket.id}}
  • Request method: PUT
  • Request format: JSON
  • Authentication: Basic authentication, using {email_address}/token as the user name and an API token as the password

The trigger that invokes the webhook has the conditions Ticket Is Created and Type Is Incident. The trigger has a single Notify webhook action with the following payload:

{
  "ticket": {
    "priority": "urgent",
    "comment": {
      "body": "Escalated automatically: new incident.",
      "public": false
    }
  }
}

Using an API token in a webhook that calls back into your own Zendesk account is no longer supported. These webhooks stop working when Zendesk removes API tokens.

An action flow calls Zendesk actions directly instead of sending an HTTP request to a Zendesk endpoint. As a result, the webhook's request method, request format, and authentication have no equivalent in an action flow. Neither does the endpoint URL, beyond the operation it performs. What carries over is the operation, the fields in the payload, and the trigger's conditions:

  • The operation becomes the Zendesk action that matches it. A PUT request to /api/v2/tickets/{id} becomes the Edit ticket action.
  • Each field in the payload becomes an input on a step. The priority field becomes the Priority input, and comment.body and comment.public become the Add ticket comment action.
  • {{ticket.id}} becomes a ticket id variable that the action flow trigger outputs
  • The trigger's conditions become conditions on the action flow trigger

Your webhook's configuration differs, but the mapping applies to any webhook that calls a Zendesk endpoint.

Action flows attribute Zendesk actions to the system user rather than to a person. Reporting and ticket events that filter on the updating user show the system user. They no longer show the user whose email address paired with the API token.

Zendesk actions don't count toward your Zendesk API rate limits. Custom actions, which are steps you define to call any API, do count toward them, and they require explicit authentication. A custom action that calls a Zendesk endpoint must use OAuth. Use Zendesk actions whenever one exists for the operation you need.

Note: Action flows consume action credits. Your account has an allowance of action credits based on its plan. Before you convert a high-volume webhook, compare the seven-day request count you record in step 1 to your allowance.

When converting a webhook to an action flow, the order of your actions matters for process continuity. The following is the recommended process:

  1. Record the webhook and its trigger
  2. Build the action flow, then test it and activate it
  3. Verify the action flow works as expected, and then retire the webhook
Step 1: Recording the webhook and its trigger

First, record the existing webhook's configuration. You need the webhook's endpoint, method, payload, and connected trigger to reproduce its behavior in an action flow.

To record the webhook and its trigger:

  1. In Admin Center, click Apps and integrations in the sidebar, then select Webhooks > Webhooks
  2. Find the webhook in the list, click the options menu on the webhook's row, and then click Edit
  3. Record the Endpoint URL, Request method, Request format, Authentication method, and any custom headers. The key, token, or password can't be accessed after a webhook is created. Record that the webhook uses an API token, not the token value.
  4. Click Cancel to leave the webhook unchanged
  5. Click the options menu on the webhook's row, click View details, and then click the Activity tab. The activity log contains the last seven days of invocations and the number of requests in that period. Record the request count, and use the log to determine what a successful invocation contains.
  6. Click an Invocation ID to open the request and response for a single invocation, and then copy the request body
  7. In Admin Center, click Objects and rules in the sidebar, then select Business rules > Triggers, and open the trigger that notifies the webhook
  8. Record the trigger's conditions and the payload in its Notify webhook action

You now have the webhook's endpoint, method, payload, and trigger conditions. An endpoint URL that contains /api/v2/tickets/{id} on your own subdomain confirms the webhook calls back into Zendesk.

Step 2: Creating the action flow and adding its trigger

Next, create the action flow and add the action flow trigger that replaces the trigger's conditions.

To create the action flow and add its trigger:

  1. In Admin Center, click Apps and integrations in the sidebar, then select Actions > Action flows
  2. Click Create flow
  3. Click Create manually instead, at the bottom of the prompt editor. The prompt editor, where you describe an action flow for Admin Copilot to build, is an early access program. If your account isn't in the program, clicking Create flow opens the name and description fields directly.
  4. Enter a unique Name and a Description. Enter Escalate incidents (converted from webhook) as the name. Auto assist, the agent copilot feature that suggests actions to agents, uses the name and description to determine when to suggest an action flow.
  5. Click Next
  6. Click + Add trigger, select Ticket event, and then select the event that matches your trigger. For this conversion, select the ticket created event. To find a trigger quickly, click the search icon in the step sidebar and enter part of the trigger's name.
  7. Configure a condition that matches the trigger's Type Is Incident condition. For Variable, select the ticket's type. For Operator, select Is. For Value, enter incident.

Condition values are case-sensitive. Zendesk tickets use lowercase values for the type, status, and priority fields, so a value of Incident doesn't match.

You can configure conditions on ticket event, user event, and custom action flow triggers. The available variables and operators depend on the action flow trigger you select. Compare the variables in the step sidebar to the conditions you recorded in step 1.

An action flow that a ticket update event initiates often runs when a ticket is created, too. Zendesk perceives the ticket's values as changing from null or empty to an actual value. If your webhook's trigger runs on update rather than creation, account for this when you test the action flow in step 5.

The action builder displays the trigger step and its condition below the action flow's name.

Step 3: Adding the Zendesk actions that replace the payload

Next, add a step for each field the webhook's payload modifies. The example payload sets a ticket's priority and adds an internal comment, so it requires two steps.

To add the Zendesk actions that replace the payload:

  1. Below the trigger step, click the add step icon
  2. In the step sidebar, under Zendesk actions, select Edit ticket
  3. Configure the step's Inputs. For the ticket id, select the ticket id variable that the trigger outputs. This replaces the {{ticket.id}} placeholder in the webhook's endpoint URL. For Priority, select urgent.
  4. Below the Edit ticket step, click the add step icon
  5. In the step sidebar, under Zendesk actions, select Add ticket comment
  6. Configure the step's Inputs. For the ticket id, select the same ticket id variable. For the comment body, enter Escalated automatically: new incident. For the comment's visibility, select internal, which matches "public": false in the payload.
  7. Click Save

The action flow contains a trigger and two steps. New action flows are inactive until you activate them, so the action flows page lists the flow with a status of Inactive.

Step 4: Configuring error handling

Webhooks retry on their own, but only for a narrow set of responses:

  • A 409
  • A 429 or 503 that carries a retry-after header set to less than 60 seconds
  • A request that exceeds the 12-second timeout

In an action flow, you configure error handling for each step.

To configure error handling:

  1. In the action builder, select the Edit ticket step
  2. In the step sidebar, under Error handling, select Retry on error. When a non-destructive error occurs, the action flow retries the step at intervals of 15 seconds, 3 minutes, 36 minutes, and 1 hour. Retry supports the 429 and 503 response codes. Other response codes aren't retried.
  3. Select the behavior if retry fails. Select Stop flow to end the action flow when later steps depend on this step. Select Continue flow to mark the step as failed and continue the action flow. Select Follow error branch to create Success and Error branches below the step and configure each branch separately.
  4. Configure error handling for the Add ticket comment step in the same way
  5. Click Save

For this conversion, select Stop flow for the Edit ticket step and Continue flow for the Add ticket comment step. The Edit ticket step is required for the conversion, and the Add ticket comment step isn't.

Continue flow and Follow error branch make the failed step's error outputs available to later steps and conditions. The error outputs are the error message, HTTP status code, and response body. With Continue flow, both the success and error outputs are available, and the set that doesn't match the outcome is null at runtime. With Follow error branch, each branch has only its own outputs. For example, you can add a branch step that routes the action flow based on the HTTP status code.

The step sidebar displays Retry on error as selected, along with the behavior you selected for each step.

Step 5: Testing the action flow and activating it

Next, test the action flow, then activate it. A test submits real API requests for each step, so it updates whatever ticket you point it at. Use a ticket you can safely modify.

Warning: A test disregards any conditions configured on the action flow trigger. Every step runs against the ticket you supply, whether or not the ticket matches your condition.

To test and activate the action flow:

  1. In Admin Center, click Apps and integrations in the sidebar, then select Actions > Action flows
  2. Click the name of the action flow
  3. Click Test
  4. In the Test action flow sidebar, enter the id of a test incident ticket. Outputs from the action flow trigger are simulated, so provide only the variable inputs the action flow uses.
  5. Click Run test
  6. Review the result for each step. Each step has a status of Done or Failed. Expand a step to see its output. A test ends when a step fails or after every step completes.
  7. Click Done
  8. Next to the action flow, click the options menu and select Activate

The action flow is active, so it now runs whenever a ticket matches its condition. Verify that behavior with tickets you can safely modify:

  • Create an incident ticket. Verify the ticket's priority changes to urgent and the action flow adds an internal comment.
  • Create a ticket with another type, such as a question. Verify the action flow doesn't run.
  • In your condition, enter Incident as the value and create an incident ticket. Verify the action flow doesn't run, then revert the value to incident.

The action flows page lists the flow with a status of Active.

Step 6: Retiring the webhook

While both the webhook and the action flow are active, tickets that match the trigger's conditions receive duplicate updates. Use the duplicate updates to confirm the action flow performs the same updates as the webhook.

To retire the webhook:

  1. Create a test ticket that matches the trigger's conditions and verify the ticket receives duplicate updates
  2. In Admin Center, click Objects and rules in the sidebar, then select Business rules > Triggers, and open the trigger
  3. Remove the Notify webhook action, and then click Save. If the webhook notification is the trigger's only action, deactivate the trigger instead.
  4. Create another matching ticket and verify it receives one set of updates
  5. In Admin Center, click Apps and integrations in the sidebar, then select Webhooks > Webhooks
  6. Click the options menu on the webhook's row, click Deactivate, and then click Deactivate in the confirmation dialog

Deactivate the webhook instead of deleting it until you've verified the action flow. A deactivated webhook retains the configuration you converted from. Webhooks created by app requirements can be edited, but they can't be cloned or deleted.

Warning: Don't delete the API token until you've migrated every integration that uses it. A single token often serves several workflows, and a failed authentication request doesn't report which token it used.

Tickets receive one set of updates, the trigger no longer notifies a webhook, and the webhooks page lists the webhook with a status of Inactive.

Step 7: Repeat

You converted an API token webhook into an action flow. The action flow performs the same ticket updates without credentials, doesn't count toward your API rate limits, and handles errors for each step.

To find other webhooks to convert, repeat step 1 for each webhook in your account. Webhooks that create or update tickets, users, organizations, and custom objects are good candidates for conversion. A single action flow can replace several webhooks that share trigger conditions. Plan your conversions around the limits. Admins can create up to 100 action flows, and each flow can have one action flow trigger and up to 50 steps.

To learn more, see the following resources:

  • Editing and managing action flows
  • Using custom code steps in action flows
  • Migrating from API tokens to OAuth access tokens for webhooks that call a third-party system and can't use Zendesk actions
Powered by Zendesk