← All channels

REST

stable

Bi-directional REST API for programmatic clients.

In
Out
Auth
API key
§ Required environment

Env vars

IRIS_REST_API_KEY
Required

API key required on the Authorization: Bearer header.

IRIS_REST_BIND
Optional

Bind address for the REST listener (default 127.0.0.1:7777).

§ Setup

Step by step

  1. 01

    Generate an API key

    Pick a long random string. Treat it like a password.

    export IRIS_REST_API_KEY="$(openssl rand -hex 32)"
  2. 02

    Enable the channel

    REST starts on 127.0.0.1:7777 unless overridden.

    iris channels enable rest
  3. 03

    Hit it

    Send a task.

    curl -H "Authorization: Bearer $IRIS_REST_API_KEY" \
      -d '{"task": "summarise inbox"}' \
      http://127.0.0.1:7777/v1/tasks
§ Success

You're done when

  • Unauthenticated requests return 401
  • POST /v1/tasks accepts JSON and returns a task ID
  • GET /v1/tasks/{id} streams the task transcript