Skip to content

Capabilities API

Base path: /api/workspaces/{workspaceId}/capabilities

Capability invocation is the primary way to interact with extension logic. The platform routes each call to the correct extension based on the registry.

Authorization: Requires ADMIN role or workspace membership.

Invoke a Capability

http
POST /api/workspaces/{workspaceId}/capabilities/{capabilityKey}
Content-Type: application/json

Path Parameters

ParameterDescription
workspaceIdWorkspace UUID
capabilityKeyDot-separated capability key (e.g. crm.product.search)

Request Body

Any JSON object. The shape is defined by the extension handler for that capability key.

Example

bash
curl -X POST http://localhost:8080/api/workspaces/ws-uuid/capabilities/crm.product.search \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"query": "laptop", "limit": 10}'

Response 200 OK

json
{
  "code": "SUCCESS",
  "data": {
    "results": [
      { "id": "prod-1", "name": "Laptop Pro", "price": 1299.00 }
    ],
    "total": 1
  }
}

Capability Key Convention

Keys follow a dot-separated prefix pattern:

{domain}.{resource}.{action}

Examples:

KeyDescription
crm.product.searchSearch products in the CRM extension
crm.deal.createCreate a new deal
chat.conversation.listList conversations
chat.message.sendSend a message

The key is built from:

  • @CapabilityGroup(prefix = "crm.product") on the handler class
  • @Capability(key = "search") on the method

→ Combined: crm.product.search


Routing Logic

  1. Platform looks up (workspaceId, capabilityKey) in ext_capability_registry
  2. Finds the extension's runtimeType and endpoint
  3. Dispatches:
    • IN_PROCESS: Reflects into the PF4J plugin, finds the @CapabilityGroup/@Capability method, invokes it
    • EXTERNAL_SERVICE: HTTP POST to {serviceBaseUrl}/capabilities/{capabilityKey}

Error Responses

ScenarioHTTP Statuscode
Capability key not found404NOT_FOUND
Extension disabled403EXTENSION_DISABLED
Handler threw CapabilityException400/500handler-defined error code
Unauthorized403FORBIDDEN

MetaOne Platform Documentation