RAiN — Rivium AI Network
Back to Help

Endpoint — letting the client's own system call your Sequence

Everything you build in the studio can be run by the client's own software: a web form, a shopping cart, a loan application, their CRM. One request in, one answer out.

Find it under Settings in the project workspace.

The address

POST https://api.rain.com.ng/endpoint/run

That's the address the client puts in their system, and it's a name RAiN owns on purpose. Anything integrating against a hosting provider's own URL is tied to that provider forever, and moving would break every client at once — quietly, on a Tuesday.

Making a key

Under Settings → Endpoint, give the key a name — "Our CRM", "the website form" — and create it.

The key is shown once. Only a fingerprint of it is stored, so there is no way to read it back, and no support request that can recover it. Copy it into the client's system there and then. If it's lost, revoke it and make another; that takes seconds and is much safer than a key nobody can account for.

Name each key after the system it lives in. When you eventually need to turn one off, you'll want to know what you're switching off.

Calling it

curl -X POST https://api.rain.com.ng/endpoint/run \
  -H "Authorization: Bearer YOUR_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "the enquiry text"}'

The answer comes back with the run id and the result. It isn't streamed — the client's system asks a question and waits for an answer, which is what a server wants. Watching a run step by step is what the Execution tab is for.

The key decides which project runs. There is no project id in the request, so there's nothing a caller could change to reach somebody else's work.

Where the run starts

If your canvas has a When called trigger, the call arrives there and the run begins at whatever that trigger points to.

That matters on a canvas with more than one trigger. A nightly sweep and a cart posting in are usually two different first steps, and entering at the wrong one would run the wrong half of the solution.

Turning one off

Revoke it under Settings. The next call with that key is refused. Other keys on the same project keep working, which is why one key per system is worth the small extra effort.

Questions people ask

Do I need a key for every client? One per system is the useful unit. If a client has a website form and a CRM calling the same project, two keys means you can turn one off without touching the other, and the list tells you which is which.

Can I see whether a key is being used? Yes — the key list shows when each was last used, or Never if nothing has called it yet. That's the fastest way to tell whether an integration is really live.

What happens if the client calls it too often? The daily run limit applies exactly as it does in the studio. Past the limit, calls are refused with a message saying so and it resets at midnight UTC.

Is it safe to put the key in their code? It belongs on their server, not in a web page or a mobile app. Anything in a browser is readable by anyone who opens it. If they need to call from a browser, their server should make the call.

Can I test it before handing it over? Yes. The Settings panel shows a ready-made example with your project's address in it — run that from your own machine and you'll see exactly what the client will see.

Does the endpoint work while I'm still editing the canvas? Yes, and that's worth knowing: it runs whatever the project currently says. If a client's system is live against it, finish your edits before they call.

Can I hand the whole solution over instead? Download exports the project — the agents, the steps, the triggers, and how it reports. See Sequences.


Related: Trigger · Running agents & reading traces · Sequences