doc/api/graphql/assign_gitlab_duo_seats.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Use this API to assign GitLab Duo seats to users.
api scope.To start, retrieve the purchase ID for the GitLab Duo add-on. For GitLab.com:
query {
addOnPurchases (namespaceId: "gid://gitlab/Group/YOUR_NAMESPACE_ID")
{
name
purchasedQuantity
assignedQuantity
id
}
}
For GitLab Self-Managed and GitLab Dedicated:
query {
addOnPurchases
{
name
purchasedQuantity
assignedQuantity
id
}
}
Then assign seats to specific users:
mutation {
userAddOnAssignmentBulkCreate(input: {
addOnPurchaseId: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/YOUR_ADDON_PURCHASE_ID",
userIds: [
"gid://gitlab/User/USER_ID_1",
"gid://gitlab/User/USER_ID_2",
"gid://gitlab/User/USER_ID_3"
]
}) {
addOnPurchase {
id
name
assignedQuantity
purchasedQuantity
}
users {
nodes {
id
username
}
}
errors
}
}
You can use GraphQL to assign seats to users.