Overview
Customers are the buyer records Keysender keeps for your account: an email, a name, contact details, notes, and the list type that decides whether a buyer is blocked or always allowed. The Customer endpoints keep those records in step with your own CRM or store, so a vetted buyer is treated the same way on every channel.
TL;DR
- A customer record holds a buyer's contact details and their block/allow list type.
- Create one with
POST /customer; an email that already exists returns422 Invalid email, meaning "already there." - Update the five editable fields with
PUT /customer;emailandlanguagecannot change afterward.
Before you start
Make sure you have:
- A bearer token from
POST /loginand the base URLhttps://panel.keysender.com/api/v1.0. - The customer's email address. It is the identity of the record and cannot be changed afterwards.
A customer has these fields: id, email, firstName, lastName, language, phone, organizationId, marketingFlag, listType, and notes.
Steps
List customers
- Send
GET /customers. Addpageandpagesizefor large lists.
Read one customer
- Send
GET /customer?id=789.
Create a customer
- Send
POST /customerwith at leastemailandfirstName:
curl -X POST "https://panel.keysender.com/api/v1.0/customer" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "firstName": "Alex", "lastName": "Rivera", "notes": "Repeat buyer, verified", "marketingFlag": false}'
- Optional fields:
lastName,language(defaulten),phone,notes,marketingFlag, andlistType. - An email that already exists on your account is rejected with
422and the messageInvalid email. Read that as "already there" and update the existing record instead.
Update a customer
- Send
PUT /customerwithidand only the fields to change:firstName,lastName,phone,notes, ormarketingFlag. Theemailstays as created.
Delete a customer
- Send
DELETE /customerwith{"id": 789}.
Block or allow a buyer
- The block and allow lists you manage in the panel are the same records. See Add a customer to the block or allow list for what each list does to delivery and fraud screening.
Confirm it works
GET /customer?id=... returns the record you created, and the same buyer appears under Customers in the panel with the notes you wrote. A customer's email is also the payer you send in Creating transactions with the API.
Troubleshooting
| Symptom | Cause | Action |
|---|---|---|
422 Invalid email on create |
The email exists already, or it is not a valid address | Search for it with GET /customers first |
| A field did not change on update | Only the five editable fields apply; email and language are not |
Confirm the field is one of firstName, lastName, phone, notes, marketingFlag |
| A create was rejected with no matching existing customer | A required field is missing, or email is malformed |
Resend with email and firstName at minimum |
If it still is not working
Submit a ticket with the customer id and the request you sent.
Quick answers
Why does creating a customer return Invalid email?
That message is also what you get when the email already exists on your account. Search for it with GET /customers first and update the existing record instead of creating a new one.
Can I change a customer's email over the API?
No. The email is the identity of the record and cannot be changed after creation. Only firstName, lastName, phone, notes, and marketingFlag can be updated.
How do customer records relate to the block and allow lists?
They are the same records. The listType field is what the panel's block and allow lists set, and it decides how fraud screening treats that buyer on every channel.
Was this helpful?