create_endpoint
Creates a new API endpoint doc (page type 4, draft) as the last child of the given page. Requires READ_WRITE permission. Publish it afterwards with Update Endpoint State (parent page must be published). Body fields:
name (string, optional) - Endpoint title shown in docs. urlName (string, optional) - URL slug; derived from name if omitted and made unique. requestType (string, optional) - HTTP method: GET, POST, PUT, PATCH, DELETE, etc. URL (string, optional) - Request URL (may contain {{variables}}). description (string, optional) - Endpoint description (HTML/text). body (object, optional) - Request body definition, e.g. {"type":"JSON","raw":{"rawType":"JSON","value":"{...}"}}; type can be none, JSON, TEXT, XML, HTML, multipart/form-data, application/x-www-form-urlencoded. headers (object, optional) - Headers keyed by name: {"Authorization":{"checked":"true","value":"Bearer {{token}}","description":""}}. params (object, optional) - Query params keyed by name, same shape as headers. pathVariables (object, optional) - Path variables keyed by index: {"0":{"checked":"notApplicable","key":"id","value":"","description":"Payment id"}}. bodyDescription (object, optional) - Per-field body docs: {"amount":{"value":100,"type":"number","description":"Amount in cents"}}. sampleResponse (array, optional) - Sample responses: [{"title":"Success","status":200,"description":"","data":{...}}]. authorizationData (object, optional) - Auth config object (or null). preScript (string, optional) - Pre-request JavaScript. postScript (string, optional) - Post-response test JavaScript. docViewData (array, optional) - Order of doc sections, e.g. [{"type":"host"},{"type":"body"},...]; default set if omitted. state (number, optional) - 0 pending, 1 draft (default), 2 approved, 3 rejected. Use Update Endpoint State to publish. uniqueTabId (string, optional) - Optional browser tab id used only to suppress the realtime socket echo to the calling tab; agents can omit it. POST https://api.docstar.io/orgs/:orgId/pages/:pageId/endpoints
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"orgId": "<orgId>",
"pageId": "<pageId>"
},
"name": "create_endpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| URL | No | e.g. https://api.example.com/v1/payments/:customerId | |
| body | No | e.g. {"type":"JSON","raw":{"rawType":"JSON","value":"{\"amount\":100,\"currency\":\"USD\"}"}} | |
| name | No | e.g. Create Payment | |
| orgId | Yes | The orgId path variable | |
| pageId | Yes | The pageId path variable | |
| params | No | e.g. {"currency":{"checked":"true","value":"USD","description":"ISO currency code"}} | |
| headers | No | e.g. {"Content-Type":{"checked":"true","value":"application/json","description":""}} | |
| description | No | e.g. Creates a payment for a customer | |
| requestType | No | e.g. POST | |
| pathVariables | No | e.g. {"0":{"checked":"notApplicable","key":"customerId","value":"","description":"Customer id"}} | |
| sampleResponse | No | e.g. [{"title":"Success","status":200,"description":"","data":{"id":"pay_1","status":"created"}}] |