Category

How to Create Tickets Using BoldDesk API

Updated:

Creating tickets programmatically using the BoldDesk API provides a seamless way to integrate ticket management into your workflows. This guide covers:

  • API authentication
  • Structuring ticket creation requests
  • Handling responses
  • Managing ticket visibility
  • Common issues and FAQs
  • Ensure you have a valid API key generated from your BoldDesk account. Learn how to Generate and Manage API Keys in BoldDesk.
  • The system always displays the name of the user who created the API key, which is expected behavior; the API key label is used for internal identification and is not shown in tickets, so the displayed name cannot be changed using the label. As a workaround, you can create or use another agent account, grant it API access, and generate a new API key from that account so tickets will display that account’s name.
  • BoldDesk currently follows a one-ticket-per-customer model and does not natively support sending a single outbound campaign email to multiple recipients while automatically creating separate ticket threads from each response.
  • As an alternative, you can use the BoldDesk API to create individual tickets programmatically, which will trigger customer email notifications and maintain separate conversations for each recipient. If you need to monitor all related customer interactions under a single initiative or campaign, consider using Parent-Child Ticket Linking to associate individual customer tickets with a parent ticket while preserving independent conversations and audit trails.

Steps to Create a Ticket

When creating tickets via API, please follow the steps below:

1. Authenticate API Request

BoldDesk API uses API key-based authentication to ensure secure access. Explore BoldDesk API Authentication. Add the API key to the request header as shown below:

curl -X GET "https://{your domain}/api/v1/tickets" -H "x-api-key: {API Key}"
  • Replace {your domain} in the API request URL with your actual BoldDesk domain.
  • Replace {API Key} with your actual API key.
  • Ensure the API key has sufficient permissions to access the requested resource.

In API responses, the source field (for instance, source: 3) represents the origin of the ticket or action. Each numeric value corresponds to a specific channel or integration, such as Agent Portal, API, Email, or Chat. Understanding these source IDs helps identify where a ticket was created or updated, improving tracking, debugging, and reporting across different communication channels.

2. Structure the Ticket Creation Request

To create a ticket, send a POST request to the following endpoint:

https://{your domain}/api/v1.0/tickets

By default, the skipDependencyValidation parameter is set to ‘false’. To bypass field validation, set skipDependencyValidation to ‘true’. If you leave it as false, ensure that the mandatory fields are included in the request payload.

Example JSON payload with required fields:

{
    "brandId": 1,
    "subject": "Subject of the ticket",
    "description": "Description of the ticket",
    "priorityId": 1,
    "isVisibleInCustomerPortal": true,
    "requesterEmailId": "[email protected]"
}

You can also tailor the request by including the required fields according to your specific use case.

  • If the requester does not exist in your BoldDesk contacts, include requesterName and requesterEmailId in the API payload, and set requesterId to null. This ensures BoldDesk automatically creates the contact and continues with ticket creation. If not done: The API request will fail because the ticket cannot be linked to a valid requester.
  • BoldDesk’s API does not support adding CC users directly using their email addresses in the cc field. Instead, it requires contact IDs.
  • A 500 Internal Server Error may occur when creating tickets through the BoldDesk API due to invalid field values, missing required fields, or account-specific configuration issues. Verify that all mandatory fields are included and that values such as status, priority, category, and custom fields are valid for your BoldDesk account. If the issue persists, contact BoldDesk Support and provide the API request payload (excluding sensitive information) along with the request timestamp for further investigation.

Key Parameters:

  • brandId: The ID of the brand under which the ticket will be created.
  • subject: The title or summary of the ticket.
  • description: Detailed information about the issue or request.
  • priorityId: The priority level of the ticket (for instance, 1 for low, 2 for medium, etc.).
  • isVisibleInCustomerPortal: Boolean value indicating whether the ticket should be visible in the customer portal.
  • requesterEmailId: The email address of the requester.

3. Send the Request

Use tools like curl, Postman, or any HTTP client library to send the request. Example using curl:

curl -X POST "https://{your domain}/api/v1.0/tickets?skipDependencyValidation=true" \
-H "Content-Type: application/json" \
-H "x-api-key: {API Key}" \
-d '{
    "brandId": 1,
    "subject": "Subject of the ticket",
    "description": "Description of the ticket",
    "priorityId": 1,
    "isVisibleInCustomerPortal": true,
    "requesterEmailId": "[email protected]"
}'

4. Handle the Response

If the API key is valid and the request is correctly structured, the server will return a success response containing the ticket details. Example response:

{
    "ticketId": 12345,
    "message": "Ticket created successfully."
}

In the event of errors, review the error message and verify that all parameters are correctly provided. Additionally, you may test the BoldDesk REST API using Swagger. Learn How to Use Swagger UI to Test the BoldDesk REST API.

When creating a ticket using the v1/create-ticket/ API, a confirmation email is sent to the requester. If the ticket is created on behalf of a customer, the email notification is sent to the customer for whom the ticket was created. If the email is not received:

  • Check the Email Delivery Status in the BoldDesk portal.
  • Verify whether the email address is suspended, as suspended emails can block ticket creation or email delivery. Learn more on How to Recover Suspended Emails in BoldDesk.

Add Custom Fields to the Ticket Payload

To populate ticket custom fields when creating a ticket through the API, add the customFields object to the request payload.

Within customFields, use the custom field’s API name as the property name and provide a value that matches the field type.

For example:

{
  "brandId": 1,
  "subject": "Unable to access the customer portal",
  "description": "The requester cannot sign in to the customer portal.",
  "priorityId": 1,
  "isVisibleInCustomerPortal": true,
  "requesterEmailId": "[email protected]",
  "customFields": {
    "cf_persona": "PGM",
    "cf_query_title": "test",
    "cf_query_category": 1
  }
}

In this example:

  • cf_persona is assigned the string value PGM.
  • cf_query_title is assigned the string value test.
  • cf_query_category is assigned the numeric value 1.

To find a custom field’s API name:

  1. Go to Admin > Fields and Forms.
  2. Open the applicable ticket field.
  3. Select the required custom field.
  4. Copy the value displayed under API Name.
  5. Use the API name as the property name within customFields.
  • The custom field value must match the field’s configured data type. For example, provide text for a text field, a whole number for a numeric field, and the applicable option value ID for a dropdown field.
  • Do not use the custom field’s display label as the JSON property name. Use the exact API Name configured for the field.
  • An invalid API name, unsupported value, or value that does not match the custom field type can cause request validation to fail.

Automating Bulk Ticket Creation for Contact Groups Using Power Automate and BoldDesk API

You can automate bulk ticket creation by combining Microsoft Power Automate with the BoldDesk API. This solution enables you to monitor incoming emails, such as automated system update, backup, or monitoring notifications, and automatically create individual tickets for contacts within a selected contact group. Below is a description of how it works.

  1. Trigger the workflow when an automated system update, backup, or monitoring notification email is received.
  2. Retrieve contacts from the required contact group using the Get Contacts by Contact Group API.
  3. Loop through each contact returned by the API.
  4. Create a separate ticket for every contact using the Create Ticket API.

The BoldDesk Create Ticket API creates only one ticket per request. To generate tickets for multiple contacts, the automation must call the Create Ticket API individually for each contact in the selected contact group. This ensures that every contact receives a dedicated ticket and can be managed independently.

How to Add Tags While Creating Tickets

You can add tags while creating a ticket via API by including the tag property in the request body of the Create Ticket API.

Example:

{
  "brandId": 1,
  "subject": "Subject of the ticket",
  "description": "Description of the ticket",
  "priorityId": 1,
  "isVisibleInCustomerPortal": true,
  "requesterEmailId": "[email protected]",
  "tag": "auto-reopened"
}

This allows you to automatically assign tags during ticket creation for better organization and tracking.

How to Change the Ticket Visibility

After a ticket is created, its visibility can be modified via the API from Private to Public or vice versa. To set the ticket visibility to Public, use the developer API and provide the prompt indicated below to update the visibility programmatically.

PUT/api/v1/tickets/{ticketId}/update_fields

{
  "fields": {
      "isVisibleInCustomerPortal": true
  }
}

To switch the visibility to Private, set the “isVisibleInCustomerPortal” value to false.

  • When creating tickets via API, customers provide details like Subject and Description, while the payload can include fields such as Brand, Category, Priority, Type, and Status. These values appear only if correct field and option IDs are passed and the fields exist in the brand’s ticket form.
  • If mandatory fields show errors during ticket creation, set skipDependencyValidation=true in the API payload. This skips validation for required fields, display conditions, and dependencies only; other values remain as entered.

Handling Multi‑Line Descriptions When Creating or Updating Tickets via API

The description field in BoldDesk supports multi‑line content. To ensure line breaks are rendered correctly in the ticket UI, include actual line breaks in the JSON payload rather than using escaped characters such as \n.
Some API clients treat \n as plain text instead of a newline, which can cause the description to appear on a single line in the ticket.

{
 "description": "Line 1
Line 2
Line 3"
} 

When using tools like Postman or writing request bodies directly in code editors, press Enter to insert real line breaks within the string value.
This ensures the ticket description is displayed exactly as intended in BoldDesk.

Troubleshooting

Ticket creation returns 500 Internal Server Error

A 500 error can occur due to:

  • invalid field values
  • missing required fields
  • account-specific configuration conflicts

Actions:

  • Confirm all mandatory fields are present (unless using skipDependencyValidation=true).
  • Confirm that IDs for Status, Priority, Category, and custom fields are valid for the BoldDesk account.
  • If the issue persists, contact BoldDesk Support with:
    • request timestamp
    • request payload (remove sensitive information)

Request fails because requester is invalid or missing

Cause: The ticket cannot be linked to a valid requester.
Fix: If the requester is new, set requesterId to null and include requesterName + requesterEmailId.

CC users cannot be added using email addresses

Behavior:

  • BoldDesk API does not support adding CC users directly by email in a cc field.
  • CC requires contact IDs.

Request succeeds but requester does not receive an email

Actions:

Frequently Asked Questions

  1. Can the API create a ticket for a contact that does not exist yet?
    Yes. Set requesterId to null and include requesterName and requesterEmailId in the payload so BoldDesk can create the contact and then create the ticket.

  2. Why does the created ticket show the API key owner’s agent name instead of the API key label?
    This is expected behavior. BoldDesk displays the agent name of the user who generated the API key. The API key label is not shown on tickets.

  3. Can BoldDesk create one ticket for multiple recipients (bulk) in a single API call?
    No. The Create Ticket API creates one ticket per request. Bulk creation requires looping and calling the endpoint once per recipient, respecting API rate limits.

  4. Can I add CC users by email address in the Create Ticket payload?
    No. BoldDesk requires contact IDs for CC users. Adding CC users directly using email addresses is not supported.

  5. What does the source field in API responses mean?
    The source field is a numeric identifier for the channel where the ticket or action originated (for example API, Email, Agent Portal, Chat). Use it for reporting and diagnostics.

  6. How can I make a ticket public or private in the customer portal after creation?
    Use PUT /api/v1/tickets/{ticketId}/update_fields and set fields.isVisibleInCustomerPortal to true (public) or false (private).

  7. Why do line breaks not render correctly in the ticket description?
    Some clients treat \n as plain text. Include real line breaks directly in the JSON string for description.

  8. What should I check if ticket creation returns a 500 error?
    Validate required fields and confirm all IDs (priority/status/category/custom field option IDs) match the BoldDesk account configuration. If unresolved, contact BoldDesk Support with a timestamp and sanitized payload.

Related Articles

  1. BoldDesk API Authentication Guide: Secure Access Made Simple
  2. Generate and Manage API Keys in BoldDesk
  3. How to Use Swagger UI to Test the BoldDesk REST API
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied
Access denied
Access denied

No articles or sections found
No articles or sections found