> 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.

# Create Objects

POST https://api.amniscient.com/detection-item/
Content-Type: application/json

Create objects within your organization's AmniSphere library.

Reference: https://docs.amniscient.com/api/api-reference/create-objects

## Request

### Headers

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

### Body (application/json)

This endpoint expects a list of PostRequestBodyContentApplicationJsonSchemaItems.

- `list of PostRequestBodyContentApplicationJsonSchemaItems`

## Response

### 201

201 - Object creation successful

- `label` (string, optional) — The name of the object you've successfully created within your organization's library.
- `organization_id` (string, optional) — Your organization's unique identifier.
- `attributes` (map from string to string, optional) — A map of attributes associated with the newly created object. These attributes will match the attributes within the library for this object.
- `barcodes` (string, optional) — The UPC/barcode values associated with this object. Individual barcodes should be separated by a pipe character(|) to be parsed correctly.
- `collection_note` (string, optional) — A collection note to be shown to users when they begin collecting this object. This value will be null if a collection note was not entered during object creation.
- `detection_item_folder_id` (string, optional) — The folder id of the folder your newly created object resides in within your organization's library. If you did not specify a folder during object creation, this value will be null.
- `created_by` (string, optional) — The name of the object you'd like to create within your organization's library.

## Errors

### 400 Bad Request Error

Invalid request

- `status` (string, optional) — A status code denoting success or failure.
- `message` (string, optional) — A message describing the successful action or error state.

### 401 Unauthorized Error

Unauthorized

- `status` (string, optional) — A status code denoting success or failure.
- `message` (string, optional) — A message describing the successful action or error state.

### 409 Conflict Error

Conflict

- `status` (string, optional) — A status code denoting success or failure.
- `message` (string, optional) — A message describing the successful action or error state.

## Types

### PostRequestBodyContentApplicationJsonSchemaItems

- `label` (string, required) — The name of the object you'd like to create within your organization's library.
- `organization_id` (string, required) — Your organization's unique identifier.
- `attributes` (map from string to string, required) — A map of attributes associated with the object to be created within your organization's library. At least one attribute is required to create an object.
- `detection_item_folder_id` (string, optional) — The folder id of the folder you'd like your object to be created in within your organization's library. If this value is left empty, the object will be created in the "Unclassified" folder.
- `barcodes` (string, optional) — The UPC/barcode values associated with this object. Individual barcodes should be separated by a pipe character(|) to be parsed correctly.
- `collection_note` (string, optional) — A collection note to be shown to users when they begin collecting this object.
- `created_by` (string, optional) — The email of the user creating the folder. If this parameter is left empty, the value will default to 'API'.

## Examples

**Request**

```json
[
  {
    "label": "string",
    "organization_id": "string",
    "attributes": {}
  }
]
```

**Response**

```json
{
  "label": "My Object Name",
  "organization_id": "xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxx",
  "attributes": {
    "key": "value"
  },
  "barcodes": "123456|987654",
  "collection_note": "Collection Note Content",
  "detection_item_folder_id": "xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxx",
  "created_by": "API"
}
```

**SDK Code**

```python Successful object creation
import requests

url = "https://api.amniscient.com/detection-item/"

payload = [
    {
        "label": "string",
        "organization_id": "string",
        "attributes": {}
    }
]
headers = {
    "x-api-key": "x-api-key",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Successful object creation
const url = 'https://api.amniscient.com/detection-item/';
const options = {
  method: 'POST',
  headers: {'x-api-key': 'x-api-key', 'Content-Type': 'application/json'},
  body: '[{"label":"string","organization_id":"string","attributes":{}}]'
};

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

```go Successful object creation
package main

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

func main() {

	url := "https://api.amniscient.com/detection-item/"

	payload := strings.NewReader("[\n  {\n    \"label\": \"string\",\n    \"organization_id\": \"string\",\n    \"attributes\": {}\n  }\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 Successful object creation
require 'uri'
require 'net/http'

url = URI("https://api.amniscient.com/detection-item/")

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  {\n    \"label\": \"string\",\n    \"organization_id\": \"string\",\n    \"attributes\": {}\n  }\n]"

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

```java Successful object creation
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.amniscient.com/detection-item/")
  .header("x-api-key", "x-api-key")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"label\": \"string\",\n    \"organization_id\": \"string\",\n    \"attributes\": {}\n  }\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.amniscient.com/detection-item/', [
  'body' => '[
  {
    "label": "string",
    "organization_id": "string",
    "attributes": {}
  }
]',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => 'x-api-key',
  ],
]);

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

```csharp Successful object creation
using RestSharp;

var client = new RestClient("https://api.amniscient.com/detection-item/");
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  {\n    \"label\": \"string\",\n    \"organization_id\": \"string\",\n    \"attributes\": {}\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Successful object creation
import Foundation

let headers = [
  "x-api-key": "x-api-key",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "label": "string",
    "organization_id": "string",
    "attributes": []
  ]
] as [String : Any]

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

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