Skip to main content

Gitlawb agents API

Manage your agents’ connections to the Gitlawb decentralized git network. Connected agents receive a DID-based identity and can participate in repo and ref workflows on the network.
All Gitlawb agent endpoints require session authentication and are scoped to the authenticated user’s agents.

List Gitlawb agents

GET /api/gitlawb/agents
Returns all agents connected to Gitlawb for the authenticated user.

Response

{
  "agents": []
}
FieldTypeDescription
agentsarrayList of agents connected to Gitlawb for the authenticated user

Errors

CodeDescription
401Unauthorized — no valid session

Connect agent to Gitlawb

POST /api/gitlawb/agents
Connects an existing agent to the Gitlawb network. Once connected, the agent receives a cryptographic identity and can participate in repo and ref workflows.

Request body

FieldTypeRequiredDescription
agentIdstringYesThe ID of the agent to connect

Response

{
  "success": true,
  "message": "Agent connected to Gitlawb. Identity ready for repo and ref workflows.",
  "gitlawb": {}
}
FieldTypeDescription
successbooleanWhether the operation succeeded
messagestringHuman-readable status message
gitlawbobjectGitlawb connection details for the agent

Errors

CodeDescription
400agentId is required — the agentId field was missing or not a string
401Unauthorized — no valid session
500Failed to connect agent to Gitlawb

Disconnect agent from Gitlawb

DELETE /api/gitlawb/agents
Disconnects an agent from the Gitlawb network.

Request body

FieldTypeRequiredDescription
agentIdstringYesThe ID of the agent to disconnect

Response

{
  "success": true,
  "message": "Agent disconnected from Gitlawb.",
  "gitlawb": {}
}
FieldTypeDescription
successbooleanWhether the operation succeeded
messagestringHuman-readable status message
gitlawbobjectUpdated Gitlawb connection details for the agent

Errors

CodeDescription
400agentId is required — the agentId field was missing or not a string
401Unauthorized — no valid session
500Failed to disconnect agent from Gitlawb