Freshdesk API2 ticket_type error on CURL PUSH

​I’m getting issues with the ticket_type field. Appreciate if anyone who’s figured this out could advise of what I’m doing wrong. I’ve tried it as a custom field, prefixing with cf_ etc but no joy.

    curl -u MY_API_KEY:X -H "Content-Type: application/json" -X POST -d '{ "description": "My Testing API", "subject": "My Testing API", "email": "", "priority": 1, "status": 2, "custom_fields" : {  "category" : "Sales"}, "ticket_type": "Sales Enquiry" }' ''
Error that comes back
    "description": "Validation failed",
    "errors": [{
    "field": "ticket_type",
    "message": "Unexpected/invalid field in request",
    "code": "invalid_field"


curl -u MY_API_KEY:X -X GET


      "label":"Search a requester",
      "description":"Ticket requester",
      "description":"Ticket subject",
      "description":"Ticket type",
         "Sales Enquiry",
         "Billing Enquiry",
         "Feature Request",

Hope you are doing good! Welcome to the community!
there is no field called ticket_type in creating the ticket, kindly refer to this link for more reference.

Hope it helps :slight_smile:


Hi Thantos,

It must be a custom field as my GET call returned the following :-

{“id”:5000627914,“name”:“ticket_type”,“label”:“Type”,“description”:“Ticket type”,“position”:3,“required_for_closure”:false,“required_for_agents”:false,“type”:“default_ticket_type”,“default”:true,“customers_can_edit”:false,“label_for_customers”:“Type”,“required_for_customers”:false,“displayed_to_customers”:false,“created_at”:“2015-02-18T22:16:32Z”,“updated_at”:“2020-04-14T10:16:21Z”,“choices”:[“Sales Enquiry”,“Billing Enquiry”,“Problem”,“Feature Request”,“Disconnection”,“Other”]}

I’ve also tried
curl -u MY_API_KEY:X -H “Content-Type: application/json” -X POST -d ‘{ “description”: “My Testing API”, “subject”: “My Testing API”, “email”: “”, “priority”: 1, “status”: 2, “custom_fields” : { “ticket_type”: “Sales Enquiry”} }’ ‘

I got it, kindly take a look at this link for more reference on how to create a ticket with custom feild

Hope it helps

Hi Santhosh,

Thank you for your response. That link was what I was already using as a template.

My other custom fields work, it’s just this particular one that wont.

As I stated. I’ve already tried:-

I’ve also tried
curl -u MY_API_KEY:X -H “Content-Type: application/json” -X POST -d ‘{ “description”: “My Testing API”, “subject”: “My Testing API”, “email”: “”, “priority”: 1, “status”: 2, “custom_fields” : { “ticket_type”: “Sales Enquiry”} }’ ‘’

What is the type of that custom field (text/dropdown) ?
if it is the dropdown, then you need to pass the correct value to get it populated.

Hope it helps :slight_smile:


1 Like

Hi Santosh, thanks for reply and sorry for delay over the holidays.

In my OP, I demonstrated what the curl GET returns. AFAIK it’s a dropdown. My curl POST call to populate with “Sales Enquiry” matches one of the dropdown options.

“description”:“Ticket type”,
“Sales Enquiry”,
“Billing Enquiry”,
“Feature Request”,