Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview

Start reconnecting an OAuth credential

Starts a new OAuth connection for an oauth credential, for the credential’s own target or origins and name, through the workspace OAuth client it was connected through, or else with a fresh discovery and client registration. Completing it through the complete route replaces the credential’s payload in place, keeping its id, and clears reconnect_required.

POST/v1/vaults/{vault_id}/credentials/{credential_id}/oauth
Authorization
AuthorizationBearer token · headerrequired
Path parameters
vault_idstring<uuid>required
Vault id
credential_idstring<uuid>required
Credential id
Header parameters
Idempotency-Keystring
Retry 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/json
redirect_uristringrequired
The client's own page the provider sends the browser back to, as starting a connection takes it.
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>required
201Started.
authorization_urlstringrequired
expires_atstring<date-time>required
400Malformed body; a credential that is not `oauth`; or a target whose authorization server cannot be discovered, does not support dynamic client registration, or refused the registration.
errorErrorDetailrequired
What 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 properties
codeErrorCoderequired
The 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_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
What 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 properties
codeErrorCoderequired
The 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_requestsinternal
messagestringrequired
403Caller lacks credential.manage, or the organization may not create.
errorErrorDetailrequired
What 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 properties
codeErrorCoderequired
The 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_requestsinternal
messagestringrequired
404No such vault or credential, or the caller cannot see it.
errorErrorDetailrequired
What 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 properties
codeErrorCoderequired
The 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_requestsinternal
messagestringrequired
409Idempotency-Key was already used for a different request.
errorErrorDetailrequired
What 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 properties
codeErrorCoderequired
The 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_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.us.cloud.subako.ai/v1/vaults/497f6eca-6276-4993-bfeb-53cbbbba6f08/credentials/497f6eca-6276-4993-bfeb-53cbbbba6f08/oauth" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "redirect_uri": "string"
}'
Response
{
  "expires_at": "2019-08-24T14:15:22Z"
}