METIS ACCELERATING AMERICAN MANUFACTURING METIS
Menu

DOCS / INTEGRATION

PLC file-tree webhook.

Push a full PLC file tree to Metis over HTTPS. A monthly dump with replace: true overwrites the existing tree for the company bound to your API key.

ENDPOINT

METHOD
POST
URL
https://plc.metistech.io/api/v1/plc/webhook
AUTH
Authorization: Bearer <API_KEY>
CONTENT-TYPE
application/json

Authentication

Use the API key Metis issues for your plant. Send it as a Bearer token:

Authorization: Bearer sk_…

The key is scoped to your company — do not send a company or tenant id in the request. Store the key in your secrets manager — never commit it to source control or paste it into tickets.

Full-tree replace

For the monthly dump, always set "replace": true. Metis clears the existing PLC tree for your company, then writes every file in the payload. Paths not present in the new dump are removed. Omit replace (or set false) only when you intend to append or update without wiping the tree.

Request body

{
  "replace": true,
  "message": "Monthly plant dump 2026-07",
  "files": [
    {
      "path": "Artiflex PLC Files Wooster/A-20.SLC",
      "content_base64": "<base64 of file bytes>",
      "content_type": "application/octet-stream"
    },
    {
      "path": "Artiflex PLC Files Wooster/RH4 Main PLC.L5K",
      "content_base64": "<base64 of file bytes>"
    }
  ]
}
  • files — non-empty array. Each entry needs a relative path (forward slashes) and content_base64 (standard base64 of the raw file; allow ~33% size overhead).
  • content_type — optional MIME type string.
  • replace — optional boolean; default false. Use true for monthly full syncs.
  • message — optional commit note stored on the new version (trimmed; truncated to 500 characters). Useful for labeling monthly dumps or CI builds.

Each successful push creates a new immutable version with source: "webhook". Full-tree replace still works the same — Metis keeps prior versions for history and restore in the admin UI.

Limits

PER FILE

20 MB

TREE TOTAL

200 MB

FILE COUNT

5,000

REQUEST BODY

250 MB

Base64 encoding increases the JSON body versus on-disk size. Stay under the request-body cap after encoding.

Example

Build a JSON file from your local PLC export directory, then POST it:

curl -sS -X POST 'https://plc.metistech.io/api/v1/plc/webhook' \
  -H "Authorization: Bearer $METIS_PLC_WEBHOOK_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @plc-dump.json

Responses

STATUS MEANING
201 Success. Body includes the written files plus the new version number and metadata:
400 Invalid body, path, base64, or size/count limit exceeded.
401 Missing or invalid API key.
403 Key is valid but not authorized for this webhook.
409 Concurrent write conflict on the company tree. Retry the request.
{
  "success": true,
  "files": [ { "path", "size", "updated_at" } ],
  "version": 12,
  "version_meta": {
    "created_at": "2026-07-22T15:00:00+00:00",
    "source": "webhook",
    "message": "Monthly plant dump 2026-07",
    "parent": 11
  }
}
  • version — integer HEAD version created by this push.
  • version_meta.source — always "webhook" for this endpoint.
  • version_meta.message — the optional note from the request (or null).
  • version_meta.parent — previous HEAD version, or null for the first version.
  • version_meta.created_at — ISO-8601 timestamp.