BR1N — Connect Your Project via API
This guide explains how to connect an existing project to BR1N using the BR1N API.
BR1N does not replace your infrastructure. It reads your project structure and optionally reacts to events you send.
There are two distinct flows:
- Project Import (read-only, metadata)
- Event Ingestion (runtime signals)
They use the same API key, but serve different purposes.
1. Create a BR1N API Key
In the BR1N dashboard:
- Go to Settings → API Keys
- Generate a new key
- Choose the environment:
testfor developmentlivefor production
- Copy the key (it is only shown once)
Example key:
br1n_sk_test_XXXXXXXXXXXXXXXXSecurity rules
- Store the key server-side only
- Never expose it in frontend code
- Rotate keys if leaked
2. Project Import (Required)
Project import lets BR1N discover and visualize your project:
- workflows
- triggers
- tools
- connections
Nothing executes. No secrets are shared.
2.1 Implement the introspection endpoint
Your project must expose the following endpoint:
GET /br1n/introspect
Authorization: Bearer <BR1N_API_KEY>This endpoint returns metadata only.
2.2 Introspection response format (required)
{
"project": {
"id": "my-project-id",
"name": "My Project",
"environment": "production"
},
"tools": [
{ "key": "stripe" },
{ "key": "resend" },
{ "key": "supabase" }
],
"connections": [
{
"external_id": "stripe_prod",
"integration_key": "stripe",
"metadata": {
"account_id": "acct_123"
}
}
],
"workflows": [
{
"external_id": "order_created_flow",
"name": "Order Created",
"triggers": [
{
"type": "webhook",
"event_key": "order.created"
}
],
"steps": [
{
"integration": "resend",
"function": "send_email"
}
]
}
]
}Rules
- All IDs must be stable
- No secrets
- No API keys
- No OAuth tokens
- Metadata only
2.3 What BR1N does with this data
When you connect a project in BR1N:
- BR1N calls
/br1n/introspect - Creates an import session
- Imports:
- workflows as read-only
- connections as external
- Shows everything visually in the UI
At this point:
- Nothing can run
- Nothing can modify your system
- BR1N is a mirror only
3. Event Ingestion (Optional, Runtime)
Event ingestion lets your project notify BR1N that something happened.
This is how workflows get evaluated.
3.1 Send an event
POST /api/v1/events
Authorization: Bearer <BR1N_API_KEY>
Content-Type: application/json{
"event": "user.signup",
"data": {
"userId": "123",
"email": "user@example.com"
},
"idempotencyKey": "optional-unique-key"
}What happens
- Event is stored
- Matching workflows are evaluated
- Only explicitly enabled BR1N-managed steps can execute
External steps are never executed.
4. Hybrid Execution (Key Concept)
BR1N supports partial orchestration.
Example:
- Your project already sends emails
- You want BR1N to send SMS only
Flow:
- Import project → everything is external
- Convert only Twilio to a managed connection
- Your project sends:
{ "event": "user.signup" } - BR1N:
- Evaluates workflow
- Skips external steps
- Executes only Twilio
This is intentional and safe.
5. What BR1N Will Never Do
- Never pull provider secrets
- Never execute imported logic
- Never mutate your project
- Never require OAuth for imports
- Never guess your architecture
6. Common Setup Pattern
7. FAQ
Do I need to change my existing architecture?
No. You only add:
- one introspection endpoint
- optional event calls
Can I test this locally?
Yes.
- Use
br1n_sk_test_… - Point BR1N to your local or staging URL
Is BR1N replacing my backend?
No. BR1N is a control plane, not your runtime.
Can I send events without importing?
Yes, but you won't get visual workflows.
Import is strongly recommended.
Final summary
You connect a project to BR1N by exposing a single introspection endpoint authenticated with a BR1N API key. BR1N imports immutable metadata, and optionally reacts to runtime events by executing only explicitly managed connections.
That's the whole system.