# Integrations API

> Complete API reference for Stack0 Integrations endpoints.

REST API endpoints for the Unified Integrations API. Access CRM, storage, communication, and productivity data from multiple providers through a single interface.

## Base URL

base-urlCopy

```
https://api.stack0.dev/v1
```

## Connectors

GET`/integrations/connectors`

List all available connectors.

#### QUERY PARAMETERS

| Parameter | Type | Description |
| --- | --- | --- |
| category | string | Filter by category: crm, storage, communication, productivity |

ResponseCopy

```
{  "data": [    {      "slug": "hubspot",      "name": "HubSpot",      "category": "crm",      "description": "CRM and marketing platform",      "features": ["contacts", "companies", "deals", "notes"],      "authType": "oauth2"    }  ]}
```

GET`/integrations/connectors/{slug}`

Get a specific connector by slug.

## Connections

GET`/integrations/connections`

List all connections for your project.

#### QUERY PARAMETERS

| Parameter | Type | Description |
| --- | --- | --- |
| connectorId | string | Filter by connector slug |
| status | string | Filter by status: connected, error, expired |

ResponseCopy

```
{  "data": [    {      "id": "conn_abc123",      "connectorSlug": "hubspot",      "status": "connected",      "externalAccountId": "12345",      "externalAccountName": "john@example.com",      "endUserId": "user_xyz",      "createdAt": "2024-01-15T10:30:00Z",      "lastUsedAt": "2024-01-20T14:22:00Z"    }  ]}
```

POST`/integrations/connections`

Create a new connection (initiates OAuth flow).

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectorSlug | string | required | The connector to connect (e.g., hubspot, google-drive) |
| endUserId | string | required | Your user's ID in your system |
| redirectUrl | string | optional | URL to redirect after OAuth completes |

ResponseCopy

```
{  "connectionId": "conn_abc123",  "authorizationUrl": "https://app.hubspot.com/oauth/authorize?..."}
```

GET`/integrations/connections/{id}`

Get a specific connection.

DELETE`/integrations/connections/{id}`

Delete/revoke a connection.

POST`/integrations/connections/{id}/test`

Test if a connection's credentials are still valid.

ResponseCopy

```
// Success{ "success": true } // Failure{ "success": false, "error": "Token expired" }
```

## CRM - Contacts

GET`/integrations/crm/contacts`

List contacts from the connected CRM.

#### QUERY PARAMETERS

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| cursor | string | optional | Pagination cursor |
| limit | number | optional | Max results (default: 50) |

ResponseCopy

```
{  "data": [    {      "id": "contact_123",      "firstName": "John",      "lastName": "Doe",      "email": "john@example.com",      "phone": "+1234567890",      "title": "CEO",      "companyId": "company_456",      "createdAt": "2024-01-15T10:30:00Z",      "updatedAt": "2024-01-20T14:22:00Z",      "rawData": { ... }    }  ],  "nextCursor": "eyJwYWdlIjoy..."}
```

POST`/integrations/crm/contacts`

Create a new contact.

#### REQUEST BODY

| Field | Type | Description |
| --- | --- | --- |
| firstName | string | Contact's first name |
| lastName | string | Contact's last name |
| email | string | Email address |
| phone | string | Phone number |

GET`/integrations/crm/contacts/{id}`

Get a specific contact.

PATCH`/integrations/crm/contacts/{id}`

Update a contact.

DELETE`/integrations/crm/contacts/{id}`

Delete a contact.

## CRM - Companies

GET`/integrations/crm/companies`

List companies from the connected CRM.

POST`/integrations/crm/companies`

Create a new company.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| name | string | required | Company name |
| domain | string | optional | Company domain |
| industry | string | optional | Industry |

## CRM - Deals

GET`/integrations/crm/deals`

List deals from the connected CRM.

POST`/integrations/crm/deals`

Create a new deal.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| name | string | required | Deal name |
| amount | number | optional | Deal amount |
| stage | string | optional | Deal stage |

## Storage - Files

GET`/integrations/storage/files`

List files from the connected storage.

#### QUERY PARAMETERS

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| folderId | string | optional | Parent folder ID (root if omitted) |

POST`/integrations/storage/files`

Upload a file.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| name | string | required | File name |
| mimeType | string | required | MIME type |
| data | string | required | Base64-encoded file content |
| folderId | string | optional | Parent folder ID |

GET`/integrations/storage/files/{id}/download`

Download a file.

ResponseCopy

```
{  "data": "base64-encoded-content...",  "mimeType": "application/pdf",  "filename": "document.pdf"}
```

DELETE`/integrations/storage/files/{id}`

Delete a file.

## Storage - Folders

GET`/integrations/storage/folders`

List folders.

POST`/integrations/storage/folders`

Create a folder.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| name | string | required | Folder name |
| parentId | string | optional | Parent folder ID |

## Communication

GET`/integrations/communication/channels`

List channels.

GET`/integrations/communication/messages`

List messages in a channel.

#### QUERY PARAMETERS

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| channelId | string | required | Channel ID |

POST`/integrations/communication/messages`

Send a message.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| channelId | string | required | Channel to send to |
| content | string | required | Message content |

GET`/integrations/communication/users`

List users in the workspace.

## Productivity

GET`/integrations/productivity/documents`

List documents/pages.

POST`/integrations/productivity/documents`

Create a document.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| title | string | required | Document title |
| content | string | optional | Document content |

GET`/integrations/productivity/tables`

List tables/databases.

GET`/integrations/productivity/tables/{tableId}/rows`

List rows in a table.

POST`/integrations/productivity/tables/{tableId}/rows`

Create a row.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| fields | object | required | Field values for the row |

## Passthrough

POST`/integrations/passthrough`

Make a raw API call to the underlying provider.

#### REQUEST BODY

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| connectionId | string | required | The connection ID to use |
| method | string | required | HTTP method (GET, POST, PUT, PATCH, DELETE) |
| path | string | required | API path (relative to provider's base URL) |
| query | object | optional | Query parameters |
| body | object | optional | Request body |
| headers | object | optional | Additional headers |

Example RequestCopy

```
curl -X POST "https://api.stack0.dev/v1/integrations/passthrough" \  -H "Authorization: Bearer sk_live_your_api_key" \  -H "Content-Type: application/json" \  -d '{    "connectionId": "conn_abc123",    "method": "GET",    "path": "/crm/v3/objects/contacts",    "query": { "limit": "10" }  }'
```

### Related

[Integrations SDK](https://www.stack0.dev/docs/sdk/integrations)[IntegrationsConnect Element](https://www.stack0.dev/docs/elements/integrations-connect)[Error Handling](https://www.stack0.dev/docs/errors)

---

Source: https://www.stack0.dev/docs/api-reference/integrations
llms.txt: https://www.stack0.dev/llms.txt
Sitemap: https://www.stack0.dev/sitemap.xml
Documentation: https://www.stack0.dev/docs
OpenAPI spec: https://www.stack0.dev/openapi.json
MCP server: https://api.stack0.dev/mcp
