# API Errors

**URL:** <https://forum.mautic.org/t/api-errors/6285>\
**Category:** Product Support\
**Created:** [October 19, 2016, 5:47pm UTC](https://forum.mautic.org/t/api-errors/6285 "2016-10-19T17:47:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)\
**Post date:** [October 19, 2016, 5:47pm UTC](https://forum.mautic.org/t/api-errors/6285/1 "2016-10-19T17:47:06Z")

</div>

Hi Guys,  
  
  
  
I have been using the API with no issue, and then updated to 2.2.1.  
  
  
  
Here is the PHP code…

Code:

$params = array( 'email' =\> 'my\_email@me.com', 'firstname' =\> 'John', 'lastname' =\> 'last\_name' ); $contactApi = MauticMauticApi::getContext("contacts", $this-\>authMautic, $this-\>apiUrl);

// create a new Mautic contact  
$contact = $contactApi-\>create($params);

  
Now I am getting the following error when trying to create a new contact:  
  
Unsure why this would be attempting to use a Stage attribute...but here is the error I am getting.  

Code:

array(1) { ["error"]=\> array(2) { ["message"]=\> string(73) "Expected argument of type "MauticStageBundleEntityStage", "NULL" given" ["code"]=\> int(500) } }

  
Here is the log  

Code:

Uncaught PHP Exception SymfonyComponentPropertyAccessExceptionInvalidArgumentException: "Expected argument of type "MauticStageBundleEntityStage", "NULL" given" at /opt/bitnami/apache2/htdocs/mautic/vendor/symfony/property-access/PropertyAccessor.php line 254 {"exception":"[object] (Symfony\Component\PropertyAccess\Exception\InvalidArgumentException(code: 0): Expected argument of type "Mautic\StageBundle\Entity\Stage", "NULL" given at /opt/bitnami/apache2/htdocs/mautic/vendor/symfony/property-access/PropertyAccessor.php:254)"} []

---

<div class="post-metadata">

**Author:** ![trops](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/trops/32/3998_2.png) [@trops](https://forum.mautic.org/u/trops)\
**Post date:** [October 19, 2016, 5:47pm UTC](https://forum.mautic.org/t/api-errors/6285/2 "2016-10-19T17:47:06Z")

</div>

Hi Guys,

I have been using the API with no issue, and then updated to 2.2.1.

Here is the PHP code…

```auto
$params = array(
				'email' => 'my_email@me.com',
				'firstname' => 'John',
				'lastname' => 'last_name'
			);
$contactApi = MauticMauticApi::getContext("contacts", $this->authMautic, $this->apiUrl);

// create a new Mautic contact
$contact = $contactApi->create($params);

```

Now I am getting the following error when trying to create a new contact:

Unsure why this would be attempting to use a Stage attribute…but here is the error I am getting.

`array(1) {
  ["error"]=>
  array(2) {
    ["message"]=>
    string(73) "Expected argument of type "MauticStageBundleEntityStage", "NULL" given"
    ["code"]=>
    int(500)
  }
}
`

Here is the log

`
Uncaught PHP Exception SymfonyComponentPropertyAccessExceptionInvalidArgumentException: "Expected argument of type "MauticStageBundleEntityStage", "NULL" given" at /opt/bitnami/apache2/htdocs/mautic/vendor/symfony/property-access/PropertyAccessor.php line 254 {"exception":"[object] (Symfony\Component\PropertyAccess\Exception\InvalidArgumentException(code: 0): Expected argument of type "Mautic\StageBundle\Entity\Stage", "NULL" given at /opt/bitnami/apache2/htdocs/mautic/vendor/symfony/property-access/PropertyAccessor.php:254)"} []`
