Connections

Connections store the information needed to connect a StackAI flow to an external provider, like Slack or Google Drive. Some connection providers also can be used as an information source, meaning we can read the files and folders in the connection and index them in a knowledge base to be used in a flow.

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
get
GET /connections/available HTTP/1.1
Host: 
Accept: */*
200

Successful Response

[
  {
    "icon": "text",
    "id": "text",
    "name": "text",
    "description": "text",
    "labels": [
      "text"
    ],
    "params": [
      {
        "label": "text",
        "type": "string",
        "placeholder": "text",
        "default": 1,
        "help": "text",
        "url": "text",
        "required": true,
        "name": "text"
      }
    ],
    "minimum_plan": "text",
    "is_marketing_stunt": false,
    "connection_type": "credentials"
  }
]

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
get
GET /connections HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "name": "Unnamed connection",
    "connection_id": "123e4567-e89b-12d3-a456-426614174000",
    "user_id": "123e4567-e89b-12d3-a456-426614174000",
    "org_id": "text",
    "share_with_org": false,
    "created_at": "2025-07-14T13:09:58.138555+00:00",
    "updated_at": "2025-07-14T13:09:58.138644+00:00",
    "connection_provider": "text",
    "connection_provider_data": {
      "can_be_knowledge_base": true
    },
    "created_by": {
      "avatar_url": "text",
      "full_name": "text",
      "has_completed_onboarding": true,
      "last_signed_in": "text",
      "updated_at": "text",
      "id": "text",
      "email": "text"
    }
  }
]

Create Connection

post

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

Authorizations
Body

Request model for creating/updating a connection.

namestringOptionalDefault: Unnamed connection
connection_providerstringRequired
connection_provider_dataobject · BaseConnectionDataModelRequired

Base data model for all connections.

Responses
201
Successful Response
application/json
post
POST /connections HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "name": "Unnamed connection",
  "connection_provider": "text",
  "connection_provider_data": {}
}
{
  "name": "Unnamed connection",
  "connection_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": "text",
  "share_with_org": false,
  "created_at": "2025-07-14T13:09:58.138555+00:00",
  "updated_at": "2025-07-14T13:09:58.138644+00:00",
  "connection_provider": "text",
  "connection_provider_data": {
    "can_be_knowledge_base": true
  },
  "created_by": {
    "avatar_url": "text",
    "full_name": "text",
    "has_completed_onboarding": true,
    "last_signed_in": "text",
    "updated_at": "text",
    "id": "text",
    "email": "text"
  }
}

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
get
GET /connections/{connection_id} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "name": "Unnamed connection",
  "connection_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": "text",
  "share_with_org": false,
  "created_at": "2025-07-14T13:09:58.138555+00:00",
  "updated_at": "2025-07-14T13:09:58.138644+00:00",
  "connection_provider": "text",
  "connection_provider_data": {
    "can_be_knowledge_base": true
  }
}

Update Connection

put

Update the connection with the given id.

Authorizations
Path parameters
connection_idstring · uuidRequired
Body

Request model for creating/updating a connection.

namestringOptionalDefault: Unnamed connection
connection_providerstringRequired
connection_provider_dataobject · BaseConnectionDataModelRequired

Base data model for all connections.

Responses
200
Successful Response
application/json
put
PUT /connections/{connection_id} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "name": "Unnamed connection",
  "connection_provider": "text",
  "connection_provider_data": {}
}
{
  "name": "Unnamed connection",
  "connection_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": "text",
  "share_with_org": false,
  "created_at": "2025-07-14T13:09:58.138555+00:00",
  "updated_at": "2025-07-14T13:09:58.138644+00:00",
  "connection_provider": "text",
  "connection_provider_data": {
    "can_be_knowledge_base": true
  },
  "created_by": {
    "avatar_url": "text",
    "full_name": "text",
    "has_completed_onboarding": true,
    "last_signed_in": "text",
    "updated_at": "text",
    "id": "text",
    "email": "text"
  }
}

Delete Connection

delete

Delete a connection given its ID.

Authorizations
Path parameters
connection_idstring · uuidRequired
Responses
204
Successful Response
delete
DELETE /connections/{connection_id} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
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
GET /connections/{connection_id}/health HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
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
patch
PATCH /connections/{connection_id}/share-with-current-org?share=true HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "name": "Unnamed connection",
  "connection_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": "text",
  "share_with_org": false,
  "created_at": "2025-07-14T13:09:58.138555+00:00",
  "updated_at": "2025-07-14T13:09:58.138644+00:00",
  "connection_provider": "text",
  "connection_provider_data": {
    "can_be_knowledge_base": true
  }
}

Get Oauth Url

post

Return the OAuth URL for a connection provider.

Authorizations
Body

Request model for creating/updating a connection.

namestringOptionalDefault: Unnamed connection
connection_providerstringRequired
connection_provider_dataobject · BaseConnectionDataModelRequired

Base data model for all connections.

Responses
200
Successful Response
application/json
Responsestring
post
POST /connections/oauth/start HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "name": "Unnamed connection",
  "connection_provider": "text",
  "connection_provider_data": {}
}
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

Request model for creating/updating a connection.

namestringOptionalDefault: Unnamed connection
connection_providerstringRequired
connection_provider_dataobject · BaseConnectionDataModelRequired

Base data model for all connections.

Responses
201
Successful Response
application/json
post
POST /connections/oauth/callback?code=text HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "name": "Unnamed connection",
  "connection_provider": "text",
  "connection_provider_data": {}
}
{
  "name": "Unnamed connection",
  "connection_id": "123e4567-e89b-12d3-a456-426614174000",
  "user_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": "text",
  "share_with_org": false,
  "created_at": "2025-07-14T13:09:58.138555+00:00",
  "updated_at": "2025-07-14T13:09:58.138644+00:00",
  "connection_provider": "text",
  "connection_provider_data": {
    "can_be_knowledge_base": true
  },
  "created_by": {
    "avatar_url": "text",
    "full_name": "text",
    "has_completed_onboarding": true,
    "last_signed_in": "text",
    "updated_at": "text",
    "id": "text",
    "email": "text"
  }
}

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
GET /connections/{connection_id}/resources HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "ANY_ADDITIONAL_PROPERTY": {
    "knowledge_base_id": "123e4567-e89b-12d3-a456-426614174000",
    "created_at": "2025-07-26T01:52:49.182Z",
    "modified_at": "2025-07-26T01:52:49.182Z",
    "indexed_at": "2025-07-26T01:52:49.182Z",
    "inode_type": "file",
    "resource_id": "text",
    "inode_path": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "dataloader_metadata": {
      "^[^\\t\\n\\r\\f\\v]+$": null
    },
    "user_metadata": {
      "^[^\\t\\n\\r\\f\\v]+$": null
    },
    "inode_id": "123e4567-e89b-12d3-a456-426614174000",
    "content_hash": "text",
    "content_mime": "text",
    "size": 1,
    "status": "resource"
  }
}

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
Responseobject
get
GET /connections/{connection_id}/resources/children HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{}
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
Responseobject
get
GET /connections/{connection_id}/resources/search?query=text HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{}

Was this helpful?