PlaybookRpc
PlaybookRpc provides the public RPC interface for listing, searching, reading, creating, updating, deleting, and managing resource uploads for playbooks. The methods exposed here are JSON-RPC style endpoints invoked through POST /api/rpc.
Endpoints
POST /api/rpc (Method: PlaybookRpc.list)
Description: List all playbooks available to the current subscription.
Request Body:
{ "method": "PlaybookRpc.list", "params": { "tags": ["example"], "limit": 50, "page": 1, "pageSize": 20, "filter": {}, "sort": {} } }Parameters:
Name Type Required Description tagsString[]No Optional tag filter. When omitted, the method also checks filter.tagsif present.limitNumberNo Maximum number of playbooks to return. pageNumberNo Accepted by the schema for RpcDataProvider-style calls, but not used by the method implementation. pageSizeNumberNo Used as a fallback for limitwhenlimitis not provided.filterObjectNo Accepted by the schema for RpcDataProvider-style calls. The implementation reads filter.tagswhentagsis not provided.sortObjectNo Accepted by the schema for RpcDataProvider-style calls, but not used by the method implementation. Response:
{ "success": true, "data": { "data": [], "totalCount": 0 } }The
dataarray contains the results returned by the underlying playbook listing logic.totalCountis set to the number of returned results.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.list", "params": { "tags": ["example"], "limit": 50 } }'
POST /api/rpc (Method: PlaybookRpc.search)
Description: Search playbooks by keyword and/or tags.
Request Body:
{ "method": "PlaybookRpc.search", "params": { "query": "demo", "tags": ["example"], "limit": 10 } }Parameters:
Name Type Required Description queryStringNo Optional search keyword. tagsString[]No Optional tag filter. limitNumberNo Optional result limit. Response:
{ "success": true, "data": { "data": [], "totalCount": 0 } }The
dataarray contains the matched playbooks.totalCountis set to the number of returned results.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.search", "params": { "query": "demo", "tags": ["example"], "limit": 10 } }'
POST /api/rpc (Method: PlaybookRpc.findById)
Description: Get a single playbook by ID.
Request Body:
{ "method": "PlaybookRpc.findById", "params": { "_id": "playbook-id" } }Parameters:
Name Type Required Description _idStringYes The playbook identifier. Response:
{ "success": true, "data": { "_id": "playbook-id" } }The method returns the playbook object when found. If no playbook exists for the provided ID, it throws an error with the message
Playbook <id> not found.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.findById", "params": { "_id": "playbook-id" } }'
POST /api/rpc (Method: PlaybookRpc.create)
Description: Create a new playbook.
Request Body:
{ "method": "PlaybookRpc.create", "params": { "...": "fields defined by the playbook schema" } }Parameters:
The request body is validated by
PlaybookSchemawith_id,subscriptionId,source,createdAt, andupdatedAtomitted. The exact writable fields are defined by that schema and are not fully visible in this file.Name Type Required Description dataObjectYes Playbook fields accepted by the schema after omitting the system-managed fields. Response:
{ "success": true, "data": {} }The method returns the result of the underlying playbook creation logic.
Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.create", "params": { "...": "fields defined by the playbook schema" } }'
POST /api/rpc (Method: PlaybookRpc.update)
Description: Update an existing playbook.
Request Body:
{ "method": "PlaybookRpc.update", "params": { "_id": "playbook-id", "data": {} } }Parameters:
Name Type Required Description _idStringYes The playbook identifier. dataObjectYes Update payload passed through to the underlying playbook update logic. Response:
{ "success": true, "data": {} }The method returns the result of the underlying playbook update logic.
Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.update", "params": { "_id": "playbook-id", "data": { "title": "Updated title" } } }'
POST /api/rpc (Method: PlaybookRpc.delete)
Description: Delete a playbook.
Request Body:
{ "method": "PlaybookRpc.delete", "params": { "_id": "playbook-id" } }Parameters:
Name Type Required Description _idStringYes The playbook identifier. Response:
{ "success": true, "data": {} }The method returns the result of the underlying playbook deletion logic.
Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.delete", "params": { "_id": "playbook-id" } }'
POST /api/rpc (Method: PlaybookRpc.getResourceUploadKey)
Description: Get an upload key for uploading resource files to a playbook.
Request Body:
{ "method": "PlaybookRpc.getResourceUploadKey", "params": { "playbookId": "playbook-id" } }Parameters:
Name Type Required Description playbookIdStringYes The playbook identifier used when requesting the upload key. Response:
{ "success": true, "data": {} }The method returns the result of the underlying upload-key generation logic.
Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "PlaybookRpc.getResourceUploadKey", "params": { "playbookId": "playbook-id" } }'
POST /api/rpc (Method: PlaybookRpc.finalizeResourceUpload)
Description: Finalize resource upload — attach uploaded files to the playbook record.
Request Body:
{ "method": "PlaybookRpc.finalizeResourceUpload", "params": { "playbookId": "playbook-id", "uploadKey": "upload-key" } }Parameters:
Name Type Required Description playbookIdStringYes The playbook identifier that will receive the uploaded file records. uploadKeyStringYes The upload key used to finalize the pending file upload. Response:
{ "success": true, "data": { "success": true, "added": 0 } }If the finalized upload contains no files, the method returns
{ success: true, added: 0 }. When files are present, it appends resource records to the playbook and returns{ success: true, added: <number>, files: [...] }, where thefilesarray contains normalized resource entries withfileId,fileName,mimeType, andsize.**Example (cURL):