# Unassign User Licenses

Remove licenses from users when they are no longer required, from Apex.

> Kind: Apex method · Updated: 2026-07-01

## Signature

```apex
global static List<UpdateLicensesFlowOutput> unassignUserLicenses(
  List<Types.UpdateLicensesInput> inputs,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| inputs | List&lt;<a href="#/apex-type-update-licenses-input">Types.UpdateLicensesInput</a>&gt; | required | List of Types.UpdateLicensesInput, one entry per license update. |
| runAs | String | optional | Email Id of the user on whose behalf the function should run. To run the action as the CloudFiles integration user, supply integrationUser. |

## Return Type

List<UpdateLicensesFlowOutput&gt; — one object per input.

## Example

```apex
List<Cldfs.Types.UpdateLicensesInput> inputs = new List<Cldfs.Types.UpdateLicensesInput>{
    new Cldfs.Types.UpdateLicensesInput(new List<Id>{'005dL000008FbqgQAC'}, 'document-management')
};
String runAs = 'integerationUser';

List<Cldfs.UpdateLicensesFlowOutput> output = Cldfs.Client.unassignUserLicenses(inputs, runAs);
```
