Leases the next backup-only command assigned to this Agent.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/file-protection/agent/v1/commands:lease"), Headers = { { "X-Moltaro-File-Protection-Agent", "<X-Moltaro-File-Protection-Agent>" }, }, Content = new StringContent("{ \"AgentVersion\": \"example\", \"ProtocolVersion\": \"example\", \"MaximumConcurrentOperations\": 1 }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/file-protection/agent/v1/commands:lease';const options = { method: 'POST', headers: { 'X-Moltaro-File-Protection-Agent': '<X-Moltaro-File-Protection-Agent>', 'Content-Type': 'application/json' }, body: '{"AgentVersion":"example","ProtocolVersion":"example","MaximumConcurrentOperations":1}'};
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://example.com/api/workspace/file-protection/agent/v1/commands:lease \ --header 'Content-Type: application/json' \ --header 'X-Moltaro-File-Protection-Agent: <X-Moltaro-File-Protection-Agent>' \ --data '{ "AgentVersion": "example", "ProtocolVersion": "example", "MaximumConcurrentOperations": 1 }'Requires TLS at the API connection. A workspace bearer token does not authenticate an Agent.
Send the enrolled device credential in the X-Moltaro-File-Protection-Agent header. Revoked or invalid credentials are rejected.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Requests the next command assigned to the authenticated Agent.
object
Examplegenerated
{ "AgentVersion": "example", "ProtocolVersion": "example", "MaximumConcurrentOperations": 1}Requests the next command assigned to the authenticated Agent.
object
Examplegenerated
{ "AgentVersion": "example", "ProtocolVersion": "example", "MaximumConcurrentOperations": 1}Requests the next command assigned to the authenticated Agent.
object
Examplegenerated
{ "AgentVersion": "example", "ProtocolVersion": "example", "MaximumConcurrentOperations": 1}Responses
Section titled “Responses”OK
object
Result of leasing. A missing command is a normal idle response.
object
One leased backup-only command with exact repository custody; Source master secrets stay on the server.
object
Supported backup command kinds. Restore is deliberately absent.
Source selector interpreted only by the local Agent.
One immutable writer target; the password is the actual Kopia password, never the Source master key.
object
Previously verified V2 content; never supplied for a Pending or legacy-only Source binding.
object
One shared tree identity, including an empty root; logical items never carry its password.
object
The type of the Kopia snapshot root, not the Source selector.
Safe logical recovery metadata; no Kopia object/chunk keys are exposed.
object
Verified single-file snapshot identity. This metadata is internal to the Agent protocol.
object
object
object
object
object
Example
{ "Data": { "Command": { "Kind": 0, "ConfirmedSourceKind": 0, "SourceTreeBaseline": { "Snapshot": { "RootKind": 0 } } } }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}