---
title: "Create a connection (material in body, sealed on arrival) [org:write + admin; this door only]"
method: POST
path: "/preview/connections"
tags: ["connections"]
---

# Create a connection (material in body, sealed on arrival) \[org:write + admin; this door only\]

`POST /preview/connections`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/connections`
- Auth: HTTP bearer

Create a connection (material in body, sealed on arrival) [org:write + admin; this door only]

## Query parameters

- `workspace` string

## Request body

- object
  - `access_key_id` string, nullable: s3-keys identity.
  - `auth` string, nullable: How access is established: "token" (a pasted secret, the default) or "oauth" (huggingface only - a browser consent dance through WorkOS Pipes; no material exists anywhere our side, tokens are minted at use).
  - `endpoint` string, nullable
  - `header` string, nullable: https identity: the header the material rides (default "authorization", value "Bearer <material>").
  - `kind` string, required
  - `material` string, nullable: The secret half (s3 secret key, HF token, bearer). Sealed on arrival, never echoed by anything. NEVER an MCP parameter - this struct is deliberately not a tool schema.
  - `name` string, required
  - `org` string, nullable: Act in this org (uuid or name); omitted = the bound/active org.
  - `region` string, nullable
  - `scope` string, required: The human-facing scope pin (e.g. "s3://acme-ml/corpus-v3/", "acme/*", "https://data.corp.example/exports/").
  - `username` string, nullable: registry identity: the login name the token belongs to - a GHCR username, a Quay/Harbor robot account, "_json_key" for a GCP Artifact Registry service-account key. Non-secret; the token itself rides `material`.
  - `validate` boolean, nullable: Live-validate against the provider before saving (s3-keys: a one-object listing under the pin). Default true; Terraform-ish bootstrap passes false.
  - `verbs` string[], nullable: What the connection may do: ["read"] (the default) or ["read", "write"] (docs/designs/secrets.md: write enables export_data pushes to the pin). The customer's own provider policy is the real wall; this is our enforcement of intent.

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
