Delete custom field

I created a custom field and need to delete the custom field. It worked. When I tried to delete ( Delete a Custom Field ), the response I got is { “errorCode”: 0, “message”: “OK” }.

When I tried with List Custom Fields , it return empty custom fields. That is expected.

But it really didn’t delete the custom field in Servicem8 UI. I am able to see the deleted custom field in the UI.

Why it does NOT delete custom field from UI? Thanks
Sam

Hi Sam

If the delete call is successful, the Custom Fields API returns { "errorCode": 0, "message": "OK" }.

A common gotcha is the delete request format: the endpoint is DELETE https://api.servicem8.com/custom_fields_1.0 and the Custom Field UUID must be sent in the request body as application/x-www-form-urlencoded with the parameter name UUID.

To double-check you’re deleting the right one, grab the field’s uuid from GET https://api.servicem8.com/custom_fields_1.0 and use that exact UUID in the delete request.

If you’re logged in to ServiceM8 while making the change, try logging out and back in, as that can help if you’re seeing a stale/cached view.

Example:

curl -X DELETE "https://api.servicem8.com/custom_fields_1.0" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "UUID=<custom_field_uuid>"

If it’s still listed in GET /custom_fields_1.0 after confirming the UUID and signing out/in, email support@servicem8.com with the Custom Field UUID and your raw request/response (with any tokens removed) so we can investigate.

Thanks,
Cody

1 Like

I had this issue recently.

It ended up taking about a week for the deletion to come through on the UI.

Just takes a while, I guess :grin:

1 Like

I sent email to support@servicem8.com and update here with solution. Thanks Cody and Chris