Skip to content

API: Connections

Connect a destination; the secret goes into the vault

POST /api/v1/connections: Connect a destination; the secret goes into the vault

Last updated:

POST/api/v1/connections

Authentication#

Send the secret in the header Authorization: Bearer <secret>: the local token in local mode, an API key in network mode. An API key needs the admin scope; the local token has every scope. See the API overview for both modes.

Request body#

Content type application/json.

NameTypeRequiredDescription
acceptsarray of stringyesWhat the destination may receive: text, image, video, audio, metadata, document.
endpointstringyesThe URL the connector calls first: https, or http for a loopback host.. min length 1
hostsarray of stringnoFurther hosts the connection may reach, at most 16; the host of the endpoint is always allowed.
kindstringyesThe kind of connection; test is the only one built in.. min length 1
labelstringyes1 to 60 characters, shown to the person.. min length 1
secretstringyesThe credential of the destination, 1 to 16384 bytes. It goes into the vault and is in no answer.. min length 1

Responses#

201 Created#

Content type application/json. Schema: Connection.

NameTypeRequiredDescription
acceptsarray of stringno
created_atstring (date-time)no
endpointstringno
hostsarray of stringno
idstringno
kindstringno
labelstringno
last_used_atstring (date-time) or nullno
secret_setbooleanno

400#

Validation failed; errors maps each field to its messages and issues lists each problem with its code, key and params

Content type application/problem+json. Schema: Problem.

401 Unauthorized#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

403#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

409#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

422 Unprocessable Content#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

429#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

Any other status#

Error (RFC 9457 problem details)

Content type application/problem+json. Schema: Problem.

curl -X POST "http://127.0.0.1:7878/api/v1/connections" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accepts": [
    "string"
  ],
  "endpoint": "string",
  "kind": "string",
  "label": "string",
  "secret": "string"
}'

Response examples

{
  "accepts": [
    "string"
  ],
  "created_at": "2006-01-02T15:04:05Z",
  "endpoint": "string",
  "hosts": [
    "string"
  ],
  "id": "string",
  "kind": "string",
  "label": "string",
  "last_used_at": "2006-01-02T15:04:05Z",
  "secret_set": false
}

The examples are built from the schemas of the OpenAPI document, so a value is a placeholder of its type. The fields that carry the real values are in the tables.