Connections
The 10 operations under connections, as typed calls on the generated REST client.
Connections
Available from @codespar/sdk 0.12.0; the version on npm is 0.12.0. Every example on this page is compiled against the installed package when these docs build: a call that does not type-check fails the build.
Every call below is cs.api reaching one operation of the OpenAPI document this page was generated from; the REST client overview explains request, response, the option bag and the errors. The values are placeholders shaped by the document.
import { } from "@codespar/sdk";
const = new ({ : .. });GET /v1/connections
/v1/connectionsList the connections in this project
const = await ..("/v1/connections");Parameters, body and every documented response: GET /v1/connections in the HTTP reference.
POST /v1/connections
/v1/connectionsRegister a provider key, or rotate the one already there
const = await ..("post", "/v1/connections", {
: {
: "srv_0000000000000000",
: "string",
: "Example",
: "user_0000000000000000",
: {}
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/connections in the HTTP reference.
GET /v1/connections/engine/{run_id}/status
/v1/connections/engine/{run_id}/statusPoll a browser-driven signup run
const = await ..("/v1/connections/engine/{run_id}/status", {
: {
: "run_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/connections/engine/{run_id}/status in the HTTP reference.
POST /v1/connections/start
/v1/connections/startBegin the Connect Link OAuth flow for a provider
const = await ..("/v1/connections/start", {
: {
: "srv_0000000000000000",
: "user_0000000000000000",
: "https://example.com/hook",
: "string"
}
});Parameters, body and every documented response: POST /v1/connections/start in the HTTP reference.
POST /v1/connections/subaccount/{id}/revoke
/v1/connections/subaccount/{id}/revokeRevoke a provisioned subaccount and try to delete it upstream
const = await ..("post", "/v1/connections/subaccount/{id}/revoke", {
: {
: "subaccount_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/connections/subaccount/{id}/revoke in the HTTP reference.
GET /v1/connections/subaccount/{id}/status
/v1/connections/subaccount/{id}/statusRead whether a provisioned subaccount can transact yet
const = await ..("/v1/connections/subaccount/{id}/status", {
: {
: "subaccount_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/connections/subaccount/{id}/status in the HTTP reference.
GET /v1/connections/{id}
/v1/connections/{id}Read one connection
const = await ..("/v1/connections/{id}", {
: {
: "conn_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/connections/{id} in the HTTP reference.
DELETE /v1/connections/{id}
/v1/connections/{id}Delete a revoked connection for good
const = await ..("/v1/connections/{id}", {
: {
: "conn_0000000000000000"
}
});Parameters, body and every documented response: DELETE /v1/connections/{id} in the HTTP reference.
POST /v1/connections/{id}/revoke
/v1/connections/{id}/revokeRevoke a connection and destroy its stored credential
const = await ..("/v1/connections/{id}/revoke", {
: {
: "conn_0000000000000000"
}
});Parameters, body and every documented response: POST /v1/connections/{id}/revoke in the HTTP reference.
PUT /v1/connections/{id}/webhook-secret
/v1/connections/{id}/webhook-secretSeed or rotate the secret that verifies this provider's inbound webhooks
const = await ..("/v1/connections/{id}/webhook-secret", {
: {
: "conn_0000000000000000"
},
: {
: "string"
}
});Parameters, body and every documented response: PUT /v1/connections/{id}/webhook-secret in the HTTP reference.