Skip to content

Connections API

All connection endpoints require Executive access level.

List all configured connections with status info (no tokens exposed).

Response:

{
"connections": [
{
"provider": "xero",
"org_name": "DotCollective Pty Ltd",
"connected_by": "uuid",
"connected_at": "2026-03-01T10:00:00",
"token_expires_at": "2026-03-01T10:30:00"
}
]
}

Generate a Xero OAuth2 authorization URL. Opens in a popup window.

Response: { "url": "https://login.xero.com/identity/connect/authorize?..." }

Exchange the OAuth2 authorization code for tokens. Fetches tenant info, encrypts tokens, and stores in the connections table.

Body:

{
"code": "authorization_code_from_xero"
}

Disconnect Xero. Removes the stored connection.

Save an encrypted Productive API token.

Body:

{
"api_token": "string (required)"
}

Disconnect Productive.

Save an encrypted Slack bot token and target channel ID.

Body:

{
"bot_token": "xoxb-... (required)",
"channel_id": "C0123456789 (required)"
}

Disconnect Slack.

GET /api/admin/connections/google-calendar/status

Section titled “GET /api/admin/connections/google-calendar/status”

Check if Google Calendar integration is configured (via environment variables, not stored in DB).

Response: { "configured": true }

Map internal users to their external IDs in Xero and Productive.

List all users with their external ID mappings.

Response:

{
"mappings": [
{
"user_id": "uuid",
"user_name": "Name",
"user_email": "name@dotcollective.com.au",
"xero_id": "xero-employee-id",
"productive_id": "productive-person-id"
}
]
}

PUT /api/admin/connections/user-mappings/:userId

Section titled “PUT /api/admin/connections/user-mappings/:userId”

Manually set external IDs for a user.

Body:

{
"xero_id": "string (optional)",
"productive_id": "string (optional)"
}

POST /api/admin/connections/user-mappings/sync

Section titled “POST /api/admin/connections/user-mappings/sync”

Auto-match users to external services by email address. Queries Xero employees and Productive people, matching by email.