API ReferenceapiaiPOST /v1/ingest/document

POST /v1/ingest/document

Service: ai · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "external_id": {
      "type": "string",
      "minLength": 1
    },
    "source": {
      "type": "string",
      "minLength": 1
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string",
      "minLength": 1
    },
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "default": {}
    },
    "chunk_size": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "default": 512
    },
    "chunk_overlap": {
      "type": "integer",
      "minimum": 0,
      "default": 64
    }
  },
  "required": [
    "external_id",
    "source",
    "content",
    "brand_id"
  ]
}

Responses

200 Document ingested successfully

{
  "type": "object",
  "properties": {
    "document_id": {
      "type": "string"
    },
    "external_id": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "chunk_count": {
      "type": "number"
    },
    "embedding_count": {
      "type": "number"
    },
    "is_update": {
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "external_id",
    "source",
    "chunk_count",
    "embedding_count",
    "is_update"
  ]
}

400 Invalid input

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

409 Document already exists with same content

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

500 Internal error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://ai.platform.loop.health/v1/ingest/document \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'