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

# Ground Truth

POST https://api.amniscient.com/inference/ground-truth
Content-Type: application/json

Provide ground truth data to validate the results of a previously successful inference call. This data should list what objects were included in the final transaction, and may not be a perfect match to what was detected in the original inference call.

Reference: https://docs.amniscient.com/api/api-reference/ground-truth

## Request

### Headers

- `x-api-key` (string, required) — Your organization's active API Key.

### Body (application/json)

This endpoint expects an object.

- `organizationId` (string, required) — Your organization's unique identifier.
- `transactionTime` (datetime, required) — The date and time of the request.
- `inferenceId` (string, required) — A unique identifier for the results of a successful inference call.
- `inferencePointId` (string, optional) — The unique identifier for the inference point within your organization used for the original inference call.
- `transactionPayload` (GroundTruthPostRequestBodyContentApplicationJsonSchemaTransactionPayload, optional) — An array of objects included in the final transaction record related to the previously successful inference call.

## Response

### 201

201 - Ground Truth Payload Successful

- `id` (string, optional) — A unique identifier for a successfully posted ground truth payload.
- `transactionPayload` (list of GroundTruthPostResponsesContentApplicationJsonSchemaTransactionPayloadItems, optional) — An array of objects included in the final transaction record related to the previously successful inference call.

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, optional) — A message describing the successful action or error state.

### 404 Not Found Error

Inference ID Not Found

- `detail` (string, optional) — A message describing the successful action or error state.

## Types

### GroundTruthPostRequestBodyContentApplicationJsonSchemaTransactionPayload

An array of objects included in the final transaction record related to the previously successful inference call.

- `detectionItemId` (string, optional) — The detection item id of the object included in the final transaction record. This will match the detection item id in the library for this object.
- `quantity` (integer, optional) — The quantity of this particular object that was included in the final transaction record.

### GroundTruthPostResponsesContentApplicationJsonSchemaTransactionPayloadItems

- `detectionItemId` (string, optional) — The detection item id of the object detected. This will match the detection item id in the library for this object.
- `quantity` (integer, optional) — The quantity of this particular object that was included in the final transaction record.

## Examples

**Request**

```json
{
  "organizationId": "string",
  "transactionTime": "2024-01-15T09:30:00Z",
  "inferenceId": "string"
}
```

**Response**

```json
{
  "id": "60b7c352-12af-43a6-9e1a-dc5bed42470e",
  "transactionPayload": [
    {
      "detectionItemId": "ef404ff0-eaa7-49b5-b7ed-eddc3c45defc",
      "quantity": 3
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.amniscient.com/inference/ground-truth"

payload = {
    "organizationId": "string",
    "transactionTime": "2024-01-15T09:30:00Z",
    "inferenceId": "string"
}
headers = {
    "x-api-key": "x-api-key",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.amniscient.com/inference/ground-truth';
const options = {
  method: 'POST',
  headers: {'x-api-key': 'x-api-key', 'Content-Type': 'application/json'},
  body: '{"organizationId":"string","transactionTime":"2024-01-15T09:30:00Z","inferenceId":"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.amniscient.com/inference/ground-truth"

	payload := strings.NewReader("{\n  \"organizationId\": \"string\",\n  \"transactionTime\": \"2024-01-15T09:30:00Z\",\n  \"inferenceId\": \"string\"\n}")

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

	req.Header.Add("x-api-key", "x-api-key")
	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.amniscient.com/inference/ground-truth")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = 'x-api-key'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"organizationId\": \"string\",\n  \"transactionTime\": \"2024-01-15T09:30:00Z\",\n  \"inferenceId\": \"string\"\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.amniscient.com/inference/ground-truth")
  .header("x-api-key", "x-api-key")
  .header("Content-Type", "application/json")
  .body("{\n  \"organizationId\": \"string\",\n  \"transactionTime\": \"2024-01-15T09:30:00Z\",\n  \"inferenceId\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.amniscient.com/inference/ground-truth', [
  'body' => '{
  "organizationId": "string",
  "transactionTime": "2024-01-15T09:30:00Z",
  "inferenceId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => 'x-api-key',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.amniscient.com/inference/ground-truth");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "x-api-key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"organizationId\": \"string\",\n  \"transactionTime\": \"2024-01-15T09:30:00Z\",\n  \"inferenceId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "x-api-key",
  "Content-Type": "application/json"
]
let parameters = [
  "organizationId": "string",
  "transactionTime": "2024-01-15T09:30:00Z",
  "inferenceId": "string"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.amniscient.com/inference/ground-truth")! 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()
```