Skip to content
Skip to Content
Coder Docs

Authenticate agent on Google Cloud instance

POST
/api/v2/workspaceagents/google-instance-identity

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Request Body

Instance identity token. The optional agent_name field disambiguates when multiple agents share the same instance ID.

application/json
  1. body
agent_name?string

AgentName optionally selects a specific agent when multiple agents share the same instance identity. An empty string is treated as unspecified.

json_web_token*string

Response Body

OK

application/json
  1. response
session_token?string

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/workspaceagents/google-instance-identity" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "json_web_token": "string"}'
Example Response200
{  "session_token": "string"}