CreateEndpointBody

Request body for creating an Endpoint.

Definition

TypeScript
interface CreateEndpointBody {
  apiId: string;
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
  path: string;
  handlerType: "function" | "workflow" | "agent" | "swarm";
  handlerId: string;
  auth?:
    | { kind: "public"; rateLimitPerMinute?: number | undefined }
    | { kind: "workspace_api_key" }
    | { kind: "oauth"; scope: string }
    | { kind: "event_signature"; secretSource: "secret_ref"; secretId: string }
    | undefined;
  cors?:
    | { allowOrigins: Array<string>; allowCredentials?: boolean | undefined }
    | undefined;
  timeoutSeconds?: number | undefined;
  enabled?: boolean | undefined;
}

Fields

FieldTypeNotes
apiIdstringrequired — Parent API.
method"GET" | "POST" | "PUT" | "PATCH" | "DELETE"required — HTTP method served at this path.
pathstringrequired — Path within the API (e.g. /orders/{id}). Path params use {name} syntax.
handlerType"function" | "workflow" | "agent" | "swarm"required — What kind of primitive handles this route (agent / function / workflow).
handlerIdstringrequired — ID of the handler (an agent, function, or workflow id).
auth{ kind: "public"; rateLimitPerMinute?: number | undefined; } | { kind: "workspace_api_key"; } | { kind: "oauth"; scope: string; } | { kind: "event_signature"; secretSource: "secret_ref"; secretId: string; } | undefinedoptional — Per-endpoint auth override. Falls back to the API's default when omitted.
cors{ allowOrigins: Array<string>; allowCredentials?: boolean | undefined; } | undefinedoptional — Per-endpoint CORS override. Falls back to the API's default when omitted.
timeoutSecondsnumber | undefinedoptional — Hard timeout in seconds (max 300). Defaults to 60.
enabledboolean | undefinedoptional — Whether the route accepts traffic. Defaults to true.