assignBranchManagers
Requires a customer (portal or buyer app) session.
assign managers to a branch (CUSTOMER_ADMIN only). Targets must be same-partner CUSTOMER users; CUSTOMER_VIEWER is allowed (EDGE).
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation AssignBranchManagers($addressId: ID!, $userIds: [ID!]!) {
assignBranchManagers(addressId: $addressId, userIds: $userIds) {
id
approverCount
isActive
isBranch
label
memberCount
approvers {
firstName
lastName
email
role
userId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AssignBranchManagers($addressId: ID!, $userIds: [ID!]!) {\n assignBranchManagers(addressId: $addressId, userIds: $userIds) {\n id\n approverCount\n isActive\n isBranch\n label\n memberCount\n approvers {\n firstName\n lastName\n email\n role\n userId\n }\n }\n}",
"variables": {
"addressId": "id",
"userIds": [
"id"
]
}
}
EOF
Variables:
{
"addressId": "id",
"userIds": [
"id"
]
}
Response:
{
"data": {
"assignBranchManagers": {
"id": "id",
"approverCount": 0,
"isActive": true,
"isBranch": true,
"label": "string",
"memberCount": 0,
"approvers": [
{
"firstName": "string",
"lastName": "string",
"email": "string",
"role": "string",
"userId": "id"
}
]
}
}
}
assignBranchManagers(
addressId: ID!
userIds: [ID!]!
): CustomerBranch!
Arguments
assignBranchManagers.addressId ● ID! non-null scalar
The ID of the address.
assignBranchManagers.userIds ● [ID!]! non-null scalar
The IDs of the users.
Type
CustomerBranch object
a partner sales branch — an Address with isBranch = true. The label is the branch name; pendingApprovalCount feeds the deactivation warning (EDGE #4).