Activate integration
Activate an external integration for the authenticated merchant. Validates the supplied credentials against the provider, stores them via KMS envelope encryption, seeds the sync-state cursor, and schedules the first incremental sync. Returns `409` if the merchant already has an active integration with this provider — call the deactivate endpoint first, or use `/sync-toggle` to resume a paused integration. --- **Related endpoints** - `POST /integrations/{provider}/deactivate` — Deactivate integration - `GET /integrations/{provider}` — Get integration status - `POST /integrations/{provider}/test` — Test integration credentials - `POST /integrations/{provider}/rotate` — Rotate integration credentials - `POST /integrations/{provider}/sync` — Trigger manual sync - `POST /integrations/{provider}/invoices/{externalInvoiceId}/refresh` — Refresh a single PracticeHub invoice - `GET /integrations/{provider}/invoices/{externalInvoiceId}/refresh-status` — Get demand invoice refresh status - `GET /integrations` — List all integrations **Common errors** - `400 invalid_request` — malformed payload or failed validation. - `401 authentication_error` — missing, invalid, expired, or revoked credential. Codes: `authentication_failed`, `invalid_api_key`, `expired_api_key`, `api_key_revoked`, `session_invalid`, `merchant_required`. Carries a `WWW-Authenticate: Bearer` challenge. - `409 conflict` — Idempotency-Key collision with a different body, or a concurrent state-transition conflict. **Idempotency** Pass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).
Activate an external integration for the authenticated merchant. Validates the supplied credentials against the provider, stores them via KMS envelope encryption, seeds the sync-state cursor, and schedules the first incremental sync. Returns 409 if the merchant already has an active integration with this provider — call the deactivate endpoint first, or use /sync-toggle to resume a paused integration.
Related endpoints
POST /integrations/{provider}/deactivate— Deactivate integrationGET /integrations/{provider}— Get integration statusPOST /integrations/{provider}/test— Test integration credentialsPOST /integrations/{provider}/rotate— Rotate integration credentialsPOST /integrations/{provider}/sync— Trigger manual syncPOST /integrations/{provider}/invoices/{externalInvoiceId}/refresh— Refresh a single PracticeHub invoiceGET /integrations/{provider}/invoices/{externalInvoiceId}/refresh-status— Get demand invoice refresh statusGET /integrations— List all integrations
Common errors
400 invalid_request— malformed payload or failed validation.401 authentication_error— missing, invalid, expired, or revoked credential. Codes:authentication_failed,invalid_api_key,expired_api_key,api_key_revoked,session_invalid,merchant_required. Carries aWWW-Authenticate: Bearerchallenge.409 conflict— Idempotency-Key collision with a different body, or a concurrent state-transition conflict.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
Your RevKeen merchant API key. Create and manage keys in Dashboard → Settings → Developer. Use rk_sandbox_* for staging/test and rk_live_* for production. The same key may be sent as Authorization: Bearer <key> if that suits your HTTP client better. A missing, invalid, expired, or revoked key returns 401 with a WWW-Authenticate: Bearer challenge; a valid key without the required scope returns 403.
In: header
Path Parameters
Providers that can be activated or tested. TeamUp uses Connection Manager M2M tokens (Lane B); PracticeHub and Wodify use API keys.
Value in
- "practicehub"
- "wodify"
- "terminal"
- "teamup"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.revkeen.com/v2/integrations/practicehub/activate" \
-H "x-api-key: $REVKEEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"credentials": {
"apiKey": "string",
"baseUrl": "https://example.com",
"appName": "RevKeen",
"appEmail": "info@revkeen.com"
},
"providerAccountId": "string",
"providerLocationId": "string",
"syncIntervalMinutes": 5,
"currency": "string",
"syncEnabled": true,
"syncPatients": true,
"syncProducts": true,
"syncPackages": true,
"syncInvoices": true,
"pushPayments": true,
"autoSendInvoices": false,
"productMappingMode": "import_only",
"requireProductMappings": false,
"paymentMappings": []
}'{ "success": true, "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "provider": "practicehub", "is_active": true, "sync_enabled": true, "status": "connected", "last_sync_at": "2019-08-24T14:15:22Z", "last_sync_error": "string", "sync_health": "healthy", "provider_state": { "consecutive_errors": 0, "last_error_at": "2019-08-24T14:15:22Z", "last_sync_at": "2019-08-24T14:15:22Z", "mode": "string" }, "sync_interval": { "has_repeatable_job": true, "interval_ms": 0, "next_run": "2019-08-24T14:15:22Z" }, "configuration": { "property1": null, "property2": null }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }}Get import status GET
Check the status and progress of an import job. Includes detailed error information for failed rows. --- **Related endpoints** - `POST /imports` — Create an import **Common errors** - `401 authentication_error` — missing, invalid, expired, or revoked credential. Codes: `authentication_failed`, `invalid_api_key`, `expired_api_key`, `api_key_revoked`, `session_invalid`, `merchant_required`. Carries a `WWW-Authenticate: Bearer` challenge. - `404 resource_missing` — the referenced resource does not exist or is not visible to your key.
Toggle auto-send invoices PUT
When enabled, invoices synced from the external provider are automatically emailed to the customer on arrival using the merchant's default email template. When disabled, synced invoices land in `draft` state and must be finalised manually. Existing invoices are unaffected by this toggle. --- **Related endpoints** - `POST /integrations/{provider}/activate` — Activate integration - `POST /integrations/{provider}/deactivate` — Deactivate integration - `GET /integrations/{provider}` — Get integration status - `POST /integrations/{provider}/test` — Test integration credentials - `POST /integrations/{provider}/rotate` — Rotate integration credentials - `POST /integrations/{provider}/sync` — Trigger manual sync - `POST /integrations/{provider}/invoices/{externalInvoiceId}/refresh` — Refresh a single PracticeHub invoice - `GET /integrations/{provider}/invoices/{externalInvoiceId}/refresh-status` — Get demand invoice refresh status **Common errors** - `404 resource_missing` — the referenced resource does not exist or is not visible to your key. **Idempotency** Pass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).