Skip to content

Integrations

Integrations connect Cortex to external services so agents can read from and write to third-party platforms. Each integration stores encrypted credentials and exposes a sync and test mechanism.

Base path: /api/integrations

All endpoints require Authorization: Bearer <token>.


Supported Providers

ProviderTypeDescription
githubDevelopmentRepository access, issues, PRs
discordCommunicationMessages and channel management
slackCommunicationMessages, channels, slash commands
notionKnowledgePages, databases, and blocks
linearProject ManagementIssues, projects, and cycles
gmailEmailSend and receive via Gmail
zapierAutomationTrigger Zaps and multi-step workflows
webhookCustomGeneric outbound HTTP webhooks
customCustomArbitrary API with user-defined config

List Integrations

GET /api/integrations

Query parameters:

ParameterTypeDescription
providerstringFilter by provider type
statusstringconnected, error, pending
limitnumberDefault 20
offsetnumberDefault 0

Response:

json
{
  "success": true,
  "data": [
    {
      "id": "int_01J...",
      "provider": "github",
      "name": "Acrobi GitHub",
      "status": "connected",
      "lastSyncAt": "2026-04-03T10:00:00Z",
      "createdAt": "2026-02-01T09:00:00Z"
    }
  ],
  "pagination": { "limit": 20, "offset": 0, "total": 3 }
}

curl:

bash
curl "https://api.cortex.acrobi.com/api/integrations?provider=github" \
  -H "Authorization: Bearer <token>"

Create Integration

POST /api/integrations

Request body:

json
{
  "provider": "github",
  "name": "Acrobi GitHub",
  "config": {
    "accessToken": "ghp_...",
    "org": "Acrobi",
    "defaultRepo": "cortex"
  }
}
FieldTypeRequiredDescription
providerstringYesProvider identifier (see table above)
namestringYesHuman-readable label
configobjectYesProvider-specific credentials and settings

Credentials

Credentials in config are encrypted at rest using AES-GCM-256. They are never returned in plaintext after creation.

Response: 201 Created

json
{
  "success": true,
  "data": {
    "id": "int_01J...",
    "provider": "github",
    "name": "Acrobi GitHub",
    "status": "pending",
    "createdAt": "2026-04-03T12:00:00Z"
  }
}

curl:

bash
curl -X POST "https://api.cortex.acrobi.com/api/integrations" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "github",
    "name": "Acrobi GitHub",
    "config": { "accessToken": "ghp_...", "org": "Acrobi" }
  }'

Get Integration

GET /api/integrations/:id

Returns integration metadata. Credentials in config are masked — sensitive fields are replaced with "***".

Response:

json
{
  "success": true,
  "data": {
    "id": "int_01J...",
    "provider": "github",
    "name": "Acrobi GitHub",
    "status": "connected",
    "config": {
      "accessToken": "***",
      "org": "Acrobi",
      "defaultRepo": "cortex"
    },
    "lastSyncAt": "2026-04-03T10:00:00Z",
    "createdAt": "2026-02-01T09:00:00Z",
    "updatedAt": "2026-04-03T10:00:00Z"
  }
}

Update Integration

PATCH /api/integrations/:id

Update the name or config fields. Only provided config keys are updated — omitted keys retain their current (encrypted) values.

Request body:

json
{
  "name": "Acrobi GitHub (Main)",
  "config": {
    "defaultRepo": "cortex-v2"
  }
}

Response: 200 OK — returns updated integration with masked credentials.


Delete Integration

DELETE /api/integrations/:id

Removes the integration and destroys all stored credentials.

Response:

json
{ "success": true }

Sync Integration

Triggers a manual sync — pulls the latest data from the external provider into Cortex (e.g. fetch new GitHub issues, import Notion pages).

POST /api/integrations/:id/sync

Request body:

json
{
  "scope": "issues",
  "since": "2026-04-01T00:00:00Z"
}
FieldTypeRequiredDescription
scopestringNoProvider-specific scope to sync (omit for full sync)
sincestringNoISO 8601 timestamp to sync from

Response: 200 OK

json
{
  "success": true,
  "data": {
    "syncId": "sync_01J...",
    "status": "running",
    "startedAt": "2026-04-03T12:00:00Z"
  }
}

Test Integration

Sends a lightweight ping to verify credentials are valid and the external service is reachable.

POST /api/integrations/:id/test

No request body required.

Response: 200 OK

json
{
  "success": true,
  "data": {
    "connected": true,
    "provider": "github",
    "latencyMs": 142,
    "details": {
      "authenticatedAs": "acrobi-bot",
      "scopes": ["repo", "read:org"]
    }
  }
}

If the test fails:

json
{
  "success": false,
  "data": {
    "connected": false,
    "provider": "github",
    "error": "401 Bad credentials — token may have expired"
  }
}

curl:

bash
curl -X POST "https://api.cortex.acrobi.com/api/integrations/int_01J.../test" \
  -H "Authorization: Bearer <token>"

Built by Acrobi