`POST /api/resources` — create a resource. The secret (if any) is stored in vault under `workflows/resources/<workspace>/<id>`; the response only surfaces `has_secret`.
POST
/api/resources
const url = 'https://example.com/api/resources';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"config":"example","kind":"example","name":"example","secret":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/resources \ --header 'Content-Type: application/json' \ --data '{ "config": "example", "kind": "example", "name": "example", "secret": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
config
kind
required
string
name
required
string
secret
The secret part (e.g. SMTP password, bot token, webhook Authorization header value). Required only when the kind/config demands one.
string | null
Examplegenerated
{ "config": "example", "kind": "example", "name": "example", "secret": "example"}Responses
Section titled “Responses”Media typeapplication/json
What every HTTP handler returns — a resource row without secret material.
The DB row already redacts secret_vault_path via #[serde(skip)]; this
DTO mirrors the wire shape so external callers see the same fields they
can supply on create.
object
config
required
created_at
required
string format: date-time
has_secret
required
true iff a secret is stored for this resource — useful to the UI
for an “update secret” toggle, without ever leaking the secret itself.
boolean
id
required
string format: uuid
kind
required
string
last_test_ok
#358: the result of that last probe (Some(true)/Some(false)/None).
boolean | null
last_tested_at
#358: when the last test-connection probe ran (None = never tested).
string | null format: date-time
max_concurrent_uses
Issue #110: per-resource concurrency cap; None = unlimited.
integer | null format: int32
name
required
string
updated_at
required
string format: date-time
workspace_id
required
string format: uuid
Examplegenerated
{ "config": "example", "created_at": "2026-04-15T12:00:00Z", "has_secret": true, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "kind": "example", "last_test_ok": true, "last_tested_at": "2026-04-15T12:00:00Z", "max_concurrent_uses": 1, "name": "example", "updated_at": "2026-04-15T12:00:00Z", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}