salesforce case api INVALID_FIELD error
Fix Salesforce INVALID_FIELD on Case writes: the field name you sent isn't a field Salesforce recognizes in that context. Use when Case inserts or updates fail with INVALID_FIELD, when a field works in the UI but not the API, or when a previously working integration breaks after a config change. Not for 401 session errors, validation rule failures, or required-field errors.
TL;DR
INVALIDFIELD means the API name in your payload doesn't match any field on Case that the running user can see. The usual suspects: using the label instead of the API name, a custom field missing its _c suffix, or field-level security hiding the field from the integration user. The error message names the field; believe it.
The query
salesforce case api INVALID_FIELD errorUse this when
- Case insert or update fails with INVALID_FIELD
- A field visible in the UI fails through the API
- A working integration breaks after an admin change
Not for
- Session expired or invalid session id
- Validation rule rejections (different error)
- REQUIREDFIELDMISSING errors
Steps
1. Use the API name, not the label
The UI shows 'Case Reason'; the API wants Reason. Custom fields need the _c suffix: PriorityScore__c, not Priority Score. Read the field list from Setup, Object Manager, Case, Fields, and use the API Name column verbatim.
Expected output: every field in your payload matching an API name from the field list.
2. Check field-level security for the integration user
A field the admin can see may be invisible to the integration user's profile, which makes the API report it as invalid. Open the field's security settings and confirm the integration profile has read and edit access.
Expected output: the integration profile granted access to every field you write.
3. Describe the object to confirm
Call the describe endpoint on Case and search for your field names in the response. If a field isn't in the describe output, it doesn't exist for this user, full stop. This beats guessing from the UI.
Expected output: a describe response containing every field your payload sends.
4. Audit recent admin changes
INVALID_FIELD that appears overnight is usually a renamed, deleted, or secured field. Check Setup Audit Trail for changes to Case fields around the time the errors started.
Expected output: the audit trail entry explaining which field changed and when.
Variant phrasings
salesforce invalid_field on case insert
Steps 1 through 3 are the complete diagnosis chain.
salesforce custom field invalid through api
Step 1 first: the __c suffix is missing more often than anything else.
Why it happens
Salesforce has two names for everything: the label humans see and the API name code uses. The API only speaks the second, and it also enforces visibility per profile. So the same field can be perfectly valid for an admin in the UI and invalid for the integration user through the API, which is exactly the failure that confuses people.
Edge cases
- Compound fields (like addresses) behave specially; write their components, not the compound.
- Field names are case-sensitive in some API paths. Copy them exactly.
- Managed package fields carry a namespace prefix. Don't drop it.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_I63c8EJf2ceFAcQi2Jn6cg
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.