Skip to main content
Question

Assign new owner via API


Forum|alt.badge.img+2


I've been following the directions as per https://school.jamfcloud.com/api/docs/#api-Devices-Assign_owner and PUT to https://{yourDomain}.jamfcloud.com/api/devices/:udid/owner with all the relevant information but no matter how I send the request with the user parameter, it returns a code of 400 with the message "UserRequired".

I've spent a whole day trying every variation of submission and multiple programs and methods and the result is the same.

Has anyone got any pointers?

 

2 replies

easyedc
Forum|alt.badge.img+16
  • Esteemed Contributor
  • 623 replies
  • May 14, 2025

How are you trying to perform this? Via a script? If so, sharing your script would be helpful. I use the API to write owner data from an internal API source to the my Jamf server via the Jamf API. I'm on Jamf Pro, not school, but I suspect it'll follow a similar pattern. Without seeing your workflow, I am wondering if the user they're asking for is the user who has rights to update your Jamf via api.

 


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • 1 reply
  • May 15, 2025
easyedc wrote:

How are you trying to perform this? Via a script? If so, sharing your script would be helpful. I use the API to write owner data from an internal API source to the my Jamf server via the Jamf API. I'm on Jamf Pro, not school, but I suspect it'll follow a similar pattern. Without seeing your workflow, I am wondering if the user they're asking for is the user who has rights to update your Jamf via api.

 


I've tried multiple ways. Via N8N Workflow, via .js script and via plain curl command.
The error comes back with "UserRequired" every time, not unauthorised, and I can get data every other way with these credentials and all permissions are selected in the API Key section, so I assume permissions are ok.

The .js is below (using Node) and is bare minimum so I can troubleshoot.

const https = require('https'); const querystring = require('querystring'); const postData = querystring.stringify({ user: "0" }); const options = { hostname: '******.jamfcloud.com', path: '/api/devices/00008030-0018454202F8C02E/owner', method: 'PUT', headers: { 'Authorization': 'Basic ********', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'Content-Length': Buffer.byteLength(postData), } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => data += chunk); res.on('end', () => { console.log(`Status: ${res.statusCode}`); console.log('Body:', data); }); }); req.on('error', (e) => { console.error(`Request failed: ${e.message}`); }); req.write(postData); req.end();

It has me stumped and I guarantee it's something obvious but just not to me at the moment.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings