# Create Zendesk tickets with API requests
This use case provides step-by-step instructions to build an API recipe and a custom endpoint that creates new Zendesk tickets. This allows internal teams to log support issues through CLI tools without signing in to Zendesk.
USE CASES ARE INTENDED AS EXAMPLES ONLY
Use cases are intended to serve as examples. API recipe modifications such as API trigger configuration, action configuration, and conditional logic may require adjustments for your specific setup.
# What does this API recipe do?
This API recipe enables you to create new Zendesk tickets by sending API requests to a custom Workato endpoint.
# Create your API recipe
Complete the following steps to create an API recipe that creates new Zendesk tickets:
Sign in to Workato.
Select the project where you plan to create the recipe.
Create a Zendesk connection.
# Create a Zendesk connection
The Zendesk connector supports two authentication methods:
# OAuth 2.0
Complete the following steps to establish a Zendesk connection using OAuth 2.0 authentication:
Click Create > Connection.
Search for and select Zendesk on the New connection page.
Enter a name for your connection in the Connection name field.
Connect to Zendesk with OAuth 2.0
Use the Location drop-down menu to select the project or folder to store your connection.
Enter your Zendesk subdomain in the Subdomain field. For example, if your Zendesk URL is https://acme.zendesk.com, your subdomain is acme.
Use the Authentication type drop-down menu to select OAuth 2.0.
Optional. Use the Custom OAuth profiles drop-down menu to select a custom OAuth profile for this connection.
Click Connect.
Sign in to Zendesk using your credentials to authorize Workato.
# Basic authentication
Complete the following steps to establish a Zendesk connection using Basic authentication:
Click Create > Connection.
Search for and select Zendesk on the New connection page.
Enter a name for your connection in the Connection name field.
Connect to Zendesk with Basic authentication
Use the Location drop-down menu to select the project or folder to store your connection.
Enter your Zendesk subdomain in the Subdomain field. For example, if your Zendesk URL is https://acme.zendesk.com, your subdomain is acme.
Use the Authentication type drop-down menu to select Basic.
Enter your Zendesk username in the Username field. When authenticating with API tokens, append /token to the end of your username.
Enter your password in the Password field. If you're using API token authentication, enter your API token. Refer to the Zendesk documentation for more information on generating an API token (opens new window).
Optional. Use the Custom OAuth profiles drop-down menu to select a custom OAuth profile for this connection.
Click Connect.
Select the project where you plan to create the API request recipe.
Click Create > Recipe.
Create a new recipe
Enter a name for your recipe in the Name field.
Use the Location drop-down to select the project folder where you plan to store the recipe.
Click Start building.
Start building your recipe
Click Pick a starting point, then select Trigger from an app.
Click Select an app and trigger event.
Set up your New API request trigger
# Set up your New API request trigger
This step defines the request schema that your endpoint accepts.
Search for API platform by Workato and select it.
Select the New API request trigger.
New API request trigger
Complete the following steps to configure your request schema:
Go to the Request schema section and click add fields manually.
Enter ticket in the Name and Label fields.
Use the Data type drop-down menu to select Object.
Use the Optional drop-down menu to select No.
Click Add field.
Ticket object
Return to the Request schema section and click + Add field.
Enter subject in the Name and Label fields.
Use the Data type drop-down menu to select String.
Use the Optional drop-down menu to No.
Use the Nest under drop-down to select ticket.
Click Add field.
Subject request schema
Return to the Request schema section and click + Add field.
Enter type in the Name and Label fields.
Use the Data type drop-down menu to select String.
Use the Optional drop-down menu to select No.
Use the Nest under drop-down to select ticket.
Click Add field.
Return to the Request schema section and click + Add field.
Enter priority in the Name and Label fields.
Use the Data type drop-down menu to select String.
Use the Optional drop-down menu to select No.
Use the Nest under drop-down to select ticket.
Click Add field.
Click Save.
Configured request schema
Complete the following steps to configure your request responses:
Go to the Responses section and click Add response.
Click Add response
Enter Return result in the Name field.
Use the HTTPS status code standard response drop-down menu to select 200 - OK.
Go to the Response schema section and click add fields manually.
Enter result in the Name and Label fields.
Set Data type to String and Optional to No.
Click Add field.
Configured 200 - OK response
Click + Add response again.
Enter Error output in the Name field.
Use the HTTPS status code drop-down menu to select 400 - Bad Request.
Go to the Response schema section and click add fields manually.
Enter result in the Name and Label fields.
Set Data type to String and Optional to No.
Click Add field.
Configured 400 - Bad Request response
Click Save.
Click + Add step and select Handle errors.
Click Add step > Handle errors
How does the Handle errors control statement work?
The Handle errors control statement allows you to monitor your recipe for errors in actions, similar to the try/catch concept in programming languages. You have the opportunity to perform the following actions if an error occurs:
Retry the sequence of actions again, in case it was a temporary error such as network issues.
Take remedial actions, such as notifying users of the error through email or error messages in the app, or to carry out a rollback. For example, you can reverse the job by deleting any created or half-created records.
This control statement consists of two blocks: the Monitor block and the Error block. Place the actions that you plan to monitor for errors within the Monitor block. If all actions are successful, Workato ignores the Error block. However, if any action in the Monitor block results in an error, the actions within the Error block are executed.
Set up your Zendesk create ticket action
# Set up your Zendesk create ticket action
This step adds a new ticket to Zendesk using the data from your API request.
Click + Add step.
Search for and select Zendesk.
Select Create ticket as the action.
Map the subject Step 1 datapill to the Subject field.
Map the type Step 1 datapill to the Type field.
Map the Priority Step 1 datapill to the Priority field.
Click Save.
Create ticket action
Configure your error handling
# Configure your error handling
This step configures your recipe to return appropriate API responses based on whether the Zendesk ticket creation succeeds or fails.
Complete the following steps to configure your ERROR FOUND? block:
Go to the ERROR FOUND? block and confirm that the Yes branch shows DO NOT RETRY. This option is usually set by default.
ERROR FOUND? block
Go to the Yes branch and click Select an app and action.
Search for and select API platform by Workato as the app.
Select Respond to API request as your action.
Use the Response drop-down menu to select Error output.
Expand the Response body section.
Map the Error message Step 4 datapill to the result field.
Map the Error message Step 4 datapill to the result field.
Go to the No branch and click the + Add step button.
Search for and select API platform by Workato as your app.
Select Respond to API request as your action.
Use the Response drop-down menu to select Return result.
Expand the Response body section.
Map the Ticket ID Step 3 , Subject Step 3 , Type Step 3 , and Priority Step 3 datapills to the result field.
Map the result datapills to the result field.
# Create an API collection and endpoint
This section provides steps to expose your Zendesk ticket recipe as an API endpoint.
Create an API collection
# Create an API collection
This step creates a new collection in the API platform where you can store your Zendesk ticket endpoint.
Go to Platform > API platform.
Click the API collections tab.
Click + Create new collection.
Ensure that API recipe collection is selected and click Next.
Ensure that Use existing recipes is selected.
Use the Recipe folder drop-down to select the folder where your Zendesk recipe is stored.
Deselect all endpoints.
Enter a name in the Collection name field. For example: zendesk-tickets.
Enter a version number in the Version field. For example: v1.
Optional. Add a description in the Description field.
Click Create collection.
Click Create collection
Create an endpoint
# Create an endpoint
This step connects your API recipe to a new endpoint inside the API collection.
Go to Platform > API platform and open the collection you created in the preceding steps.
Click + New endpoint.
Use the Recipe drop-down to select your Zendesk ticket API recipe.
Use the HTTP method drop-down to select POST.
Enter an endpoint name in the Endpoint name field. For example: create-zendesk-ticket.
Enter a path in the Endpoint path field. For example: create-zendesk-ticket-v1. Don’t include a slash (/) in your endpoint path. This is automatically appended after you create the endpoint.
Optional. Add a description in the Endpoint description field.
Optional. Set a request timeout if needed. Default is 30 seconds.
Click Add endpoint.
Create an endpoint
# Create tickets from the CLI
You can use a curl command to send a POST request to your endpoint and create a Zendesk ticket.
How does the curl command work?
# details How does the curl command work?
Your curl command includes:
-X POST: Sends a POST requesthttps://apim.workato.com/<your-workspace-name>/<your-endpoint-path>: The full URL to your Workato API endpoint-H "Content-Type: application/json": Indicates JSON format-H "API-Token: <your-api-token>": Authenticates the request using your API token-d '...': Contains the JSON payload
You can find your actual endpoint URL and token in Platform > API platform > API collections.
For example:
curl -X POST https://apim.workato.com/acme/create-zendesk-ticket-v1 \
-H "Content-Type: application/json" \
-H "API-Token: YOUR_API_TOKEN" \
-d '{
"ticket": {
"subject": "Cannot access account",
"type": "Incident",
"priority": "High"
}
}'
Complete the following steps to use your API endpoint to create Zendesk tickets from your CLI:
Open a terminal or CLI tool such as VS Code or iTerm.
Run your customized curl command from the example above, replacing <your-workspace-name>, <your-endpoint-path>, and <your-api-token> with your actual values.
Run the command in your CLI
Last updated: 1/19/2026, 6:34:48 PM