API Resources
How the endpoints are grouped, how a name becomes a permission, and how to find the one you need.
Overview
The API is organised by resource, not by table. A resource is an area of the product: clients, invoices, services, products, tickets. Inside it, an action is one thing you can do.
That pair is the API's whole naming system. Clients/GetClients is the route's identity and the permission you tick when issuing a key. It is also the string in a 403 message and the name the documentation uses. Learn one of them and you know the rest.
Actions read as verbs on purpose: Get, Create, Update, Delete, Bulk. The HTTP method agrees with the verb, so a name and a method never tell you different stories.
Structure
The admin surface groups its resources into families. You rarely need more than one family for a given integration, which is also the natural boundary for the permissions you grant.
The client surface carries a much shorter list, because a customer manages one account rather than an installation. It is covered in its own article.
Finding an Endpoint
Work down, not up. Pick the family, open its reference article in this section, and read the action list. Each entry gives the method, the path, the permission name and a working sample in four languages.
If you know the object but not the family, the name usually gives it away. Anything about a customer's own record lives in clients. Anything with a price on it lives in invoices or orders, and anything running on a server lives in services.
Example
Code that already runs inside an installation does not need HTTP, a key or a network round trip. It can call the same resource in process, and gets back the same envelope.
// over HTTP: GET /api/v1/admin/clients?limit=5
// in process, from a module, a cron handler or a hook listener:
$result = \WISECP\Api\Kernel::internal('Clients/GetClients', [], ['limit' => 5]);
$clients = $result['data'] ?? [];
$total = $result['meta']['total'] ?? 0;
// the client surface needs to be told whose account it is acting on
$me = \WISECP\Api\Kernel::internal('client:Account/GetMe', ['owner_id' => 42]);
Pitfalls
Creating a client writes several tables, fires hooks and may send a notification. Reading one merges records that are stored apart. Expecting a column-for-field mapping will mislead you; read the action's field list instead of the schema.
A module may publish endpoints under a group named Module:{Type}/{Name}. They appear as their own permission checkboxes and behave like any other endpoint. They belong to that module and travel with it, so an integration that relies on one should say which module it needs.
Related Articles
Thanks for your feedback!
Our support team is here around the clock for anything you can't find above.