Skip to content

credentials

Store the header a URL source sends to a feed that needs a key, or a secret another kind of source uses. Values are write-only: no route ever returns one.

Every route here is a POST to /_emdash/api/plugins/fluximporter/<route> with a JSON body, and needs an Administrator. See Before you call the API for authentication, the response envelope and the errors any route can return. None of these routes is an MCP tool.

A header credential is one HTTP header, such as Authorization: Bearer … or X-Api-Key: …, stored under a name. A URL source names the credential, and every fetch of that source sends the header. From version 0.9.0, a credential can instead be a secret: a value with no header, such as a private key, which only other kinds of source use. A URL source can’t name a secret. Credentials are stored encrypted in the plugin’s settings, so the site needs EMDASH_ENCRYPTION_KEY set. See URL sources and credentials.

Route What it does MCP tool
credentials/set Adds or replaces a credential none
credentials/list Lists credential names and headers none
credentials/delete Deletes a credential none

Every route can also answer CREDENTIALS_UNAVAILABLE (500) when the stored credentials can’t be read, usually because EMDASH_ENCRYPTION_KEY is missing or wrong. credentials/set and credentials/delete answer CONFLICT (409) when other changes kept landing at the same time; try again.

POST /_emdash/api/plugins/fluximporter/credentials/set

Adds a credential, or replaces the one with the same name. The body is either a header credential or, from version 0.9.0, a secret.

A header credential:

Field Type Required Notes
name string yes 1 to 64 characters from a-z, 0-9 and -.
header string yes A valid HTTP header name, at most 100 characters. Not Host, Cookie, Content-Length, Transfer-Encoding, Connection, Keep-Alive, Proxy-Connection, Proxy-Authenticate, Proxy-Authorization, TE, Trailer, Upgrade, If-None-Match or If-Modified-Since.
value string yes 1 to 4,096 printable ASCII characters (tabs allowed), without CR or LF.

A secret:

Field Type Required Notes
name string yes 1 to 64 characters from a-z, 0-9 and -.
kind string yes "secret".
value string yes 1 to 16,384 characters. Tabs, LF and CR are allowed; other control characters aren’t.

Response: { name, kind, header } for a header (kind is "header"), { name, kind } for a secret (kind is "secret"), never the value. kind is new in version 0.9.0.

Terminal window
curl -X POST "https://example.com/_emdash/api/plugins/fluximporter/credentials/set" \
-H "Authorization: Bearer $EMDASH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"supplier-key","header":"Authorization","value":"Bearer sk_live_REPLACE_ME"}'
{ "success": true, "data": { "name": "supplier-key", "kind": "header", "header": "Authorization" } }

POST /_emdash/api/plugins/fluximporter/credentials/list

Takes {} and answers with every credential’s name, kind and, for a header, the header, sorted by name, without values. Credentials saved before version 0.9.0 are headers.

{
"success": true,
"data": [
{ "name": "nightly-stock-privatekey", "kind": "secret" },
{ "name": "supplier-key", "kind": "header", "header": "Authorization" }
]
}

POST /_emdash/api/plugins/fluximporter/credentials/delete

Field Type Required Notes
name string yes The credential’s name.

Response: { "deleted": true }.

Errors: NOT_FOUND (404) when no credential has this name.

Deleting a credential doesn’t change the sources that name it: their next fetch fails with CREDENTIAL_MISSING, and a schedule that reads one pauses.