> This page is also available as Markdown: append .md to its URL. The full index of Sikaru docs is at https://docs.sikaru.ai/llms.txt. Code examples use only operations from the public API reference at https://docs.sikaru.ai/api-reference.

# Reconcile Compute Executor

POST https://api.sikaru.ai/v1/projects/{project_id}/compute-attachments/{attachment_id}/reconcile
Content-Type: application/json

Reference: https://docs.sikaru.ai/api-reference/compute-attachments/reconcile

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `project_id` (string, required)
- `attachment_id` (string, required)

### Body (application/json)

This endpoint expects a ReconcileInput.

- `executor_instance_id` (string, required)
- `journal_id` (string, required)
- `workspace_provenance` (WorkspaceProvenance, required)
- `processes` (list of ProcessObservation, optional)
- `receipts` (list of ReceiptInput, optional)
- `uncertain_operation_ids` (list of string, optional)

## Response

### 200

Successful Response

- `attachment` (AttachmentView, required)
- `receipts` (list of ReceiptView, required)

## Errors

### 401 Unauthorized Error

Unauthorized

- `code` (string, required) — Stable machine code. Specific values: `insufficient_credits` (402): billing does not allow this request now; check your plan, credits and the agent's spending cap; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (string, required)

### 403 Forbidden Error

Forbidden

- `code` (string, required) — Stable machine code. Specific values: `insufficient_credits` (402): billing does not allow this request now; check your plan, credits and the agent's spending cap; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (string, required)

### 404 Not Found Error

Not Found

- `code` (string, required) — Stable machine code. Specific values: `insufficient_credits` (402): billing does not allow this request now; check your plan, credits and the agent's spending cap; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (string, required)

### 409 Conflict Error

Conflict

- `code` (string, required) — Stable machine code. Specific values: `insufficient_credits` (402): billing does not allow this request now; check your plan, credits and the agent's spending cap; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (string, required)

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 503 Service Unavailable Error

Service Unavailable

- `code` (string, required) — Stable machine code. Specific values: `insufficient_credits` (402): billing does not allow this request now; check your plan, credits and the agent's spending cap; `idempotency_conflict` (409): the idempotency key was already used for a different request, or for a file that was deleted; `concurrent_request` (409): another request is changing the same resource; send the same request again; `agent_disabled` (409): the agent is turned off; turn it on before starting new work; `release_unavailable` (409): the agent has no release that can run; `action_not_pending` (409): the tool call or approval is not waiting for this input: it already has an outcome, its run finished, it is handled by Sikaru, or it does not match a pending request; `not_retryable` (409): the run cannot be retried: it did not fail, its failure is not recoverable, or it failed too long ago; `branch_unavailable` (409): the session cannot be branched at that run; `record_invalid` (409): the retained record cannot be read; `state_conflict` (409): the request conflicts with the resource's current state; read it before trying again; `agent_capacity_full` (429): the agent's turn capacity is full; `agent_unavailable` (503): execution is switched off for this agent; `turn_delivery_pending` (503): the message was recorded but has not started; send it again with the same idempotency key; `execution_storage_unavailable` (503): session, file or workspace storage is unavailable right now; `storage_unavailable` (503): the storage behind this resource is unavailable right now; `trajectory_storage_unavailable` (503): retained run records cannot be read right now. Otherwise a status default: `bad_request` (400), `unauthenticated` (401), `payment_required` (402), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `not_acceptable` (406), `request_timeout` (408), `conflict` (409), `gone` (410), `length_required` (411), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `range_not_satisfiable` (416), `invalid_request` (422), `locked` (423), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). `429` and `503` refusals with a specific code carry `Retry-After` in seconds.
- `detail` (string, required)

## Types

### WorkspaceProvenance

- `identity` (string, required)
- `kind` (enum, required)
  - Allowed values: `existing_directory`, `container`, `sandbox`

### ProcessObservation

- `evidence` (string, required)
- `handle_id` (string, required)
- `status` (enum, required)
  - Allowed values: `running`, `exited`, `cancelled`, `lost`

### ReceiptInput

- `idempotency_key` (string, required)
- `payload` (map from string to any, required)
- `request_digest` (string, required)
- `run_id` (string, required)
- `status` (enum, required)
  - Allowed values: `completed`, `failed`
- `tool_call_id` (string, required)
- `tool_provider_id` (string, required)
- `capability_name` ("compute.execute", optional, default: compute.execute)

### AttachmentView

- `capabilities` (list of string, required)
- `cleanup_at` (double, required, nullable)
- `cleanup_status` (enum, required)
  - Allowed values: `unconfirmed`, `confirmed`
- `environment_id` (string, required)
- `id` (string, required)
- `journal_id` (string, required)
- `lease_until` (double, required)
- `owner_epoch` (integer, required)
- `owner_id` (string, required, nullable)
- `processes` (list of ProcessObservation, required)
- `project_id` (string, required)
- `protocol_version` (string, required, nullable)
- `provider_id` (string, required)
- `session_id` (string, required)
- `startup_deadline` (double, required)
- `status` (enum, required)
  - Allowed values: `pending`, `starting`, `ready`, `stopping`, `cleaned`, `startup_expired`, `recovery_required`, `abandoned`
- `uncertain_operations` (list of UncertainOperation, required)
- `workspace_generation` (string, required)
- `workspace_provenance` (WorkspaceProvenance, required)
- `lease_ttl_seconds` (integer, optional, default: 60) — Renewal TTL; anchor only ready/heartbeat acknowledgments to request-start monotonic time. Status and poll responses never renew the lease.

### ReceiptView

- `created` (boolean, required)
- `tool_call_id` (string, required)
- `status` ("accepted", optional, default: accepted)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### UncertainOperation

- `method` (string, required)
- `owner_epoch` (integer, required)
- `request_digest` (string, required)
- `run_id` (string, required)
- `tool_call_id` (string, required)
- `workspace_generation` (string, required)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "executor_instance_id": "string",
  "journal_id": "string",
  "workspace_provenance": {
    "identity": "string",
    "kind": "existing_directory"
  }
}
```

**Response**

```json
{
  "attachment": {
    "capabilities": [
      "string"
    ],
    "cleanup_at": 1.1,
    "cleanup_status": "unconfirmed",
    "environment_id": "string",
    "id": "string",
    "journal_id": "string",
    "lease_until": 1.1,
    "owner_epoch": 1,
    "owner_id": "string",
    "processes": [
      {
        "evidence": "string",
        "handle_id": "string",
        "status": "running"
      }
    ],
    "project_id": "string",
    "protocol_version": "string",
    "provider_id": "string",
    "session_id": "string",
    "startup_deadline": 1.1,
    "status": "pending",
    "uncertain_operations": [
      {
        "method": "string",
        "owner_epoch": 1,
        "request_digest": "string",
        "run_id": "string",
        "tool_call_id": "string",
        "workspace_generation": "string"
      }
    ],
    "workspace_generation": "string",
    "workspace_provenance": {
      "identity": "string",
      "kind": "existing_directory"
    },
    "lease_ttl_seconds": 60
  },
  "receipts": [
    {
      "created": true,
      "tool_call_id": "string",
      "status": "accepted"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile"

payload = {
    "executor_instance_id": "string",
    "journal_id": "string",
    "workspace_provenance": {
        "identity": "string",
        "kind": "existing_directory"
    }
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"executor_instance_id":"string","journal_id":"string","workspace_provenance":{"identity":"string","kind":"existing_directory"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile"

	payload := strings.NewReader("{\n  \"executor_instance_id\": \"string\",\n  \"journal_id\": \"string\",\n  \"workspace_provenance\": {\n    \"identity\": \"string\",\n    \"kind\": \"existing_directory\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"executor_instance_id\": \"string\",\n  \"journal_id\": \"string\",\n  \"workspace_provenance\": {\n    \"identity\": \"string\",\n    \"kind\": \"existing_directory\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"executor_instance_id\": \"string\",\n  \"journal_id\": \"string\",\n  \"workspace_provenance\": {\n    \"identity\": \"string\",\n    \"kind\": \"existing_directory\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile', [
  'body' => '{
  "executor_instance_id": "string",
  "journal_id": "string",
  "workspace_provenance": {
    "identity": "string",
    "kind": "existing_directory"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"executor_instance_id\": \"string\",\n  \"journal_id\": \"string\",\n  \"workspace_provenance\": {\n    \"identity\": \"string\",\n    \"kind\": \"existing_directory\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "executor_instance_id": "string",
  "journal_id": "string",
  "workspace_provenance": [
    "identity": "string",
    "kind": "existing_directory"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sikaru.ai/v1/projects/project_id/compute-attachments/attachment_id/reconcile")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```