# API Contact update returns success response but results in Contact being unable to be viewed due to 500 error

**URL:** https://forum.mautic.org/t/api-contact-update-returns-success-response-but-results-in-contact-being-unable-to-be-viewed-due-to-500-error/27277
**Category:** Product Support
**Created:** [March 7, 2023, 1:59am UTC](https://forum.mautic.org/t/api-contact-update-returns-success-response-but-results-in-contact-being-unable-to-be-viewed-due-to-500-error/27277 "2023-03-07T01:59:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![code-connect](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/code-connect/32/9415_2.png) [@code-connect](https://forum.mautic.org/u/code-connect)
#### Post date: [March 7, 2023, 1:59am UTC](https://forum.mautic.org/t/api-contact-update-returns-success-response-but-results-in-contact-being-unable-to-be-viewed-due-to-500-error/27277/1 "2023-03-07T01:59:08Z")

</div>

**Your software**  
My Mautic version is: 4.4.6  
My PHP version is: 7.4.33  
My Database type and version is: MySQL 8

**Your problem**  
My problem is:

I am using the Mautic PHP library as recommended in the docs.

I am able to successfully create and edit contacts using the API (basic auth).

When attempting to update the contact by updating custom fields & applying tags or removing tags I sometimes receive a success response from Mautic but when I attempt to view the in Mautic I get a 500 error.

Unfortunately when checking the /var/logs folder and viewing the files there are no details regarding this error at all.

Really hoping for some insight 🙂

Details of PHP object for contact creation:

```auto
(
    [wp_user_id] => 1463985
    [email] => mauticfailedsub7@emaildomain.com
    [firstname] => 
    [lastname] => 
    [dateregistered] => 2023-03-07 01:19:11
    [last_login_time] => 2023-03-07 01:03:19
    [communications_opt_in] => 1
    [user_occupation] => Podcaster
    [membership_status] => 
    [membership_level] => 13
    [membership_start_date] => 2023-03-07 01:03:19
    [expiration_date] => 
    [phone] => 
    [card_type] => 
    [last_paypalexpress_ipn_id] => 
    [tags] => Array
        (
            [0] => -Membership Payment Failed
            [1] => Basic User
            [2] => -Monthly Gold Subscriber
            [3] => -Yearly Gold Subscriber
            [4] => -Sub Account
            [5] => -Membership Expired
            [6] => -Membership Cancellation Pending
            [7] => -Membership Cancelled
        )

)

```

Details of Contact update PHP object resulting in 500 error after update:

```auto
(
    [wp_user_id] => 1463985
    [email] => mauticfailedsub7@emaildomain.com
    [firstname] => Bon
    [lastname] => Jones
    [dateregistered] => 2023-03-07 01:19:11
    [last_login_time] => 2023-03-07 01:03:19
    [communications_opt_in] => 1
    [user_occupation] => Podcaster
    [membership_status] => 
    [membership_level] => 1
    [membership_start_date] => 2023-03-07 01:03:24
    [expiration_date] => 
    [phone] => 0431111111
    [card_type] => 
    [last_paypalexpress_ipn_id] => 
    [tags] => Array
        (
            [0] => -Membership Payment Failed
            [1] => Monthly Gold Subscriber
            [2] => -Basic User
            [3] => -Membership Expired
            [4] => -Membership Cancellation Pending
            [5] => -Membership Cancelled
        )

)

```

These errors are showing in the log: **No Errors showing in log related to described issue**

Steps I have tried to fix the problem: Looking for log information related to the error

---

<div class="post-metadata">

### Author: ![asad786](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/asad786/32/8990_2.png) [@asad786](https://forum.mautic.org/u/asad786)
#### Post date: [March 14, 2023, 1:04pm UTC](https://forum.mautic.org/t/api-contact-update-returns-success-response-but-results-in-contact-being-unable-to-be-viewed-due-to-500-error/27277/2 "2023-03-14T13:04:56Z")

</div>

You can clear the mautic cache and then try again, and make sure update all fields value correctly for example don’t put string value in multiselect field, that is not mapped in that multiselect field values.

---

<div class="post-metadata">

### Author: ![code-connect](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/code-connect/32/9415_2.png) [@code-connect](https://forum.mautic.org/u/code-connect)
#### Post date: [March 14, 2023, 9:12pm UTC](https://forum.mautic.org/t/api-contact-update-returns-success-response-but-results-in-contact-being-unable-to-be-viewed-due-to-500-error/27277/3 "2023-03-14T21:12:40Z")

</div>

The Mautic team has confirmed the bug on the github repo so theoretically it’s being taken care of there 🙂
