Create a custom tool
create a custom tool.
POST
https://api.centerfy.ai/webhooks/inbound/custom-tools Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | authenticates the request; or Authorization: Bearer <key>. |
Content-Type | Yes | application/json | request body is JSON. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | tool display name; must be non-empty. Normalised before storage (lowercased, spaces → underscores). |
description | string | Yes | — | what the tool does; must be non-empty. |
url | string | Yes | — | the target endpoint URL the tool calls; must be non-empty. |
method | string | Yes | — | HTTP method; must be non-empty. Uppercased and must be one of: GET, POST, PUT, PATCH, DELETE (else 400). |
auth_required | boolean | No | — | whether the target endpoint requires auth. Set to true only when exactly true; defaults to false. |
api_key | string | No | — | secret credential for the tool’s target endpoint. Never echoed back (responses expose has_api_key only). Null if omitted. |
parameters | array | No | — | optional array of parameter objects { name:string, type:string, description:string, required:boolean }. If present, must be an array (else 400); defaults to []. |
Request body
{
"name": "Lookup Order",
"description": "Look up an order by id",
"url": "https://api.example.com/orders",
"method": "GET",
"auth_required": true,
"api_key": "sk_live_target_endpoint_secret",
"parameters": [
{
"name": "order_id",
"type": "string",
"description": "The order id",
"required": true
}
]
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/custom-tools" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Lookup Order",
"description": "Look up an order by id",
"url": "https://api.example.com/orders",
"method": "GET",
"auth_required": true,
"api_key": "sk_live_target_endpoint_secret",
"parameters": [
{
"name": "order_id",
"type": "string",
"description": "The order id",
"required": true
}
]
}' import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.customTools.create({
"name": "Lookup Order",
"description": "Look up an order by id",
"url": "https://api.example.com/orders",
"method": "GET",
"auth_required": true,
"api_key": "sk_live_target_endpoint_secret",
"parameters": [
{
"name": "order_id",
"type": "string",
"description": "The order id",
"required": true
}
]
});
console.log(result); centerfy customTools create '{"name":"Lookup Order","description":"Look up an order by id","url":"https://api.example.com/orders","method":"GET","auth_required":true,"api_key":"sk_live_target_endpoint_secret","parameters":[{"name":"order_id","type":"string","description":"The order id","required":true}]}' MCP tool: centerfy_custom_tools_create (see MCP server)
Response
{
"status": "success",
"created": true,
"custom_tool": {
"id": "a1b2c3d4-5555-6666-7777-888899990000",
"name": "lookup_order",
"description": "Look up an order by id",
"url": "https://api.example.com/orders",
"method": "GET",
"auth_required": true,
"has_api_key": true,
"parameters": [
{
"name": "order_id",
"type": "string",
"description": "The order id",
"required": true
}
],
"created_at": "2026-06-12T10:00:00.000Z",
"updated_at": "2026-06-12T10:00:00.000Z"
}
}Errors
400— if name, description, url, or method is missing or blank, the method is not in the allowed set, or parameters is not an array.500— on failure.
Notes
Creates the tool UNASSIGNED — attach it to an agent separately. Returns 201 on success.