Skip to main content
POST
/
apps
/
{appSlug}
/
datasets
/
{externalId}
/
items
Python
from autoblocks.api.app_client import AutoblocksAppClient

client = AutoblocksAppClient(
  api_key="<YOUR_API_KEY>",
  app_slug="my-app",
)

items = [
  {
    "title": "First Item",  # String values cannot be empty
    "content": "This is the first item"
  },
  {
    "title": "Second Item",
    "content": "This is the second item"
  }
]

create_result = client.datasets.create_items(
  external_id="my-dataset",
  items=items,
  split_names=["train", "test"]  # Split names cannot be empty
)
{
  "count": 123,
  "revisionId": "<string>"
}

Authorizations

Authorization
string
header
required

API Key created in the Autoblocks Webapp

Path Parameters

appSlug
string
required
externalId
string
required

Body

application/json
items
object[]
required

The items to create in the dataset

Example:
[
{
"question": "What is the capital of France?",
"answer": "Paris"
},
{
"question": "What is the capital of Germany?",
"answer": "Berlin"
}
]
splitNames
string[]

The names of the splits to create the items in

Example:
["train", "test"]

Response

200 - application/json

The items were added successfully

count
number
required
revisionId
string
required
I