REST Admin catalogue: required fields, least privilege and uncertain writes

Hello SimplyBook technical team,

Your general support referred us here. We reviewed the official API documentation and REST Admin examples. Please clarify the contract for REST Admin v2 on user-api-v2.simplybook.me, separately from the older JSON-RPC administration API. This is a documentation request only: no account, subscription, permissions or feature changes are requested.

  1. Required fields and safe initial state
    For POST /admin/services and POST /admin/providers, please provide the current versioned OpenAPI specification and a minimal valid body. Which properties are required, nullable, defaulted or bounded? Please specify duration units, length/numeric limits and whether id must be omitted. Can both resources be created hidden/inactive without public booking exposure, and which exact fields guarantee that?

  2. Associations and payment fields
    At creation, separately from update, what do omitted, null and [] mean for services.providers and providers.services? Does an empty providers list mean any provider? What creation/linking order avoids temporary exposure? When payment/deposit features are disabled, must price, tax_id and deposit_price be omitted? No feature activation is requested.

  3. Least privilege and read-only rights verification
    Please provide the REST role/action matrix for catalogue CRUD, associations, provider schedules and company schedules. Which actions can Senior Employee perform? Can an API User Key be limited to one company and these actions, with expiry/revocation? Which read-only REST method proves the token company, user, blocked state and effective permissions? The JSON-RPC getCurrentUserDetails warning about incomplete rights checks does not establish the REST contract. Please confirm REST refresh semantics and distinguish REST X-Token from JSON-RPC X-User-Token.

  4. Uncertain creation and exact reconciliation
    Do these POSTs support a documented idempotency key or unique external reference? If yes, specify header/field, scope, retention and concurrent handling. After timeout or lost response, which read-only evidence identifies that exact request result? Which errors guarantee no mutation? Please specify exact-ID readback, pagination and consistency delays. A matching name or inventory difference cannot distinguish our creation from a concurrent user creation. We do not automatically resend an uncertain POST.

  5. Subscription prerequisites
    Are these API operations available on Basic after the premium trial ends? Which custom features and feature-slot limits apply? Please distinguish paid Basic entitlements from temporary trial entitlements. No upgrade is requested.

Please link each answer to a versioned contract or state explicitly when a guarantee is not provided.
Thank you.

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.

  1. 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).

  1. 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:

  1. Create the providers with is_visible false.
  2. Create the service with is_visible false and the full providers list in the same request.
  3. Set up schedules.
  4. 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.

  1. 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.
  1. 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.
  1. 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

Hello Vitalii,

Thank you for the detailed explanation. Could you clarify the interpretation of GET /admin/acl for REST Admin v2? This is a generic documentation question; no account, permission, feature or subscription changes are requested.

  1. For entries containing resource, resource_urls and an integer rule, what does each bit of rule mean? In particular, how should values 63 and 0 be interpreted? Are there precedence, inheritance or deny rules?

  2. Which resource names and rule bits govern GET/list, POST/create and PUT/update for /admin/services and /admin/providers, including the services.providers and providers.services associations? Are these ACL checks enforced by the REST endpoints, or must the application perform additional checks?

  3. Do provider_worktime and service_worktime map to the REST schedule endpoints? Please specify the applicable resources/bits and any additional company/provider scope restrictions.

  4. Can this ACL response establish effective permission for those operations without a write probe, and is there a versioned schema or mapping we can rely on? If not, please state the limitations explicitly.

No credentials, account identifiers, private captures or customer data are included. Thank you.

Hello,

GET /admin/acl is an internal endpoint that our admin panel uses to build its menus. It is not part of the public API: there is no versioned schema, and its resource names and values can change without notice. So we don’t recommend building permission checks on it.

Briefly, to your questions:

  • “rule” is a bitmask of allowed actions for the current role:

    • 1: view
    • 2: edit (create and update)
    • 4: delete
    • 8, 16, 32: the same three actions, but only for the user’s own records (records linked to the provider the user is attached to)

    So 63 means full access, 7 means view, edit and delete on all records, and 0 means no access. The value is already final for the role, so there is nothing to merge or inherit on your side.

  • The catalogue and schedule endpoints check permissions themselves and return 403 when the user is not allowed. You don’t need any additional checks.

  • provider_worktime and service_worktime are used by our admin panel, not by the REST schedule endpoints. Access to /admin/worktime (company, provider and service schedules) is all or nothing: with default roles, only Administrator has it.

What you can rely on instead:

  • The roles from my previous reply: Administrator can do everything; Senior Employee can create, update and delete services and providers, but has no access to schedules.
  • The response of the request itself: 403 means the user is not allowed to do this.

One case where you won’t get a 403: if a user without permission to edit services updates a provider with a “services” list, the provider is saved and the list is silently ignored. The links stay unchanged. With Administrator or Senior Employee this doesn’t happen, but it’s worth comparing the links in the response with what you sent.

Best regards,
Vitalii
SimplyBook.me Team