Assign asset
POST
/api/assets/{id}/assign
const url = 'http://localhost:3000/api/assets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/assign';const options = { method: 'POST', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"personId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","userId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/assets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/assign \ --header 'Content-Type: application/json' \ --cookie session=<session> \ --data '{ "personId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "notes": "example" }'Assign to a person and/or a user. Any open assignment for the asset is closed first.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
Request Body required
Section titled “Request Body required ” Media type application/json
At least one of personId / userId is required
object
personId
string format: uuid
userId
string format: uuid
notes
string
Example generated
{ "personId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "notes": "example"}Responses
Section titled “ Responses ”Asset assigned
Media type application/json
object
data
object
id
required
string format: uuid
assetId
required
string format: uuid
personId
string format: uuid
userId
string format: uuid
assignedAt
required
string format: date-time
returnedAt
string format: date-time
notes
string
personName
string
personEmail
string
Example generated
{ "data": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "personId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assignedAt": "2026-04-15T12:00:00Z", "returnedAt": "2026-04-15T12:00:00Z", "notes": "example", "personName": "example", "personEmail": "example" }}PersonId or userId is required
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Not authenticated
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Asset or person not found
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}