Start connecting a credential through OAuth
Takes the client Subako presents to the provider and answers the URL to send the browser to. An mcp credential connects through the workspace OAuth client oauth_client_id names, or else Subako discovers the MCP server’s authorization server and registers a client with it for redirect_uri. An http credential always connects through a workspace OAuth client, and is sent to its origins as authorization: Bearer. The provider sends the browser back to redirect_uri with code and state, and the same caller completes the connection with them, once, within ten minutes.
POST
/v1/vaults/{vault_id}/credentials/oauthAuthorization
AuthorizationBearer token · headerrequiredPath parameters
vault_idstring<uuid>requiredVault id
Header parameters
Idempotency-KeystringRetry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Request body
requiredapplication/jsonOne of:
object
display_namestringrequiredmax length 200
oauth_client_idstring<uuid> | nullThe workspace OAuth client to connect through, for a server whose
provider registers no client on the spot. Omitted, Subako
discovers the provider and registers a client there itself.
protocolstringrequiredAllowed:
mcpredirect_uristringrequiredThe client's own page the provider sends the browser back to, with
`code` and `state` (or `error`) in its query: an absolute http(s)
URL without a fragment.
min length 1 · max length 2048
targetstringrequiredThe MCP server's URL. Without `oauth_client_id`, it must answer an
unauthenticated request with a challenge naming its protected
resource metadata, or publish that metadata at its well-known URL,
and its authorization server must register clients on the spot.
min length 1 · max length 2048
object
display_namestringrequiredmax length 200
oauth_client_idstring<uuid>requiredThe workspace OAuth client to connect through.
originsHttpOriginBody[]requiredThe origins the credential is sent to, each at most once, and
none another credential in the vault is already sent to.
min items 1 · max items 16
protocolstringrequiredAllowed:
httpredirect_uristringrequiredAs for `mcp`.
min length 1 · max length 2048
Responses
200Replayed start receipt. The authorization URL cannot be recovered; start again with a new Idempotency-Key.
expires_atstring<date-time>required201Started.
authorization_urlstringrequiredexpires_atstring<date-time>required400Malformed body; an `mcp` target without an OAuth client that is not OAuth protected, whose authorization server cannot be discovered, does not support dynamic client registration, or refused the registration; or a target, origin, or endpoint the deployment's network policy does not reach.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired401Missing, malformed, or invalid bearer token.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired403Caller lacks credential.manage, or the organization may not create.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired404No such vault, or the caller cannot see it; or no such OAuth client in the vault's workspace.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired409Idempotency-Key was already used for a different request. Duplicate credential target, or an origin another credential in the vault is already sent to.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired