Connections

Get Available Connections

get

List all available connections that can be configured.

Returns a list of available connection types with their configuration parameters.

Responses
200

Successful Response

application/json
Responseany[]
get
/connections/available
GET /connections/available HTTP/1.1
Host: api.stack-ai.com
Accept: */*
200

Successful Response

[]

Get Connections

get

List all available connections for the user in his current organization.

Authorizations
Query parameters
connection_providerany ofOptional
stringOptional
or
nullOptional
limitintegerOptionalDefault: 100
offsetintegerOptionalDefault: 0
Responses
200

Successful Response

application/json
Responseany[]
get
/connections
GET /connections HTTP/1.1
Host: api.stack-ai.com
Accept: */*
[]

Create Connection

post

Create a new connection. The connection will be created in the user's current organization.

Authorizations
Body
anyOptional
Responses
201

Successful Response

application/json
Responseany
post
/connections
POST /connections HTTP/1.1
Host: api.stack-ai.com
Content-Type: application/json
Accept: */*

No content

Get Connection By Id

get

Retrieve a connection by its ID.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
Responseany
get
/connections/{connection_id}
GET /connections/{connection_id} HTTP/1.1
Host: api.stack-ai.com
Accept: */*

No content

Update Connection

put

Update the connection with the given id.

Authorizations
Path parameters
connection_idstring · uuidRequired
Body
anyOptional
Responses
200

Successful Response

application/json
Responseany
put
/connections/{connection_id}
PUT /connections/{connection_id} HTTP/1.1
Host: api.stack-ai.com
Content-Type: application/json
Accept: */*

No content

Delete Connection

delete

Delete a connection given its ID.

Authorizations
Path parameters
connection_idstring · uuidRequired
Responses
204

Successful Response

No content

delete
/connections/{connection_id}
DELETE /connections/{connection_id} HTTP/1.1
Host: api.stack-ai.com
Accept: */*

No content

Get Connection Health

get

Check the health of a connection.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
Responseobject · ResponseGetConnectionHealthConnectionsConnectionIdHealthGet
get
/connections/{connection_id}/health
GET /connections/{connection_id}/health HTTP/1.1
Host: api.stack-ai.com
Accept: */*
{}

Share With Org

patch

Share the connection with the current organization.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
sharebooleanRequired
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
Responseany
patch
/connections/{connection_id}/share-with-current-org
PATCH /connections/{connection_id}/share-with-current-org?share=true HTTP/1.1
Host: api.stack-ai.com
Accept: */*

No content

Get Oauth Url

post

Return the OAuth URL for a connection provider.

Authorizations
Body
anyOptional
Responses
200

Successful Response

application/json
Responsestring
post
/connections/oauth/start
POST /connections/oauth/start HTTP/1.1
Host: api.stack-ai.com
Content-Type: application/json
Accept: */*
text

Create Connection From Callback

post

Create a new connection from an OAuth callback.

This endpoint is used to create a new connection for providers that use the OAuth protocol. The OAuth flow is initialized by the stack frontend, where the user is redirected to the provider's authorization page. Once the user authorizes the application, they are redirected back to the stack frontend with a code parameter. This code is then sent to this endpoint, which uses it to create a new connection for said provider completing the OAuth flow.

Authorizations
Query parameters
codestringRequired
Body
anyOptional
Responses
201

Successful Response

application/json
Responseany
post
/connections/oauth/callback
POST /connections/oauth/callback?code=text HTTP/1.1
Host: api.stack-ai.com
Content-Type: application/json
Accept: */*

No content

Get Connection Resources

get

Get the resources associated with a connection.

This endpoint returns the information for the selected resource in the connection.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
resource_idsstring[]Optional
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
get
/connections/{connection_id}/resources
GET /connections/{connection_id}/resources HTTP/1.1
Host: api.stack-ai.com
Accept: */*
{
  "ANY_ADDITIONAL_PROPERTY": null
}

Get Children Resources

get

Get the children of a resource associated with a connection.

This endpoint can be used to navigate the resources in the connection. If no resource_id is provided, it will return the list of resources at the root of the connection. If a resource_id is provided, it will return the children of that resource. If the resource_id corresponds to a file, an empty list will be returned.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
resource_idany ofOptional
stringOptional
or
nullOptional
cursorany ofOptional

Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.

Example: ZXhhbXBsZV9jdXJzb3I=
stringOptional
or
nullOptional
page_sizeinteger · min: 1 · max: 1000Optional

Number of items to be returned in the page.

Default: 50
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
Responseany
get
/connections/{connection_id}/resources/children
GET /connections/{connection_id}/resources/children HTTP/1.1
Host: api.stack-ai.com
Accept: */*

No content

get

Search for resources in the connection that match the query.

Authorizations
Path parameters
connection_idstring · uuidRequired
Query parameters
querystringRequired

Search query string

cursorany ofOptional

Optional identifier for the page that should be returned. If it is not provided, the first page will be returned.

Example: ZXhhbXBsZV9jdXJzb3I=
stringOptional
or
nullOptional
page_sizeinteger · min: 1 · max: 1000Optional

Number of items to be returned in the page.

Default: 50
refresh_oauth_tokensbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
Responseany
get
/connections/{connection_id}/resources/search
GET /connections/{connection_id}/resources/search?query=text HTTP/1.1
Host: api.stack-ai.com
Accept: */*

No content

Was this helpful?