Create User via API throws Error


  • Used Zammad version: 3.2.x
  • Used Zammad installation source: Not sure :frowning:
  • Operating system: Ubuntu 18.0.4 LTS
  • Browser + version: Chrome + newest

Expected behavior:

Create a User with listed Attributes (all fields exist in Zammad).

Actual behavior:

Error-Code: {“error”:“Minimum one identifier (login, firstname, lastname, phone or email) for user is required.”}

Steps to reproduce the behavior:

$ch = curl_init();

$postfields = array(
‘firstname’ => ‘Helmut’,
‘lastname’ => ‘Ja’,
‘email’ => ‘’,
‘phone’ => ‘0164958685’,
‘address’ => ‘Irgendeine Adresse’,
‘roles’ => [‘Customer’],
‘login’ => ‘’,
‘password’ => ‘mypass’,
‘organization’ => ‘Pfitzenmeier’, //this one already exists, shouldn’t be the problem
‘invite’ => true //email to new customer

$jsonfields = json_encode($postfields, true);

echo $jsonfields;

{“firstname":“Helmut”,“lastname”:“Ja”,“email”:"”,“phone”:“0164958685”,“address”:“Irgendeine Adresse”,“roles”:[“Customer”],“login":"”,“password”:“mypass”,“organization”:“Pfitzenmeier”,“invite”:true}

curl_setopt($ch, CURLOPT_URL, ‘’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘POST’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Authorization: Bearer myToken’ //myToken is created with all rights!
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonfields);

$result = curl_exec($ch);

echo $result; //throws Error


That’s my code so far, but i always get the same Error. Is anybody able to help me?

Thanks in advance!

Nvm, it was “Content-Type: application/json” which was missing in the header.

Topic can be closed.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.