Hello,
Thank you for the detailed questions. Below is how REST Admin v2 (user-api-v2.simplybook.me, /admin/*) works for the cases you described.
- Required fields and safe initial state
POST /admin/services
- Writable fields: name, description, price, deposit_price, tax_id, duration, is_visible, providers.
- Required: name (non-empty), duration, is_visible (must not be null; there is no default).
- duration is in minutes. It must be an integer from 5 to 1435 and a multiple of the company time frame (GET /admin/config returns time_frame).
- price and deposit_price: number from 0 to 99999999.99; deposit_price must not exceed price.
- tax_id: null or the id of an existing tax.
- name is stored up to 250 characters; there is no explicit length check before that.
- Minimal body: {“name”: “Example”, “duration”: 60, “is_visible”: false}
POST /admin/providers
- Writable fields: name, qty, email, description, phone, is_visible, color, services.
- Required: name, qty (integer 1-99), is_visible.
- email may be a comma-separated list; phone keeps only digits and “+”, up to 15 characters.
- Creating a provider beyond the provider limit of the subscription returns 403.
- Minimal body: {“name”: “Example”, “qty”: 1, “is_visible”: false}
id: please omit it. A new record is always created, but for providers an id in the body is still used by some checks and can cause an unexpected 400.
Hidden state: yes, both can be created with “is_visible”: false. A hidden service or provider is not shown on the booking page or in public API lists, and direct links don’t work for it. is_visible is the only field for this. We don’t document a formal guarantee that every public booking path rejects a hidden record, so keep both the service and its providers hidden until setup is finished (see the order below). is_active is not writable; it only means “not deleted”.
Response: HTTP 200 (not 201) with the full created entity, including its id.
Important for updates: PUT is a full replacement for scalar fields, not a patch. An omitted description, email or phone becomes empty; an omitted name, duration, qty or is_visible fails validation. When paid services are on, an omitted price resets to 0, an omitted deposit_price turns the deposit off, and an omitted tax_id clears the tax. Always send the complete object (read it with GET first).
- Associations and payment fields
services.providers and providers.services behave the same on create and update:
- omitted or null: links are not changed (on create: no links);
[]: all links are removed;
- a list: the links are replaced with exactly that list.
An empty link list does NOT mean “no provider”. A service with no linked providers can be booked with any active provider, and every provider also serves all such unlinked services. So "providers": [] on a service, or "services": [] on a provider, does not limit anything.
Order that avoids temporary exposure:
- Create the providers with is_visible false.
- Create the service with is_visible false and the full providers list in the same request.
- Set up schedules.
- Read each record back and PUT it with is_visible true.
Note that links are written after the main record. If linking fails, the service or provider stays created without links, which is one more reason to keep it hidden until you have verified it.
Payment fields: you don’t have to omit them. If the paid services or deposit features are off, price, deposit_price and tax_id are still range-checked (and tax_id must exist), but then silently ignored, not stored. When the deposit feature is on, deposit_price 0 is rejected; send null instead.
- Least privilege and rights verification
Roles for catalogue endpoints:
- Administrator: everything.
- Senior Employee: list/get, create, update and delete services and providers, including links. No access to work schedules (/admin/worktime for company and provider), company settings or subscription info.
- Junior Employee: list/get limited to their linked provider; can update only their own provider; cannot create or delete.
- Viewer: read only.
API User Keys:
- A key belongs to one user in one company and has exactly that user’s role. It cannot be limited to specific actions.
- An expiry date is mandatory (up to 5 years). A key can be deactivated or revoked at any time, which stops all tokens issued from it immediately.
- A key is created by the user themselves in their own account (re-authentication and 2FA are required). An Administrator can deactivate or revoke any user’s key.
- For least privilege, create a dedicated Senior Employee user and issue the key for that user. If you also need schedules, the user has to be an Administrator.
Read-only verification:
- There is no documented “whoami” endpoint. GET /admin/user/current returns the user (id, login, name, email, company) but not the role. GET /admin/acl returns the effective permission rules of the current role. Both are currently undocumented, so treat their format as unstable.
- A blocked user or a revoked key cannot log in, and existing tokens are rejected, so a successful authenticated call already shows that the user is not blocked.
- A token only works with the company it was issued for (X-Company-Login).
Tokens:
- Login: POST /admin/auth. Then send X-Company-Login and X-Token on every request.
- The access token is valid for 1 hour (shorter with HIPAA). An expired token returns 401.
- POST /admin/auth/refresh-token returns a new access token and a new refresh token. The refresh token is single-use; it has no separate expiry of its own, but it stops working if the key is revoked, the password changes or the user is blocked. The previous access token stays valid until it expires; POST /admin/auth/logout invalidates it.
- Changing the user’s password invalidates the tokens issued with that password.
- REST X-Token and JSON-RPC X-User-Token are the same kind of user token, so one works in both APIs. Don’t confuse this with the JSON-RPC X-Token header, which is the company API key token for the public API.
- Uncertain creation and reconciliation
- There is no idempotency key and no external reference field.
- Errors that mean nothing was saved: 401, 403, and 400 validation errors (the request is rejected before anything is saved). One exception: if the user is not allowed to link one of the ids in providers/services, the record is already created when that error is returned. With an Administrator or Senior Employee user this doesn’t happen. 5xx errors, timeouts or a lost response tell you nothing about whether the record was created.
- A created record can be read back by id (GET /admin/services/{id}, GET /admin/providers/{id}) immediately after the request completes; there is no delay.
- GET /admin/services and /admin/providers are not paginated; the full list is returned (page and on_page are ignored).
- Practical reconciliation: put a unique marker of your own (for example a UUID) in description when you create the record. After an uncertain POST, list the records and search for that marker. That is the only way to tell your creation apart from someone else’s. Keep in mind that a later PUT without description clears the marker.
- Optionally, the new_service and new_provider callbacks can confirm creation asynchronously.
- Subscription
Yes, these API operations work on the Basic plan, including after the premium trial ends.
If anything is unclear or you need an example for a specific call, let me know.
Best regards,
Vitalii
SimplyBook.me Team