# Factory Verdicts

Source: https://opvs.ai/docs/api/factory-verdicts

## `GET` /api/v1/factory/verdicts

**Get Verdicts**

Return live rows and conservative answers, failing open to running.

**Parameters**

- `tree` (query, any, optional)
- `commit` (query, any, optional)
- `lane` (query, any, optional)
- `env_class` (query, any, optional)
- `def` (query, any, optional)
- `format` (query, any, optional)
- `limit` (query, integer, optional)
- `offset` (query, integer, optional)
- `repository` (query, any, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/verdicts' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/verdicts",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/verdicts", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/verdicts", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/factory/verdicts

**Create Verdicts**

Append one or many results; writer class is never accepted from the body.

**Parameters**

- `X-GitHub-OIDC-Token` (header, any, optional)

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/factory/verdicts' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "tree_sha": "string",
  "repository": "string",
  "commit_sha": "string",
  "lane": "string",
  "lane_def_digest": "",
  "env_class": "string",
  "verdict": "PASS",
  "counts": {},
  "executor": "string",
  "run_url": "string",
  "started_at": "2026-01-01T00:00:00Z",
  "finished_at": "2026-01-01T00:00:00Z",
  "clean_checkout": false,
  "edits_gate": false
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/factory/verdicts",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"tree_sha": "string", "repository": "string", "commit_sha": "string", "lane": "string", "lane_def_digest": "", "env_class": "string", "verdict": "PASS", "counts": {}, "executor": "string", "run_url": "string", "started_at": "2026-01-01T00:00:00Z", "finished_at": "2026-01-01T00:00:00Z", "clean_checkout": false, "edits_gate": false},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/verdicts", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"tree_sha": "string", "repository": "string", "commit_sha": "string", "lane": "string", "lane_def_digest": "", "env_class": "string", "verdict": "PASS", "counts": {}, "executor": "string", "run_url": "string", "started_at": "2026-01-01T00:00:00Z", "finished_at": "2026-01-01T00:00:00Z", "clean_checkout": false, "edits_gate": false})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"tree_sha": "string", "repository": "string", "commit_sha": "string", "lane": "string", "lane_def_digest": "", "env_class": "string", "verdict": "PASS", "counts": {}, "executor": "string", "run_url": "string", "started_at": "2026-01-01T00:00:00Z", "finished_at": "2026-01-01T00:00:00Z", "clean_checkout": false, "edits_gate": false}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/factory/verdicts", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `201` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/factory/ship-receipts

**Create Ship Receipt**

Append a runner receipt; only a registered desk token earns trust.

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/factory/ship-receipts' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "receipt_id": "string",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "repository": "string",
  "pr_number": 0,
  "head_sha": "string",
  "head_tree": "string",
  "command": "ship",
  "method_version": "string",
  "policy_digest": "string",
  "closed": true,
  "verdict": "PASS",
  "control_id": "string",
  "control_verdict": "PASS",
  "steps": [
    {}
  ],
  "evidence": {},
  "issued_at": "2026-01-01T00:00:00Z"
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/factory/ship-receipts",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"receipt_id": "string", "project_id": "00000000-0000-0000-0000-000000000000", "repository": "string", "pr_number": 0, "head_sha": "string", "head_tree": "string", "command": "ship", "method_version": "string", "policy_digest": "string", "closed": true, "verdict": "PASS", "control_id": "string", "control_verdict": "PASS", "steps": [{}], "evidence": {}, "issued_at": "2026-01-01T00:00:00Z"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/ship-receipts", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"receipt_id": "string", "project_id": "00000000-0000-0000-0000-000000000000", "repository": "string", "pr_number": 0, "head_sha": "string", "head_tree": "string", "command": "ship", "method_version": "string", "policy_digest": "string", "closed": true, "verdict": "PASS", "control_id": "string", "control_verdict": "PASS", "steps": [{}], "evidence": {}, "issued_at": "2026-01-01T00:00:00Z"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"receipt_id": "string", "project_id": "00000000-0000-0000-0000-000000000000", "repository": "string", "pr_number": 0, "head_sha": "string", "head_tree": "string", "command": "ship", "method_version": "string", "policy_digest": "string", "closed": true, "verdict": "PASS", "control_id": "string", "control_verdict": "PASS", "steps": [{}], "evidence": {}, "issued_at": "2026-01-01T00:00:00Z"}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/factory/ship-receipts", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `201` — Successful Response
- `422` — Validation Error

## Get Verdicts

`GET https://app.opvs.ai/api/v1/factory/verdicts`

Also as: MCP `tool_call software-factory.listVerdicts` · skill `software-factory`

Return live rows and conservative answers, failing open to running.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Create Verdicts

`POST https://app.opvs.ai/api/v1/factory/verdicts`

Also as: MCP `tool_call software-factory.createVerdict` · skill `software-factory`

Append one or many results; writer class is never accepted from the body.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Create Ship Receipt

`POST https://app.opvs.ai/api/v1/factory/ship-receipts`

Also as: MCP `tool_call software-factory.createShipReceipt` · skill `software-factory`

Append a runner receipt; only a registered desk token earns trust.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |
