PHPackages                             datalumo/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. datalumo/php-sdk

ActiveLibrary[API Development](/categories/api)

datalumo/php-sdk
================

Official PHP SDK for the Datalumo API

0.3.0(1mo ago)031↓90%1MITPHPPHP ^8.2

Since Apr 4Pushed 1mo agoCompare

[ Source](https://github.com/datalumo/php-sdk)[ Packagist](https://packagist.org/packages/datalumo/php-sdk)[ RSS](/packages/datalumo-php-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (5)Used By (1)

Datalumo PHP SDK
================

[](#datalumo-php-sdk)

Official PHP SDK for the [datalumo](https://datalumo.app) API.

Requirements
------------

[](#requirements)

- PHP 8.2+

Installation
------------

[](#installation)

```
composer require datalumo/php-sdk
```

Quick start
-----------

[](#quick-start)

```
use Datalumo\PhpSdk\Datalumo;

$datalumo = new Datalumo('your-api-token');
```

Collections
-----------

[](#collections)

Collections are containers for your content. Use them to manage your data.

### List collections

[](#list-collections)

```
$response = $datalumo->collections()->list();

foreach ($response->data as $collection) {
    echo $collection->name;
}

// Filter by project or paginate
$response = $datalumo->collections()->list(project: 'docs', page: 2);
```

### Create a collection

[](#create-a-collection)

```
$collection = $datalumo->collections()->create('My Collection');
$collection = $datalumo->collections()->create('My Collection', project: 'docs');
```

### Update a collection

[](#update-a-collection)

```
$collection = $datalumo->collections()->update('collection-id', 'New Name');
```

### Delete a collection

[](#delete-a-collection)

```
$datalumo->collections()->delete('collection-id');
```

Entries
-------

[](#entries)

Entries are the individual pieces of content inside a collection.

```
$entries = $datalumo->entries('collection-id');
```

### List entries

[](#list-entries)

```
$response = $entries->list();
$response = $entries->list(page: 2);
```

### Create an entry

[](#create-an-entry)

```
$entry = $entries->create([
    'raw_text' => 'The content to index',
    'title' => 'My Entry',
    'meta' => ['author' => 'John'],
    'source_url' => 'https://example.com/page',
    'source_type' => 'articles',
    'source_id' => '42',
]);
```

Only `raw_text` is required. All other fields are optional.

### Upsert an entry

[](#upsert-an-entry)

Create or update by `source_type` and `source_id`:

```
$entry = $entries->upsert([
    'raw_text' => 'Updated content',
    'source_type' => 'articles',
    'source_id' => '42',
]);
```

### Batch upsert

[](#batch-upsert)

Create or update up to 50 entries at once:

```
$result = $entries->batchUpsert([
    ['raw_text' => 'First entry', 'source_type' => 'articles', 'source_id' => '1'],
    ['raw_text' => 'Second entry', 'source_type' => 'articles', 'source_id' => '2'],
]);

echo $result['created']; // 2
echo $result['updated']; // 0
```

### Update an entry

[](#update-an-entry)

```
$entry = $entries->update('entry-id', ['title' => 'Updated Title']);
```

### Delete an entry

[](#delete-an-entry)

```
$entries->delete('entry-id');
$entries->deleteBySource('articles', '42');
```

Integrations
------------

[](#integrations)

Integrations are the consumption layer — search, summarise, and chat all go through an integration. Each integration connects to one or more collections.

### List integrations

[](#list-integrations)

```
$response = $datalumo->integrations()->list();
$response = $datalumo->integrations()->list(type: 'chatbot', project: 'support');
```

### Get an integration

[](#get-an-integration)

```
$integration = $datalumo->integrations()->get('integration-id');
```

### Create an integration

[](#create-an-integration)

```
$integration = $datalumo->integrations()->create([
    'type' => 'chatbot',
    'name' => 'Support Bot',
    'collection_ids' => ['col-1', 'col-2'],
    'accent_color' => '#3b82f6',
    'allowed_domains' => ['example.com'],
    'welcome_message' => 'How can I help?',
    'persona' => 'friendly',
]);
```

### Update / delete

[](#update--delete)

```
$datalumo->integrations()->update('integration-id', ['name' => 'Updated Bot']);
$datalumo->integrations()->delete('integration-id');
```

### Record an event

[](#record-an-event)

```
$datalumo->integrations()->recordEvent('integration-id', [
    'event_type' => 'thumbs_up', // 'click', 'thumbs_up', or 'thumbs_down'
    'meta' => ['url' => 'https://example.com/page'],
]);
```

Search
------

[](#search)

```
$results = $datalumo->integrations()->search('integration-id', [
    'query' => 'how do refunds work',
    'threshold' => 0.3,
    'meta' => ['category' => 'billing'],
    'per_page' => 10,
    'page' => 1,
]);

foreach ($results->data as $entry) {
    echo $entry->title;
}

echo $results->summarisable; // true if good for summarisation
```

Summarise
---------

[](#summarise)

```
$summary = $datalumo->integrations()->summarise('integration-id', [
    'query' => 'explain your refund policy',
    'format' => 'html', // 'markdown' (default) or 'html'
    'locale' => 'en',
]);

echo $summary->summary;
echo $summary->references;
echo $summary->hasRelevantResults;
```

Chat
----

[](#chat)

```
$response = $datalumo->integrations()->chat('integration-id', [
    'message' => 'What is your refund policy?',
]);

echo $response->message;
echo $response->conversationId;

// Continue the conversation
$followUp = $datalumo->integrations()->chat('integration-id', [
    'message' => 'How long do I have?',
    'conversation_id' => $response->conversationId,
]);
```

Streaming
---------

[](#streaming)

The summarise and chat endpoints support streaming via SSE:

### Stream chat

[](#stream-chat)

```
$stream = $datalumo->integrations()->streamChat('integration-id', [
    'message' => 'What is your refund policy?',
]);

foreach ($stream->text() as $chunk) {
    echo $chunk;
    flush();
}
```

### Stream summarise

[](#stream-summarise)

```
$stream = $datalumo->integrations()->streamSummarise('integration-id', [
    'query' => 'explain the refund policy',
]);

foreach ($stream->text() as $chunk) {
    echo $chunk;
    flush();
}
```

### Full text

[](#full-text)

```
$stream = $datalumo->integrations()->streamChat('integration-id', [
    'message' => 'hello',
]);

$fullResponse = $stream->fullText();
```

### Raw stream events

[](#raw-stream-events)

```
foreach ($stream as $event) {
    if ($event->isTextDelta()) {
        echo $event->data;
    } elseif ($event->isCitation()) {
        // $event->citation() returns ['title' => '...', 'url' => '...']
    } elseif ($event->isStreamEnd()) {
        break;
    }
}
```

Error handling
--------------

[](#error-handling)

```
use Datalumo\PhpSdk\Exceptions\AuthenticationException;
use Datalumo\PhpSdk\Exceptions\ValidationException;
use Datalumo\PhpSdk\Exceptions\NotFoundException;
use Datalumo\PhpSdk\Exceptions\QuotaExceededException;
use Datalumo\PhpSdk\Exceptions\DatalumoException;

try {
    $datalumo->collections()->create('');
} catch (ValidationException $e) {
    $e->getMessage(); // "The name field is required."
    $e->errors();     // ['name' => ['The name field is required.']]
} catch (AuthenticationException $e) {
    // 401 or 403
} catch (QuotaExceededException $e) {
    // 402
} catch (NotFoundException $e) {
    // 404
} catch (DatalumoException $e) {
    // Any other API error
}
```

Data objects
------------

[](#data-objects)

All API responses are returned as typed data objects:

ClassProperties`Collection``id`, `organisationId`, `name`, `project`, `createdAt`, `updatedAt``Entry``id`, `collectionId`, `title`, `rawText`, `meta`, `sourceUrl`, `sourceType`, `sourceId`, `createdAt`, `updatedAt``Integration``id`, `name`, `project`, `type`, `accentColor`, `allowedDomains`, `isActive`, `settings`, `collectionIds`, `createdAt`, `updatedAt``PaginatedResponse``data`, `currentPage`, `lastPage`, `perPage`, `total`, `hasMorePages()``SearchResult`Same as `PaginatedResponse` plus `summarisable``SummaryResponse``summary`, `references`, `data`, `hasRelevantResults``ChatResponse``conversationId`, `message``StreamResponse`Iterable of `StreamEvent`, plus `text()`, `fullText()`, `conversationId()``StreamEvent``type`, `data`, `raw`, plus `isTextDelta()`, `isCitation()`, `isStreamEnd()`, `isError()`

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

3

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66ca71465f93459010e10f39821b541f1c00c61233c48bcda0cea8a8d6fb6988?d=identicon)[jeffreyvr](/maintainers/jeffreyvr)

---

Top Contributors

[![jeffreyvr](https://avatars.githubusercontent.com/u/9550079?v=4)](https://github.com/jeffreyvr "jeffreyvr (9 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/datalumo-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/datalumo-php-sdk/health.svg)](https://phpackages.com/packages/datalumo-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
