POST/api/orgs/{org_id}/datasets/{dataset_id}/items

Add dataset items

Send one of: targets (requests or sessions, at most 1,000), a filter with a limit, or hand-written items. A request becomes its messages and tools as input and its reply as the expected output; a session becomes its first task and final answer. Only stored content is copied: anything else is skipped with not_stored. Limits: 5,000 items a dataset, 512 KiB an item, 512 MiB per organization.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

  • dataset_idstringrequired

    The dataset id.

Request body

  • targetsarray<object>
    targets
    • kindenumrequired
      "request""session""span"
    • idstringrequired
  • filterobject

    Requests to add, found by a filter.

    filter
    • fromstringrequired
    • tostringrequired
    • api_key_idsarray<string>
    • modelsarray<string>
    • request_tagsarray<string>

      Written key:value.

    • trace_tag_firedstring | null

      A trace tag id that fired.

    • statusenum
      "completed""failed"null
  • limitinteger

    1 to 1,000.

  • itemsarray<object>

    Hand-written items, at most 1,000.

    items
    • inputany

      The input.

    • expected_outputany

      The expected output.

    • metadataobject

Responses

  • 200

    Counts.

    Response
    • addedinteger
    • skippedarray<object>
      skipped
      • idstring
      • reasonenum
        "not_stored""erased""duplicate"
  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    The resource does not exist or belongs to another organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 409

    A dataset or organization limit is reached (limit_reached).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    The body is invalid (invalid_request).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

Request

curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/datasets/1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e/items' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "targets": [
    {
      "kind": "request",
      "id": "req_01JD8ZK4M2Q7V9X3N5T6B8C0EF"
    }
  ]
}'

Response

{
  "added": 1,
  "skipped": [
    {
      "id": "req_01JD8ZK4M2Q7V9X3N5T6B8C0EG",
      "reason": "not_stored"
    }
  ]
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/datasets/1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e/items