Reading this in another language? Use your browser's built-in translate option. Button and field names stay in English on purpose, to match what you see in Keysender.
A database is one pool of stock for one product, the same thing you create under Inventory in the panel. Every connected listing draws from it, and every code you upload belongs to one. The Database endpoints let your software create databases, read their stock counts, rename them, and remove empty ones, all from one bearer token.
TL;DR
POST /database; a repeat call with the same sku returns the existing one instead of a duplicate.GET/PUT/DELETE /database.to_send above 0).Make sure you have:
POST /login (see Getting started with the Keysender API).https://panel.keysender.com/api/v1.0 and the header Authorization: Bearer YOUR_ACCESS_TOKEN on every call.A database has these fields in every response: id, name, type (0 for text codes, 1 for files), available (codes in stock), to_send (codes reserved for orders that are still delivering), and sku.
GET /databases. Add page, pagesize, or filter=[{"name":"part of a name"}] to narrow the list. curl "https://panel.keysender.com/api/v1.0/databases?pagesize=50" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
GET /database?id=123. You receive the six fields above, or 422 if the id is not yours. POST /database with name, sku, and type: curl -X POST "https://panel.keysender.com/api/v1.0/database" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Steam key: Example Game", "sku": "EXAMPLE-GAME-STEAM", "type": 0}'
sku is the identifier your own systems use. If a database with that SKU already exists on your account, the API returns the existing database instead of creating a second one, so a repeated create is safe. PUT /database with id and the new name. The sku and type cannot be changed after creation; create a new database instead. DELETE /database with {"id": 123} in the body. to_send above 0) cannot be deleted. Wait for those orders to finish, then retry. After POST /database, GET /databases lists the new entry with available: 0, and it appears under Inventory in the panel with the same name. After a delete, it is gone from both. Next, load it with Uploading and managing codes with the API.
| Symptom | Cause | Action |
|---|---|---|
422 with You can change only own code databases |
The id belongs to another account or does not exist |
Re-check the id with GET /databases |
| A create returns an id you already had | The SKU was already in use; that is the match, not an error | No action needed, reuse the returned id |
| A delete is refused | The database still has codes reserved for delivery (to_send above 0) |
Wait for those orders to finish, then retry |
Submit a ticket with the request body (without your secret) and the response.
The API returns the existing database instead of creating a second one. That makes create safe to run on every sync: the SKU is the match key.
No. PUT /database only changes the name. Create a new database for a different SKU or type and move the stock.
A database with codes reserved for orders still delivering (to_send above 0) cannot be deleted. Wait for those deliveries to finish, then retry.