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
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | String! | Yes | External user ID from the reseller system identifying the customer to update |
input | CustomerUpdateInput! | Yes | Updated customer information. All fields are optional. |
CustomerUpdateInput
| Field | Type | Required | Description |
|---|---|---|---|
email | String | No | New email address for the customer. Must be a valid email format if provided. |
name | String | No | New full name for the customer. |
userId | String | No | New external user ID from the reseller system. Must be unique per reseller if provided. |
handbookLimit | Int | No | Per-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
| Field | Type | Description |
|---|---|---|
userId | String! | External user ID from the reseller system |
email | String! | Email address of the customer |
name | String | Full name of the customer |
createdAt | String! | ISO 8601 timestamp of when the customer was created |
customerHandbookLimit | Int | Per-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
CustomerUpdateInputare optional - only provided fields will be updated - Setting
handbookLimittonullwill 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