Skip to main content
POST
Create a connection

Authorizations

Authorization
string
header
required

An organization-scoped API key, minted in control under Settings → API keys. Every failure to authenticate answers one identical 401: "Provide a valid organization-scoped API key or an active session." Each operation names the one scope it is filed under, <resource>:<read|write>, where the resource is the first path segment after /api/v1/; a key minted today carries all 22 of them. Scopes are RECORDED — on the key and on every audit row — and are not yet enforced: no request is refused for want of one.

Headers

Idempotency-Key
string

Any unique string.

Body

application/json
app
string

CONNECT AN APP. A catalog slug (hubspot, exa) or a tool server's https:// URL. Present, the body is the app shape — placement and name are required, auth and discoveryUrl may follow, and nothing from the secret shape below may appear beside them. Absent, the body is the secret shape and key, kind and value are required.

placement
object

Where the connected app may be used. Required with app. More placements can be added afterwards.

name
string

What to call the connected app. Required with app; unique in the organization.

auth
object

How the person authenticates, with app. Omitted means a hosted sign-in.

discoveryUrl
string

With an app that is a tool server URL: its authorization server's metadata URL, when you know it. Omitted, Ergoly asks the server.

key
string

STORE A SECRET. The slug the agent and the gateway will know it by. Lowercase letters, digits, _ and -. Unique per scope. Required without app.

kind
enum<string>

How the gateway injects it. Required without app. oauth is not accepted here — an OAuth account is made by the connect flow, which is the only path that can revoke it later.

Available options:
api_key,
secret,
basic
value
string

The secret itself. Required without app. WRITE-ONLY: no response on this API returns it, and there is no route that reads it back.

scope
enum<string>

Which identities resolve it. Defaults to org.

Available options:
org,
worker,
client
workerId
string

Required when scope is worker.

clientId
string

Required when scope is client.

internalOnly
boolean

Hide it from client-tier eworks. Cannot be combined with a client scope — it would resolve for no one.

hosts
string[]

The hosts the gateway injects this credential on. At least one is required unless the key already has hosts: a credential no host points at is never injected.

A bare hostname — no scheme, path, port or wildcard.

Response

Success.

data
object
required