Self-Service docs

Build

API Reference & Configuration

Rendered from Agentic-ai-self-service/docs/API_REFERENCE.md

Every API endpoint the platform exposes, plus deploy-time configuration variables, Lambda environment variables, and SSM parameters.

← Back to README

API Endpoints

Workflow Management

MethodEndpointDescription
GET/healthHealth check
POST/api/workflowsCreate workflow
GET/api/workflows/{id}Get workflow
PUT/api/workflows/{id}Update workflow
DELETE/api/workflows/{id}Delete workflow
POST/api/workflows/{id}/validateValidate workflow
POST/api/workflows/importImport workflow JSON
GET/api/workflows/{id}/exportExport workflow JSON

Deployment

MethodEndpointDescription
POST/api/deployStart deployment (returns 202 with deployment_id, status, and message; the Step Functions execution ARN is operator-only state). config.platformVersion ("V1" | "V2", default absent = V1) selects the AgentCore Runtime platform version; "V2" is refused with 400 (422 for an explicit targetRegion) where AWS does not document it (London, Paris). gatewayTools: ["web_answer"] adds the AWS-managed Web Answer connector and is refused the same way outside us-east-1. policyConfig.guardrails.profile ("off" | "standard" | "strict", default absent = off) adds Bedrock Guardrails evaluated by Policy in AgentCore on every tool call's string arguments; refused the same way where AWS lacks guardrails in policies (Ireland, Frankfurt, Paris), for an unknown profile, for a disabled policy engine, and (strict) for a canvas with a tool that cannot be screened
GET/api/deploy/{deployment_id}Get the caller-owned deployment status; includes derived public runtime_name and excludes internal authority/credential leaves
GET/api/deploymentsList caller-owned deployments with the same public shape and derived runtime_name used by production-slot chat
POST/api/test-runtimeTest a deployed agent with a prompt (supports session_id for conversation context). Also the invoke path for an adopted runtime (runtimeId from POST /api/runtime/import); the slot routes answer 404 for one
POST/api/runtime/importAdopt an AgentCore Runtime this platform did not build ({"runtimeArn", "awsRegion"?}, scope agent:write). Describes it, records a caller-owned SUCCEEDED deployment with imported: true, creates no AWS resource; 201 {deploymentId, runtimeId, runtimeArn, status, imported}, 400 for a non-runtime ARN, 404 when it cannot be described, 409 when another user already adopted it. scripts/import/openai_agents_sdk.py uses it for OpenAI Agent Builder exports (see Migrate from OpenAI Agent Builder (opens in new tab))
DELETE/api/runtime/{id}Delete runtime + gateway + Cognito + Lambda (full cleanup). For an adopted runtime the default only releases the platform's record and leaves the runtime running; ?destroy=true opts into destroying it, which still requires the platform's live ownership proof
POST/api/generate-toolAI Tool Generator -- generate Lambda code from natural language via Claude Sonnet
POST/api/generate-cfn-templateGenerate downloadable CloudFormation stack (template YAML + deploy scripts + code artifacts)

Deployment targets

MethodEndpointDescription
GET/api/deploy-targetsRead-only deployer catalog. Returns account/Region choices and production_promotion_supported; never returns IAM role or KMS key ARNs.
GET/api/admin/deploy-targetsAdmin configuration including validated artifact bucket, execution-role, and evaluation_kms_key_arn authority.
POST/api/admin/deploy-targets/regionsRegister a same-account Region. Requires region, evaluation_kms_key_arn, and an optional artifact_bucket.
POST/api/admin/deploy-targets/accountsRegister a cross-account target. Requires account_id, fixed deployment role_arn, region, and evaluation_kms_key_arn; execution roles and artifact bucket may be overridden.

Registration accepts only a full target-Region customer-managed KMS key ARN. The backend verifies account, Region, enabled state, symmetric ENCRYPT_DECRYPT usage, and the default key policy's target-account and scoped bedrock-agentcore.amazonaws.com grants. It reads metadata and policy only—no key material. Target rows created before this field existed remain visible to admins but are not deployable until re-registered. New deployment and version rows freeze the exact ARN; promotion refuses missing or disagreeing authority.

CloudFormation export naming and tags

POST /api/generate-cfn-template accepts these optional governance fields in the normal DeployRequest body:

{
  "resourceTags": {
    "CostCentre": "ECB-42"
  },
  "tagProfile": "regulated-production",
  "namingProfile": {
    "prefix": "ecb",
    "resourceNames": {
      "gateway": "{prefix}-{deployment}-gw",
      "runtime": "{prefix}_{deployment}_agent"
    }
  }
}

tagProfile is resolved server-side and merged with resourceTags; the emitted template contains concrete tags, not a platform profile reference. namingProfile is CloudFormation-only: /api/deploy and /api/export-python return 400 if it is sent, preventing a naming request from being silently discarded.

The prefix must match ^[a-z][a-z0-9]{0,11}$. Override templates use {prefix} and {deployment}; component families require {component}, while stack-unique domains, vector buckets, and IAM roles require {suffix}. The complete family list and coupling behavior are documented in Deployment Internals.

With a profile, DeploymentName is limited to 20 lowercase alphanumeric characters and long user-controlled components receive a deterministic hash suffix before they can exceed an AWS name limit. Without a profile, the legacy physical-name formulas remain unchanged, but each exported template publishes a component-specific DeploymentName.MaxLength derived from the names it actually emits. This prevents a value that passes parameter validation from failing later at an AWS service boundary.

Legacy explicit IAM role names include the CloudFormation stack name, which is a separate input from DeploymentName. The generated deploy.sh automatically uses CloudFormation-generated role names when a stack name exceeds the emitted safe limit (currently 47 characters), and fails early if explicit names are forced. A direct CloudFormation or Terraform consumer must set UseExplicitRoleNames=false for a stack name beyond the limit stated in that bundle.

Full component templates can exceed CloudFormation's 51,200-byte inline body limit. The generated script stages template.yaml with --s3-bucket; Terraform consumers must upload it and use aws_cloudformation_stack.template_url, not template_body = file(...). They must also stage the ZIPs in the download and pass the corresponding artifact keys and digests. The generated README contains the per-bundle parameter table and a minimal HCL wrapper.

Live-deploy credential and customer-resource authorization

POST /api/deploy treats every caller-supplied AWS ARN or resource ID as inventory, not as permission to use that resource.

  • Model-provider and per-canvas OTEL source secrets must be complete Secrets Manager ARNs in their approved namespace and carry this platform stack's exact ownership tag plus the authenticated caller binding. The platform-default OTEL source is read only from operator-controlled configuration. In both cases the raw value is copied into a new agentcore-connector/* secret in the selected deployment account and region. Only that deployment-bound copy is placed in Step Functions input or granted to the runtime; the long-lived source is not granted to the runtime or deleted with the deployment.
  • A customer-owned resource used by a Knowledge Base must opt in with AgentCoreFlowsAccess=allow. This applies to an existing Knowledge Base, S3 data bucket, S3 Vectors bucket/index, OpenSearch Serverless collection/index, Aurora cluster, transformation Lambda, KMS key, and Knowledge Base credential source secret. Account, region, and ARN resource family are also checked where the service exposes them.
  • OwnerSubHash is optional. When present, it must equal the first 32 hex characters of SHA-256 over the intended caller's Cognito sub; omitting it makes the opt-in intentionally shared among authenticated users of this platform stack.
  • Customer Knowledge Base credential values are copied into the same deployment-bound target-secret lifecycle before Step Functions starts. The customer source ARN never reaches the Bedrock service role.
  • Resources created by the platform use a stricter proof: exact stack, deployment, and caller tags. A same-name conflict that cannot prove that binding aborts rather than being adopted or modified.

This contract is for the platform's live Step Functions deployment path. A downloaded CloudFormation bundle is a customer-owned artifact and is governed by the IAM roles and parameters in the account where the customer deploys it.

Flows

MethodEndpointDescription
POST/api/flowsCreate flow
GET/api/flowsList caller's flows
GET/api/flows/{flow_id}Get flow
PUT/api/flows/{flow_id}Update flow
DELETE/api/flows/{flow_id}Delete flow

Observability

MethodEndpointDescription
GET/api/observability/platform-defaultsReturns {enabled, endpoint, sample_rate} so the UI can render the Observability node read-only when platform OTEL is configured. Never returns the secret ARN.

Platform configuration (feature flags)

MethodEndpointDescription
GET/api/config/featuresEvery feature flag this build knows with its resolved value: {features: {name: bool}, source: "ssm"|"env"|"missing"|"invalid"|"error", parameter, ignored: [keys the backend did not honour], ttlSeconds, refreshedAt, descriptions}. A flag is on only for literal JSON true under a known name in the SSM parameter /agentcore-workflow/{env}/platform-features; a missing parameter, an SSM error, a non-JSON value, an unknown key or a non-boolean value all mean off. Requires agent:read (every builder). Cached per Lambda container for ttlSeconds (60).
GET/api/config/features/canarySelf-test behind the platformFlagsCanary flag: returns the same 404 {"detail": "Not Found"} as a nonexistent route while the flag is off (to every caller, before the scope check), 200 {"canary": "enabled", "flag": "platformFlagsCanary"} once it is on. Flip it to prove an environment's flag plumbing end to end; it gates no product feature.

Operators flip a flag with aws ssm put-parameter --name /agentcore-workflow/<env>/platform-features --type String --overwrite --value '{"platformFlagsCanary": true}'; it lands within the TTL, no redeploy. Flagged-off backend routes are declared with Depends(require_feature("<flag>")) placed before require_scopes, and the UI hides the surface with useFeatureFlags() / <FeatureGate>; the backend 404 is the control, the UI is a courtesy. | POST | /api/observability/credentials | Stores OTLP auth credentials in Secrets Manager and returns the secret ARN. |

Versioning & Slots

MethodEndpointDescription
POST/api/runtimes/{name}/invokeStable external client alias; invokes only the owner-checked production slot and rejects target/slot authority in the body
GET/api/runtimes/{name}/versionsList a runtime's version history (newest first), including its frozen release policy and attested evidence
GET/api/runtimes/{name}/slotsGet the production / staging slot pointers
POST/api/runtimes/{name}/versions/{version_id}/promotePromote to staging, or to production only when required evidence is fresh and valid
POST/api/runtimes/{name}/rollbackRestore the exact previous production version (the emergency rollback path does not depend on a new evaluation)

Evaluation, Cost & Observability (runtime-scoped)

MethodEndpointDescription
GET/api/runtimes/{name}/evaluation-configRegistered Online Evaluation config (evaluator IDs + sampling rate)
GET/api/runtimes/{name}/evaluations?hours=Per-evaluator score time-series from CloudWatch Logs Insights
POST/api/runtimes/{name}/versions/{version_id}/promotion-evaluation/startStart an idempotent AgentCore batch evaluation from exact session IDs and ground truth; evaluator policy is server-owned
GET/api/runtimes/{name}/versions/{version_id}/promotion-evaluation/{batch_id}Read bounded batch status after proving the batch source targets this version's runtime
POST/api/runtimes/{name}/versions/{version_id}/promotion-evaluation/attestVerify a completed batch and conditionally record one immutable evidence document
GET/api/runtimes/{name}/versions/{version_id}/promotion-evidenceRead the frozen policy and current owner-checked release evidence
GET/api/runtimes/{name}/dashboard-urlDeep link to the auto-generated CloudWatch dashboard
GET/api/runtimes/{name}/cost?from=&to=Token + estimated-cost rollup by model for the window

Invocation authorization (owner/agent/tag scoped)

MethodEndpointDescription
GET/api/cost/budgetsList caller-visible monthly limit definitions
POST/api/cost/budgetsCreate/update {scope, key, limit_usd, warn_pct}; owner scope is always rebound to the authenticated caller
DELETE/api/cost/budgets/{scope}/{key}Delete an owned definition; a foreign row remains indistinguishable from missing (404)

Production-mediated invocation operations require at least one applicable definition. A bounded MCP handshake and tool call consume one operation. Owner, agent, and matching tag limits are condition-checked and reserved in one DynamoDB transaction. Exhausted capacity returns 429 with Retry-After: 3600; unavailable storage returns 503 before dispatch. The cost response's owner_budget includes authorized, reserved, committed, remaining_authorization, reservation_unit, authorization_scope="platform-mediated-invocation-operation", and is_actual_cost_cap=false. Those USD-denominated values authorize dispatches; they are not reconciled AWS charges or an account-level spending guarantee.

Triggers (runtime-scoped)

MethodEndpointDescription
POST/api/runtimes/{name}/triggersProvision an active cron / eventbridge / s3 / webhook trigger against the exact owned production deployment; webhook creation returns its signing secret once
GET/api/runtimes/{name}/triggersList the runtime's trigger lifecycle state and provisioned public handles
DELETE/api/runtimes/{name}/triggers/{id}Stop and delete the trigger's platform-owned resources and webhook HMAC secret

Cron, EventBridge, and S3 triggers create stack-tagged EventBridge rules that send version-pinned invocation envelopes through the platform's durable SQS queue and DLQ. Webhooks use a static HMAC-authenticated route. A first delivery returns 202 with duplicate=false after SQS acceptance; the same valid delivery ID returns 202 with duplicate=true without another enqueue. The marker binds the ID to the request-body SHA-256; reusing it for different authenticated bytes returns 409. A concurrent in-flight request returns 409 plus Retry-After: 1; a crashed ingress lease can be taken over after 60 seconds. Queued ingress markers and completed worker markers expire after seven days, and worker-side transactional dedup remains the safety net for an ambiguous SQS send. Optional result callbacks are HTTPS-only, network filtered, DNS-rebinding resistant, and do not follow redirects. S3 triggers require EventBridge notifications to be enabled on each source bucket.

Agent Registry

MethodEndpointDescription
POST/api/registryPublish an agent blueprint (enters pending review)
GET/api/registry?q=&tag=&scope=all|mine|public|pendingSearch/list visible entries (admins can list pending)
GET/api/registry/{slug}Get one entry (visibility/approval-checked, 404 if not visible)
POST/api/registry/{slug}/cloneClone an approved/own entry's canvas to the caller
PUT/api/registry/{slug}Update metadata (owner only; non-admin edit resets to pending)
DELETE/api/registry/{slug}Delete (owner or registry-admin)
POST/api/registry/{slug}/approveAdmin only — approve a pending entry (403 otherwise)
POST/api/registry/{slug}/rejectAdmin only — reject with optional reason (403 otherwise)

AWS Agent Registry federation (opt-in)

Federates deployed agents into the AWS Agent Registry — a GA AWS service in its own right (it is no longer part of bedrock-agentcore). Requires the backend to run boto3 >= 1.43.66, the first release carrying the agent-registry service models, and the agent-registry:* IAM actions.

MethodEndpointDescription
GET/api/registry/aws-configFederation status: {enabled, registry_id, available, sdk_supported}
POST/api/registry/aws-configAdmin only — enable federation with a registry_id (reachability validated before persisting)
GET/api/registry/aws-search?q=Discovery search across the registry (SearchDiscoverableRegistryRecords)

sdk_supported: false means this deployment's boto3 predates the GA API, so no agent-registry client can be built — a redeploy, not a configuration change. POST returns 400 naming the SDK in that case rather than blaming the registry_id.

LiteLLM as the catalog backend (opt-in)

Makes a LiteLLM proxy the authoritative catalog in place of the internal DynamoDB one. Additive: the default backend is dynamodb and nothing above changes until an admin activates this. See Registry & RBAC.

MethodEndpointDescription
GET/api/registry/litellm-configActive backend + config: {provider, configured, base_url, api_key_ref, verified, capabilities} — never the key itself
POST/api/registry/litellm-configAdmin only — save {base_url, api_key, activate}; the key is minted into agentcore-registry/ and dropped
DELETE/api/registry/litellm-configAdmin only — revert to the platform catalog (DynamoDB entries were never touched)
GET/api/registry/litellm-serversThe MCP servers LiteLLM serves, with enablement. Returns {configured: false, servers: []} when LiteLLM is not configured — not an error

activate: false saves and probes the config without switching the catalog over, so reachability can be tested first. verified: false means the control plane could not probe the proxy — normal for a VPC-private LiteLLM, since the control plane has no VPC egress, and not an error.

Because LiteLLM has no write API for MCP server records, entries projected from LiteLLM are read-only: publish, update, delete, approve, reject and clone return 501 naming LiteLLM rather than silently accepting a write that would then diverge. Entries published from a canvas live in the platform sidecar and stay fully mutable — the limit is per entry, not per operation. capabilities (including read_only_sources) on GET /litellm-config is the machine-readable form of that. The pre-deploy governance gate stays fail-closed: if the catalog cannot be read, deploys referencing an integration return 503.

Prompt Library

MethodEndpointDescription
POST/api/promptsCreate a prompt (seeds v1)
GET/api/promptsList visible prompts
GET / PUT / DELETE/api/prompts/{name}Get / update / delete a prompt
POST/api/prompts/{name}/versionsAppend a new version
POST/api/prompts/{name}/promote/{version_id}Pin the default version
GET/api/prompts/{name}/resolve?version=Resolve {version_id, body} (used at codegen)

HITL, Connectors, Workspaces & GitOps

MethodEndpointDescription
GET/api/hitl/pendingCaller's pending human-approval queue
POST/api/hitl/{request_id}/decisionApprove / reject a pending approval
GET/api/connectorsList pre-built SaaS connector definitions
GET/api/connectors/{id}Connector tool + credential schema
POST/api/workflows/{id}/shareShare a workflow (viewer/editor; owner only)
DELETE/api/workflows/{id}/share/{sub}Revoke a share
GET/api/workspacesList workspace-visible workflows with effective role
POST/api/workflows/{id}/git-tokenStore a Git PAT (owner-scoped Secrets Manager)
POST/api/workflows/{id}/git-syncPull a workflow spec from Git (SSRF-guarded)

JIT permission requests

MethodEndpointDescription
POST/api/permissions/requestsRequest an exact action/resource widening on a non-shared AgentCore* role
GET/api/permissions/requests/pendingAdmin queue including recoverable PENDING and APPLYING rows
POST/api/permissions/requests/{id}/approveClaim a five-minute APPLYING lease, idempotently apply JIT-{id}, then finalize APPROVED
POST/api/permissions/requests/{id}/rejectConditionally reject only a PENDING request

An active approval lease makes concurrent approve/reject return 409. Definitive IAM refusal returns the row to PENDING; an ambiguous IAM outcome returns 502 with Retry-After: 300 and leaves APPLYING, preventing a false rejection until an admin reclaims and retries the same deterministic policy. Gateway/target/Cedar control-plane mutation actions are refused even when hidden behind an action wildcard.

NL Agent Generation & Code Export

MethodEndpointDescription
POST/api/generate-canvasNL description → validated canvas spec (Bedrock tool-use, clarify → generate)
POST/api/export-pythonDownload a standalone runnable Python agent project (presigned S3 zip)

Configuration

Deploy-time variables consumed by ./scripts/deploy.sh and passed as CDK context parameters to the infrastructure stack:

VariableDefaultDescription
ENVIRONMENT_NAMEdevEnvironment identifier (e.g., dev, staging, prod)
AWS_REGIONus-east-1Target AWS region
PROJECT_NAMEagentcore-workflowProject name used for resource naming and tagging
COGNITO_USERS(carried forward)Comma-separated emails for pre-created Cognito users (e.g., user1@example.com,user2@example.com). Users are created in NO group → no scopes → read-only until you assign a persona (see Registry & RBAC). Each email becomes a custom resource whose deletion deletes the Cognito user, so dropping an email is how you offboard someone. Because an omitted variable is indistinguishable from an intentionally emptied one, leaving it unset on a redeploy carries the already-provisioned users forward rather than deleting them — deploy.sh prints a warning naming them. Pass COGNITO_USERS=none to genuinely remove them all. A re-provisioned user gets a new emailed temporary password and loses their group memberships. This carry-forward lives in scripts/deploy.sh, so bypassing it — running npx cdk deploy or cdk diff directly — plans the deletion again; pass --context cognito_users=a@b.com,... yourself in that case.
OTEL_ENDPOINT(unset)OTLP HTTP endpoint for platform-level observability (e.g. https://cloud.langfuse.com/api/public/otel). When set, every platform Lambda + every deployed agent exports traces here. Per-canvas Observability nodes can still add resource attributes additively but cannot override the endpoint.
OTEL_AUTH_SECRET_ARN(unset)ARN of a Secrets Manager secret holding the precomputed Authorization header value (e.g. Basic <base64>). Created by scripts/bootstrap-otel-secret.sh. Required when OTEL_ENDPOINT is set.
OTEL_SAMPLE_RATE1.0Trace sampling ratio (0.0–1.0).
OTEL_SERVICE_NAME_PREFIX{PROJECT_NAME}Prefix prepended to service.name resource attribute on every span.

Environment Variables (Lambda)

VariableDescription
DEPLOYMENT_TABLE_NAMEDynamoDB table name for deployment state
WORKFLOWS_TABLE_NAMEDynamoDB table name for workflow definitions
STATE_MACHINE_ARNStep Functions state machine ARN for deployment orchestration
APP_AWS_REGIONAWS region for service calls
TOOL_GENERATOR_MODEL_IDClaude model ID for AI Tool Generator (default: us.anthropic.claude-sonnet-5)

SSM Parameters

Application configuration is stored under /agentcore-workflow/{env}/ in SSM Parameter Store:

ParameterDescription
/agentcore-workflow/{env}/cors-originsAllowed CORS origins
/agentcore-workflow/{env}/aws-regionAWS region
/agentcore-workflow/{env}/dynamodb-table-nameWorkflows DynamoDB table name
/agentcore-workflow/{env}/otel/endpointOTLP endpoint (when platform OTEL is configured)
/agentcore-workflow/{env}/otel/auth-secret-arnSecrets Manager ARN for the OTLP auth header
/agentcore-workflow/{env}/otel/sample-rateTrace sampling ratio
/agentcore-workflow/{env}/otel/service-name-prefixservice.name prefix
/agentcore-workflow/{env}/platform-featuresFeature flags: a JSON object of booleans, created as {} (every flag off) by the stack and then operator-managed with aws ssm put-parameter --overwrite. Only literal true under a flag name the deployed build knows turns a flag on; see Platform configuration (feature flags) above.
Back to top