## TL;DR

A custom field name or value in your ticket payload failed Freshdesk validation, and the error names the field. Look up the field's type and allowed values in the Freshdesk admin panel, fix the payload to match, and resend. The usual cause is a type mismatch: a string where Freshdesk wants a number or a dropdown choice.

Match the field definition exactly. Freshdesk does not guess.

## Verbatim query

```text
freshdesk API 400: Validation failed on ticket custom_fields
```

## Steps

1. Read the error for the offending field
   The 400 response names which custom field failed validation. Copy the field name.
   Expected: The exact custom field at fault.

2. Look up the field definition in Freshdesk admin
   Open the ticket custom fields settings and check the field's type, whether it is required, and its allowed choices.
   Expected: The field's type and constraints written down.

3. Fix the value or name in the payload
   Correct the mismatch: a dropdown value must match a defined choice exactly, a number field must receive a number, a date must use the expected format.
   Expected: The payload value matches the field definition.

4. Resend the ticket create or update
   Send the corrected payload.
   Expected: A 201 or 200 response with the ticket object.

5. Validate custom fields in the generated client before sending
   Check types and choices locally against a cached field definition so bad values fail fast with a clear message.
   Expected: Future mismatches raise a local error naming the field.

## Use this when

- Freshdesk returns 400 "Validation failed" pointing at ticket custom_fields.
- A generated client builds ticket payloads with guessed field types.
- The same payload works without the custom_fields block.

## Not for this skill when

- The 400 is about standard ticket fields like subject or email.
- The failure is a Freshdesk 401 or 403.
- The custom field error is on contacts, companies, or another object with different field rules.

## Variant phrasings

### "custom_fields: X is invalid"

Same validation failure naming the field directly. Same fix.

### Validation failed on custom field dropdown values

Dropdown choices must match exactly, including case. Copy the choice from admin, not from memory.

## Why it happens

Freshdesk custom fields are strongly typed with constrained choices, but generated clients often treat every custom field as a free-text string. A dropdown expecting one of five exact values, a checkbox expecting a boolean, or a number field receiving a quoted string all fail validation. The client guessed the shape; Freshdesk enforces it.

## Edge cases

- Dropdown and nested-field choices are case-sensitive; near-matches fail.
- Multi-select fields expect arrays; a single string fails.
- Date fields need the exact format Freshdesk documents; other ISO variants may fail.
- A field renamed in admin keeps its old API name in some cases; check the actual API name, not the display label.
- Required custom fields missing from the payload fail validation too, not just wrong values.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_YZ_Z52dN6pT3y2fZravk7g
