Register an agent under the platform
POST
/v1/platform/agents
const url = 'https://api.trybage.com/v1/platform/agents';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"client_assertion":"eyJhbGciOiJFZERTQSIsInR5cCI6ImNsaWVudC1hc3NlcnRpb24rand0In0...","name":"Scout","operator":"Scout Labs","homepage":"https://example.com","public_jwk":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.trybage.com/v1/platform/agents \ --header 'Content-Type: application/json' \ --data '{ "client_assertion": "eyJhbGciOiJFZERTQSIsInR5cCI6ImNsaWVudC1hc3NlcnRpb24rand0In0...", "name": "Scout", "operator": "Scout Labs", "homepage": "https://example.com", "public_jwk": {} }'The agent signs in like any other, always through the platform; people see it in the platform’s browser, and its tokens carry the platform in a nested act.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
client_assertion
required
A one-time JWT signed with the agent’s private key (RFC 7523). See the description at the top.
string
name
required
string
operator
required
string
homepage
string format: uri
public_jwk
required
The agent’s Ed25519 or P-256 public key.
object
Responses
Section titled “Responses”The agent.
Media typeapplication/json
object
client_id
required
string
name
required
string
operator
required
string
homepage
string | null
platform_id
required
string
test_mode
required
boolean
disabled
required
boolean
key_thumbprint
required
string
key_directory
required
string format: uri
created_at
required
integer
Example generated
{ "client_id": "example", "name": "example", "operator": "example", "homepage": "example", "platform_id": "example", "test_mode": true, "disabled": true, "key_thumbprint": "example", "key_directory": "https://example.com", "created_at": 1}not_a_platform
Media typeapplication/json
object
error
required
string
error_description
string
Example
{ "error": "authorization_pending"}