Hi catmanjan,
Thanks for reaching out to Microsoft!
Currently, the Microsoft Graph API does not support setting a retention label at the same time as uploading a driveItem automically.
Apply (set) a retention label on a driveItem (files and folders) using Graph API-
PATCH /driveitem/retentionLabel
PATCH /drives/{drive-id}/items/{item-id}/retentionLabel
Use retention labels to manage the lifecycle of documents stored in SharePoint
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.