API Action
An API Action calls an HTTP or HTTPS endpoint when the agent uses the tool. Send the common tool fields and the applicable fields below.
| Field | Type | Required | Description |
|---|---|---|---|
method | string | Yes | GET, POST, PUT, PATCH, or DELETE. |
url | string | Yes | An HTTP or HTTPS URL. Use {placeholders} for dynamic path values, such as /orders/{orderId}. For dynamic query values, use either a URL placeholder, such as ?limit={limit}, or the queryParams field. Fixed query values such as locale=en are sent as written. |
auth | object | No | Chooses how the Action authenticates to the endpoint. |
inputSchema | object | No | Defines dynamic inputs. Omit it if the Action has no inputs. See Describing inputs. |
queryParams | string[] | No | Names of inputSchema.properties fields to send as query parameters without adding placeholders to the URL. For example, with URL /orders, ["limit"] sends the limit field under the query key limit. You can omit queryParams for fields already referenced by URL query placeholders. |
auth value | Result |
|---|---|
{ "type": "existing", "apiConnectionId": "..." } | Uses a bearer connection from your organization. Its origin must match the URL. |
{ "type": "bearer", "token": "..." } | Creates a bearer connection. |
| Omitted | Calls the endpoint without authentication. |
{
"type": "api_action",
"label": "Get order status",
"assistantUseDescription": "Look up an order once the visitor provides the order ID and what details to include.",
"method": "GET",
"url": "https://example.com/orders/{orderId}?include={detail}&locale=en",
"inputSchema": {
"type": "object",
"properties": {
"orderId": {
"type": "string",
"description": "The order number shown on the receipt."
},
"detail": {
"type": "string",
"description": "The details the visitor wants to see, such as shipping or items."
}
},
"required": ["detail"]
}
}
How inputs are sent
Add a field to inputSchema.properties for every value the agent supplies, whether it goes in the URL path, the query string, or the JSON body. Give each field a type and a description that tells the agent what value to provide. Path and query inputs must be top-level primitive fields.
Use a URL placeholder when the agent needs to supply a value that can change from one call to the next. For a dynamic path value, put the placeholder where the value belongs, as in /orders/{orderId}. For a dynamic query value, add a placeholder after =, as in ?include={detail}, or leave it out of the URL and list the field in queryParams.
Use the name inside the braces as the field name in inputSchema.properties. In /orders/{orderId}?include={detail}, define orderId and detail. The Action puts orderId in the path and sends detail under the query key include. Leave fixed query values such as locale=en directly in the URL.
| Input | In the URL | Request configuration | Sent as | Required |
|---|---|---|---|---|
| Path value | /orders/{orderId} | Define orderId in inputSchema.properties. | Path segment | Always required |
| Query value from a placeholder | ?include={detail} | Define detail in inputSchema.properties. | include=<value> | Only if listed in required |
| Query value without a placeholder | None | Define limit in inputSchema.properties and set queryParams to ["limit"]. | ?limit=10 if the agent supplies 10 | Only if listed in required |
| JSON body field | None | Define note in inputSchema.properties. | JSON body, including for GET and DELETE | Only if listed in required |
| Fixed query value | ?locale=en | None | As written | N/A |
Values supplied by the agent that are outside the path and query inputs go in the JSON body.
Examples
Use the common tool fields from the main example. Each snippet highlights the relevant schema fields and any additional configuration.
Use a non-string path input. For /orders/{orderId}, define the ID as an integer.
{
"inputSchema": {
"type": "object",
"properties": {
"orderId": {
"type": "integer",
"description": "The order number shown on the receipt."
}
}
}
}
Limit the allowed values for an optional query input. For ?include={detail}, this schema allows shipping or items. The Action omits include when the agent supplies no value.
{
"inputSchema": {
"type": "object",
"properties": {
"detail": {
"type": "string",
"description": "The extra details the visitor wants to see.",
"enum": ["shipping", "items"]
}
}
}
}
Add a query input without a placeholder. For /orders, send limit as a query value using queryParams.
{
"queryParams": ["limit"],
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "The maximum number of orders to return."
}
}
}
}
Send a JSON body. For a POST to /orders/{orderId}/notes, send note in the JSON body.
{
"inputSchema": {
"type": "object",
"properties": {
"orderId": {
"type": "string",
"description": "The order number shown on the receipt."
},
"note": {
"type": "string",
"description": "The note the visitor wants to add to the order."
}
},
"required": ["note"]
}
}
Describing inputs with inputSchema
API Actions and Website UI tools use inputSchema to describe the values the agent supplies. The schema must have "type": "object" at the root. Field descriptions are required. Use each field's description to tell the agent what value to supply.
The supported keywords are type, properties, required, description, items, enum, and additionalProperties.
- Objects can contain nested objects and fields declared in
properties. List mandatory fields inrequired. - Field types include strings, numbers, integers, booleans, objects, and arrays. Enums support string choices. Primitive fields and string enums can also be nullable.
- Arrays use a single
itemsschema that applies to every element. For example,{ "type": "array", "items": { "type": "string" } }describes an array of strings. Positional schemas that assign different types to different array elements are unsupported. - Extra properties are disabled by default. Set
"additionalProperties": trueon an object to allow undeclared keys with any JSON value inside that object. The resulting schema preserves explicittrueand usesfalsewhen the setting is omitted. A schema as the value ofadditionalPropertiesis unsupported.
The API rejects other JSON Schema keywords, including $ref and $defs for references, oneOf, anyOf, and allOf for combining schemas, and constraints such as pattern, minLength, minimum, and maximum.
Tool creation response
Tool creation returns 201 Created with data.id, data.agentId, data.skillId, data.type, data.label, and data.toolName. Knowledge tools also return data.vectorStoreIds.
| Status | Meaning |
|---|---|
400 | Invalid input, an unavailable vector store or connection, or the Skill has reached its tool limit. |
401 | The PD access token or delegated OAuth token is missing or invalid. |
403 | The delegated OAuth token lacks pd:write. |
404 | The Skill is unavailable on the specified agent in the token's organization. |
409 | For Knowledge uploads, a request with the same idempotency key is still processing. |
413 | For Knowledge uploads, a file exceeds 20 MiB. |
429 | The request exceeded the rate limit. |