PHPackages                             robo-meister/flow-scribe-api - 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. robo-meister/flow-scribe-api

ActiveLibrary[API Development](/categories/api)

robo-meister/flow-scribe-api
============================

FlowScribe OCR PHP SDK for connecting to the Robo-Meister OCR API

v0.0.2(3w ago)01.3k↓79.5%proprietaryPHPPHP &gt;=8.2

Since May 31Pushed 3w agoCompare

[ Source](https://github.com/Robo-Meister/flow-scribe-sdk-php)[ Packagist](https://packagist.org/packages/robo-meister/flow-scribe-api)[ RSS](/packages/robo-meister-flow-scribe-api/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (3)Used By (0)

FlowScribe OCR SDK (PHP)
========================

[](#flowscribe-ocr-sdk-php)

PHP client for connecting to the Robo-Meister FlowScribe OCR API and Robo Connector / Universal Dropzone OCR flows.

Install
-------

[](#install)

```
composer require robo-meister/flow-scribe-api
```

For local development from this repository, add the package as a path repository:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "shared-profile/sdk/flowscribe-ocr/php"
    }
  ],
  "require": {
    "robo-meister/flow-scribe-api": "*"
  }
}
```

Basic OCR
---------

[](#basic-ocr)

```
use Robo\FlowScribeOcr\FlowScribeOcrClient;

$client = new FlowScribeOcrClient(
    baseUrl: 'https://ocr.robo-meister.com'
);

$health = $client->health();
$metadata = $client->metadata();

$result = $client->processDocument(__DIR__ . '/invoice.pdf', [
    'document_type' => 'invoice',
    'mode' => 'fuse',
    'journal_csv' => true,
]);

if (($result['exit_code'] ?? 1) === 0) {
    $parsed = $result['parsed'] ?? [];
    $csv = $result['csv'] ?? null;
}
```

Robo Connector and Universal Dropzone options
---------------------------------------------

[](#robo-connector-and-universal-dropzone-options)

`processDocument()`, `ingestFlowScribe()`, and `ingestRcInvoice()` accept the same metadata options so OCR results can be linked back to Robo Connector documents:

```
$result = $client->processDocument(__DIR__ . '/upload.pdf', [
    'document_type' => 'auto',
    'mode' => 'fuse',
    'source_document_id' => 'doc_123',
    'workspace_id' => 'workspace_123',
    'org_id' => 'org_123',
    'user_id' => 'user_123',
    'context_type' => 'UniversalDropzone',
    'context_id' => 'dropzone_upload_123',
    // Connector base URL; FlowScribe appends /api/integration/document/ocr-completed.
    'rc_callback_url' => 'https://connector.example.com',
    'document_name' => 'Vendor invoice.pdf',
    'return_review_payload' => true,
    'include_storage' => true,
    'include_preview' => true,
    'idempotency_key' => 'upload-doc_123-v1',
    'correlation_id' => 'corr_123',
]);
```

`rc_callback_url` is the Robo Connector base URL, not the final callback endpoint; FlowScribe appends `/api/integration/document/ocr-completed` when it calls back.

When these options are present, the SDK sends the important values as multipart form fields. It also mirrors routing/correlation values to headers: `X-Workspace-Id`, `X-Org-Id`, `X-Source-Document-Id`, `X-Correlation-Id`, `Idempotency-Key`, and `X-RC-Callback-Url`.

### `auto` document type behavior

[](#auto-document-type-behavior)

Use `'document_type' => 'auto'` when you want the API to classify the dictionary. By default, the PHP SDK **does not send** a `document_type=auto` multipart field; omitting the override lets FlowScribe use server-side auto-classification. If you are integrating with an API deployment that explicitly requires the literal string `auto`, pass `'send_auto_document_type' => true`.

Universal Dropzone integration
------------------------------

[](#universal-dropzone-integration)

Authenticated integration routes require an access token generated by the Robo Connector link flow. The SDK sends the token as a bearer token.

```
use Robo\FlowScribeOcr\FlowScribeOcrClient;

$client = new FlowScribeOcrClient(
    baseUrl: 'https://ocr.robo-meister.com',
    accessToken: getenv('FLOWSCRIBE_ACCESS_TOKEN') ?: null
);

$queued = $client->ingestUniversalDropzoneDocument(__DIR__ . '/dropzone.pdf', [
    'source_document_id' => 'doc_123',
    'workspace_id' => 'workspace_123',
    'org_id' => 'org_123',
    'context_type' => 'UniversalDropzone',
    'context_id' => 'upload_123',
    // Connector base URL; FlowScribe appends /api/integration/document/ocr-completed.
    'rc_callback_url' => 'https://connector.example.com',
    'idempotency_key' => 'upload_123',
    'correlation_id' => 'corr_123',
]);

$jobId = $queued['data']['job']['id'];
$status = $client->flowScribeStatus($jobId);
```

`processDocumentForReview()`, `ingestUniversalDropzoneDocument()`, and `ingestRcDocument()` set review-friendly defaults: `document_type=auto`, `mode=fuse`, `return_review_payload=true`, `include_storage=true`, and `include_preview=true`.

For the legacy RC invoice OCR bridge, `ingestRcInvoice()` and `rcInvoiceStatus()` remain available. For non-invoice Robo Connector documents, prefer `ingestRcDocument()`:

```
$queued = $client->ingestRcDocument(__DIR__ . '/contract.pdf', [
    'source_document_id' => 'doc_456',
    'workspace_id' => 'workspace_123',
    'org_id' => 'org_123',
    'document_name' => 'Customer contract.pdf',
]);
```

Handling review payloads
------------------------

[](#handling-review-payloads)

```
$result = $client->processDocumentForReview(__DIR__ . '/invoice.pdf', [
    'workspace_id' => 'workspace_123',
    'org_id' => 'org_123',
]);

$reviewPayload = $result['review_payload'] ?? null;
$preview = $result['preview'] ?? null;
$storage = $result['storage'] ?? null;
```

Diagnostics
-----------

[](#diagnostics)

`diagnostics()` first calls `/api/integration/flowscribe/diagnostics` with optional org/workspace headers. If that endpoint is not available, it falls back to `/health` and `/metadata`.

```
$diagnostics = $client->diagnostics(
    organisationId: 'org_123',
    workspaceId: 'workspace_123'
);

if (($diagnostics['diagnostics_available'] ?? true) === false) {
    $health = $diagnostics['health'];
    $metadata = $diagnostics['metadata'];
}
```

Custom dictionary config
------------------------

[](#custom-dictionary-config)

Pass either a JSON file path:

```
$result = $client->processDocument(__DIR__ . '/invoice.pdf', [
    'config_path' => __DIR__ . '/custom-dictionary.json',
]);
```

Or pass an array that the SDK serializes as `config.json` for the multipart upload. Temporary config files are deleted after each request.

```
$result = $client->processDocument(__DIR__ . '/invoice.pdf', [
    'config' => [
        'fields' => [
            'invoiceNumber' => ['keywords' => ['Invoice #']],
        ],
    ],
]);
```

Errors
------

[](#errors)

HTTP and transport failures throw `FlowScribeOcrException`. HTTP errors preserve the status code, decoded response body, raw response body, response correlation ID, and machine-readable error code when available.

```
use Robo\FlowScribeOcr\FlowScribeOcrException;

try {
    $result = $client->processDocument(__DIR__ . '/invoice.pdf');
} catch (FlowScribeOcrException $exception) {
    $statusCode = $exception->getStatusCode();
    $responseBody = $exception->getResponseBody();
    $rawBody = $exception->getRawResponseBody();
    $correlationId = $exception->getCorrelationId();
    $errorCode = $exception->getErrorCode();
}
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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 ~29 days

Total

2

Last Release

25d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/211215651?v=4)[Robo Meister](/maintainers/Robo-Meister)[@Robo-Meister](https://github.com/Robo-Meister)

---

Top Contributors

[![Apacz](https://avatars.githubusercontent.com/u/1978681?v=4)](https://github.com/Apacz "Apacz (2 commits)")

### Embed Badge

![Health badge](/badges/robo-meister-flow-scribe-api/health.svg)

```
[![Health](https://phpackages.com/badges/robo-meister-flow-scribe-api/health.svg)](https://phpackages.com/packages/robo-meister-flow-scribe-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k18](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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