Skip to main content

API integrations declare an external HTTP API in YAML, so functions and flows can call it as conv.api.<name>.<operation>(…) instead of hand-rolling request code.

Location

All integrations for the project live in this one file, listed under the api_integrations key. The file is optional — omit it if the project makes no external HTTP calls.

What an API integration contains

Identity

A name (the runtime namespace) and an optional description.

Environments

Separate base URL and auth type per sandbox, pre-release, and live.

Operations

The HTTP endpoints exposed as callable methods.

Fields

Environments

Each integration configures sandbox, pre-release, and live separately, so you can point at a staging API in sandbox and promote to production without touching code: Credentials themselves are managed by Agent Studio, not stored in the YAML — see Usage below.

Operations

Each entry is one HTTP endpoint: The optional fields are omitted from the file when empty, and removing one from the file clears it in Agent Studio on the next push. Schemas are nested YAML, not JSON strings, so quote values YAML would otherwise type for you: type: "null", a pattern or const that looks like a date or a number. Schemas written in Agent Studio or imported from an OpenAPI document pull down unchanged and push back as they were.

Example

Usage

  • Calling an operation — conv.api.<api_name>.<operation_name>(...) from a function or flow. Path variables can be passed positionally or as keyword arguments.
  • Return value — a requests.Response-like object; use .status_code, .text, and .json() as normal.
  • Extra request data — pass params, json, headers, etc. as keyword arguments, same as a standard HTTP client.
  • Authentication — configured per environment at the API level; credentials are managed by Agent Studio and never appear in the YAML or in function/flow code.

Validation

  • name is required, at least 2 characters, and must match ^[a-z_][a-z0-9_]*$.
  • Each integration name must be unique.
  • Each environment’s base_url must be a valid http(s):// URL, or empty.
  • base_url cannot be empty when auth_type is not none.
  • auth_type must be one of none, basic, apiKey, oauth2, oauth2_client_credentials, jwt_client_assertion.
  • Every operation needs a name matching ^[a-z_][a-z0-9_]*$, a method from the supported set, and a resource path matching a valid URL-path pattern (optionally with {param} placeholders).
  • Each operation name must be unique within its integration.
  • An operation’s description is at most 1000 characters.
  • Header names are HTTP tokens (letters, digits and !#$%&'*+-^_`|~), unique ignoring case, and never Authorization or Host. Values are text, so quote one YAML would otherwise read as a number, date, list or mapping (X-Version: '1.10'); true and false are sent as written. Values are ASCII with no line breaks or control characters, don’t start or end with a space, and are at most 4096 characters. An operation has at most 50 headers.
  • Each schema is a mapping that passes the JSON Schema 2020-12 meta-schema, nests objects and arrays at most 64 levels deep, and is at most 64 KB as compact JSON. A $schema keyword, if present, must be https://json-schema.org/draft/2020-12/schema.
  • request_body_schema is not allowed on GET or DELETE operations.
  • response_schemas keys match ^([1-5]\d{2}|[1-5]XX|default)$.
  • schema_source is one of default, manual, observed, openapi.
  • $ref, $id and $schema values must be valid URIs. The ADK does not check this locally; Agent Studio refuses them on push.
  • A pattern must compile as a JavaScript regular expression with the u flag. Agent Studio checks this on push; poly validate does not, since Python’s regex syntax differs.

Best practices

  • name operations for what they do (get_contact, not op1)
  • check response.status_code before trusting response.json() — a failed call still returns a response object
  • keep credentials in Agent Studio’s managed auth, never hard-coded in a function

Functions

Call API integrations from global functions, lifecycle hooks, and function steps.

Flows

Call API integrations from advanced-step and transition-function prompts.

Tests

Mock an operation’s response with api_mocks so a conversation that branches on it can be tested deterministically.
Last modified on November 27, 2026