> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.aventure.vc/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.aventure.vc/_mcp/server.

# Reconcile standardized entity classifications

POST https://api.aventure.vc/v1/entities/classifications/reconcile
Content-Type: application/json

Reconciles each entity's standardized classification joins to the caller's desired exact set. The server computes the delete/patch/create diff, guards every entity with the audited expectedHash, and applies each diff in its own atomic transaction with post-apply exact-set verification. apply=false (default) returns the computed plan without writing. Stale rows are reported separately from failures and are never modified.

Reference: https://docs.aventure.vc/api-reference/a-venture-api/entity-classifications-reconcile/reconcile-entity-classifications

## Authentication

- `Authorization` header (bearer token, required) — User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key
- `X-API-Key` header (required) — Admin API key for system-to-system write operations

## Request

### Query parameters

- `sourceType` (enum, required) — Write provenance source type.
  - Allowed values: `requestChangeForm`, `newsArticle`, `blogArticle`, `firstPartyWebsite`, `relatedPartyWebsite`, `thirdPartyWebsite`, `llm`, `aventureStaff`
- `sourceDetail` (string, required) — Source detail or reviewer reference for the write.
- `sourceProvider` (string, optional) — Provider name for provider-native IDs or slugs.
- `sourceProviderId` (string, optional) — Provider-native source ID.
- `sourceProviderSlug` (string, optional) — Provider-native source slug.
- `actorType` (enum, optional) — Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.
  - Allowed values: `agent`, `employee`
- `agentChassis` (string, optional) — Agent chassis token for agent-authored writes.
- `agentModel` (string, optional) — Agent model id for agent-authored writes.

### Body (application/json)

- `entity` (list of object, required) — Entities to reconcile; each applied independently.
  - `desiredJoin` (list of object, required) — Exact desired standardized join set; an empty list deletes every standardized join on the entity.
    - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
    - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
  - `entityId` (string, required) — Canonical entity UUID.
  - `expectedHash` (string, required) — Standardized set hash the caller audited; compare-and-swap guard against concurrent writers. Obtain from the audit endpoint's expectedHash.
- `apply` (boolean, optional) — false (default) computes and returns the per-entity plan without writing; true applies each plan atomically.

## Response

### 200

OK

- `applied` (boolean, required) — true when apply=true executed writes; false for plan-only responses.
- `failed` (list of object, required) — Rows rejected or rolled back.
  - `entityId` (string, required) — Canonical entity UUID.
  - `verified` (boolean, required) — true when the post-apply set exactly equals the desired set; always false on plans, stale rows, and failures.
  - `message` (string, optional, nullable) — Failure or staleness detail; null on success.
  - `plan` (object, optional, nullable) — Computed diff; null on stale rows and pre-diff validation failures.
    - `create` (list of object, required) — Joins added to the entity.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
    - `delete` (list of integer, required) — Registry ids whose joins are removed from the entity.
    - `patch` (list of object, required) — Joins whose primary flag changes.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
  - `resultHash` (string, optional, nullable) — Standardized set hash after applying the diff; on a plan this is the hash the desired set will produce; on a stale row this is the current set hash.
- `stale` (list of object, required) — Rows whose expectedHash no longer matches; resultHash is current.
  - `entityId` (string, required) — Canonical entity UUID.
  - `verified` (boolean, required) — true when the post-apply set exactly equals the desired set; always false on plans, stale rows, and failures.
  - `message` (string, optional, nullable) — Failure or staleness detail; null on success.
  - `plan` (object, optional, nullable) — Computed diff; null on stale rows and pre-diff validation failures.
    - `create` (list of object, required) — Joins added to the entity.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
    - `delete` (list of integer, required) — Registry ids whose joins are removed from the entity.
    - `patch` (list of object, required) — Joins whose primary flag changes.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
  - `resultHash` (string, optional, nullable) — Standardized set hash after applying the diff; on a plan this is the hash the desired set will produce; on a stale row this is the current set hash.
- `succeeded` (list of object, required) — Rows planned or applied successfully.
  - `entityId` (string, required) — Canonical entity UUID.
  - `verified` (boolean, required) — true when the post-apply set exactly equals the desired set; always false on plans, stale rows, and failures.
  - `message` (string, optional, nullable) — Failure or staleness detail; null on success.
  - `plan` (object, optional, nullable) — Computed diff; null on stale rows and pre-diff validation failures.
    - `create` (list of object, required) — Joins added to the entity.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
    - `delete` (list of integer, required) — Registry ids whose joins are removed from the entity.
    - `patch` (list of object, required) — Joins whose primary flag changes.
      - `standardizedClassificationId` (integer, required) — Standardized classification registry id from res_classification_ref.
      - `isPrimary` (boolean, optional) — Primary join within the classification's category; default false.
  - `resultHash` (string, optional, nullable) — Standardized set hash after applying the diff; on a plan this is the hash the desired set will produce; on a stale row this is the current set hash.

## Examples

**Request**

```json
{
  "entity": [
    {
      "desiredJoin": [
        {
          "standardizedClassificationId": 1
        }
      ],
      "entityId": "string",
      "expectedHash": "string"
    }
  ]
}
```

**Response**

```json
{
  "applied": true,
  "failed": [
    {
      "entityId": "string",
      "verified": true,
      "message": "string",
      "plan": {
        "create": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ],
        "delete": [
          1
        ],
        "patch": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ]
      },
      "resultHash": "string"
    }
  ],
  "stale": [
    {
      "entityId": "string",
      "verified": true,
      "message": "string",
      "plan": {
        "create": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ],
        "delete": [
          1
        ],
        "patch": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ]
      },
      "resultHash": "string"
    }
  ],
  "succeeded": [
    {
      "entityId": "string",
      "verified": true,
      "message": "string",
      "plan": {
        "create": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ],
        "delete": [
          1
        ],
        "patch": [
          {
            "standardizedClassificationId": 1,
            "isPrimary": true
          }
        ]
      },
      "resultHash": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.aventure.vc/v1/entities/classifications/reconcile"

querystring = {"actorType":"agent","agentChassis":"codex-cli","sourceDetail":"aventure.vc","sourceProvider":"TechCrunch","sourceProviderId":"tc-2026-05-20-example-round","sourceProviderSlug":"example-round","sourceType":"requestChangeForm"}

payload = { "entity": [
        {
            "desiredJoin": [{ "standardizedClassificationId": 1 }],
            "entityId": "string",
            "expectedHash": "string"
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"entity":[{"desiredJoin":[{"standardizedClassificationId":1}],"entityId":"string","expectedHash":"string"}]}'
};

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.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm"

	payload := strings.NewReader("{\n  \"entity\": [\n    {\n      \"desiredJoin\": [\n        {\n          \"standardizedClassificationId\": 1\n        }\n      ],\n      \"entityId\": \"string\",\n      \"expectedHash\": \"string\"\n    }\n  ]\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entity\": [\n    {\n      \"desiredJoin\": [\n        {\n          \"standardizedClassificationId\": 1\n        }\n      ],\n      \"entityId\": \"string\",\n      \"expectedHash\": \"string\"\n    }\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.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entity\": [\n    {\n      \"desiredJoin\": [\n        {\n          \"standardizedClassificationId\": 1\n        }\n      ],\n      \"entityId\": \"string\",\n      \"expectedHash\": \"string\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm', [
  'body' => '{
  "entity": [
    {
      "desiredJoin": [
        {
          "standardizedClassificationId": 1
        }
      ],
      "entityId": "string",
      "expectedHash": "string"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entity\": [\n    {\n      \"desiredJoin\": [\n        {\n          \"standardizedClassificationId\": 1\n        }\n      ],\n      \"entityId\": \"string\",\n      \"expectedHash\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["entity": [
    [
      "desiredJoin": [["standardizedClassificationId": 1]],
      "entityId": "string",
      "expectedHash": "string"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.aventure.vc/v1/entities/classifications/reconcile?actorType=agent&agentChassis=codex-cli&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")! 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()
```