Guest Machines
API referenceAgents

Create an agent

POST/api/v1/agents

Create a private agent owned by the user represented by the delegated token. The response returns the complete saved configuration, including its initial revision and digest.

Required access

Credentials: delegated token, user session

Scope: agents:create

The delegated user must be an active non-viewer member of the selected organization. Service-principal keys cannot create an agent because they have no user identity to own it.

Authorization

DelegatedToken
AuthorizationBearer <token>

A token issued to an external application acting for a specific user, prefixed gsmc_dt_. Carries that user's identity for attribution and ownership, and stays capped at member role however privileged the user is.

In: header

Header Parameters

X-Org-Id?|

Selects the active organization for a credential that belongs to more than one. Service-principal keys are bound to a single organization and ignore it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for creating an agent.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/agents" \  -H "Authorization: Bearer $GUEST_MACHINES_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "release_auditor",    "description": "Checks a release candidate for blocking defects.",    "model": "claude-sonnet-4-6",    "system_prompt": "Return only evidence-backed release blockers.",    "thinking_level": "medium",    "configured_tools": [      {        "origin": "builtin",        "source_id": "search_knowledge_semantic"      }    ],    "visibility": "private"  }'
{  "agent": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "owner_user_id": "65139110-7c3c-4777-b692-80c218be3b9d",    "visibility": "org_shared",    "name": "string",    "description": "string",    "executor_type": "claude",    "model": "string",    "system_prompt": "string",    "thinking_level": "none",    "temperature": 0.1,    "execution_environment": "guest_vm",    "computer_use_enabled": false,    "environment_config": {},    "input_schema": {},    "output_schema": {},    "is_active": true,    "auto_respond": false,    "owning_team_id": "1e618706-c399-4dc7-864c-009ddf950b84",    "allowed_invocables": [      "string"    ],    "knowledge_scope": {      "folder_ids": [        "c9c54c2c-7793-4b70-8b93-7e3771bbc0c0"      ],      "file_ids": [        "1c0f12fe-c5bf-4fbd-ba1b-466cb232eca5"      ]    },    "avatar_blob_name": "string",    "avatar_sas_url": "string",    "avatar_expires_at": "2019-08-24T14:15:22Z",    "configured_tools": [      {        "origin": "builtin",        "source_id": "string",        "canonical_name": "string",        "display_name": "string",        "enabled": true,        "owned_by_caller": true      }    ],    "hidden_configured_tool_count": 0,    "allowed_tools": [      "string"    ],    "mcp_server_ids": [      "6645753c-0a13-4667-8dd3-d80a8e4fd76f"    ],    "tool_approval_modes": {      "property1": "auto",      "property2": "auto"    },    "unattended_preapproved_tools": [      "string"    ],    "config_revision": 0,    "config_digest": "0000000000000000000000000000000000000000000000000000000000000000",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}