Skip to main content

Update Customer

Update an existing SSO user (customer). The userId parameter is the external user ID from the reseller system. Returns the updated customer.

Mutation​

mutation UpdateHandbookCustomer($userId: String!, $input: CustomerUpdateInput!) {
updateHandbookCustomer(userId: $userId, input: $input) {
userId
email
name
createdAt
customerHandbookLimit
}
}

Parameters​

ParameterTypeRequiredDescription
userIdString!YesExternal user ID from the reseller system identifying the customer to update
inputCustomerUpdateInput!YesUpdated customer information. All fields are optional.

CustomerUpdateInput​

FieldTypeRequiredDescription
emailStringNoNew email address for the customer. Must be a valid email format if provided.
nameStringNoNew full name for the customer.
userIdStringNoNew external user ID from the reseller system. Must be unique per reseller if provided.
handbookLimitIntNoPer-user handbook generation limit override. Set to a positive integer to override, or omit/set to null to use reseller's global default.

Response​

{
"data": {
"updateHandbookCustomer": {
"userId": "external_user_123",
"email": "[email protected]",
"name": "Jane Doe",
"createdAt": "2025-01-01T00:00:00Z",
"customerHandbookLimit": 20
}
}
}

Examples​

Update Name Only​

mutation {
updateHandbookCustomer(
userId: "external_user_123"
input: {
name: "Jane Doe"
}
) {
userId
email
name
}
}

Update Email and Name​

mutation {
updateHandbookCustomer(
userId: "external_user_123"
input: {
name: "Jane Doe"
email: "[email protected]"
}
) {
userId
email
name
}
}

Update Handbook Limit​

mutation {
updateHandbookCustomer(
userId: "external_user_123"
input: {
handbookLimit: 20
}
) {
userId
email
customerHandbookLimit
}
}

Update User ID​

mutation {
updateHandbookCustomer(
userId: "external_user_123"
input: {
userId: "new_external_user_id"
}
) {
userId
email
name
}
}

With Variables​

mutation UpdateCustomer($userId: String!, $input: CustomerUpdateInput!) {
updateHandbookCustomer(userId: $userId, input: $input) {
userId
email
name
customerHandbookLimit
}
}

Variables:

{
"userId": "external_user_123",
"input": {
"name": "Jane Doe",
"email": "[email protected]",
"handbookLimit": 20
}
}

Response Fields​

FieldTypeDescription
userIdString!External user ID from the reseller system
emailString!Email address of the customer
nameStringFull name of the customer
createdAtString!ISO 8601 timestamp of when the customer was created
customerHandbookLimitIntPer-user handbook generation limit (null means use reseller's global default)

Error Responses​

Customer Not Found​

{
"errors": [
{
"message": "Customer not found or access denied",
"extensions": {
"code": "NOT_FOUND"
}
}
]
}

Invalid Email Format​

{
"errors": [
{
"message": "Valid email is required",
"extensions": {
"code": "BAD_USER_INPUT"
}
}
]
}

User ID Already Exists​

{
"errors": [
{
"message": "User with this userId already exists for this reseller",
"extensions": {
"code": "BAD_USER_INPUT"
}
}
]
}

Notes​

  • Requires reseller API key authentication
  • The customer must belong to the authenticated reseller
  • All fields in CustomerUpdateInput are optional - only provided fields will be updated
  • Setting handbookLimit to null will reset the customer to use the reseller's global default limit
  • Email addresses must be unique across all resellers
  • User IDs must be unique per reseller