SDK reference

Customers

Each route's function in the SDK, its call beside the same request in cURL.
orgCrmObjects

GET/v1/orgs/:orgId/crm/objects

Every object with its fields, validation rules and indexes.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmObjects

POST/v1/orgs/:orgId/crm/objects

A custom object (Customers admins): a name field, the system fields and the built-in indexes.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "label": "Example"
  }'
orgCrmObjectsByObject

GET/v1/orgs/:orgId/crm/objects/:object

One object with its fields, validation rules and indexes.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgCrmObjectsByObject

PATCH/v1/orgs/:orgId/crm/objects/:object

Labels, sharing default, default columns and search subtitle (Customers admins), over version.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "version": 1
  }'
deleteOrgCrmObjectsByObject

DELETE/v1/orgs/:orgId/crm/objects/:object

Deletes a custom object without records.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmObjectsFields

POST/v1/orgs/:orgId/crm/objects/:object/fields

Adds a custom field (Customers admins): text, number, currency, date, picklist, multi-picklist, checkbox, lookup, email, phone or URL; required makes it required.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/fields' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "label": "Example",
    "type": "text"
  }'
patchOrgCrmObjectsFieldsByField

PATCH/v1/orgs/:orgId/crm/objects/:object/fields/:field

Changes a field's label, help, required, picklist values or lookup, over the object's version.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/fields/{field}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "version": 1,
    "convertTo": {}
  }'
deleteOrgCrmObjectsFieldsByField

DELETE/v1/orgs/:orgId/crm/objects/:object/fields/:field

Deletes a custom field, with its rules and indexes (their entries go in the background).

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/fields/{field}?version=1' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgCrmObjectsRules

PUT/v1/orgs/:orgId/crm/objects/:object/rules

Replaces the object's validation rules.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/rules' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "version": 1,
    "rules": [
      {
        "id": "<id>",
        "name": "Example",
        "active": true,
        "when": [
          {
            "field": "example",
            "op": "eq"
          }
        ],
        "require": [
          {
            "field": "example",
            "op": "eq"
          }
        ],
        "message": "example"
      }
    ]
  }'
postOrgCrmObjectsIndexes

POST/v1/orgs/:orgId/crm/objects/:object/indexes

Adds an index (built in the background): up to two equality fields and a sort field.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/indexes' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "eq": [
      "example"
    ],
    "sort": "example"
  }'
deleteOrgCrmObjectsIndexesByIndexId

DELETE/v1/orgs/:orgId/crm/objects/:object/indexes/:indexId

Drops a custom index (its entries go in the background); built-in ones stay.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/indexes/{indexId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmObjectsViews

GET/v1/orgs/:orgId/crm/objects/:object/views

Built-in, shared and the caller's own list views.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/views' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmObjectsViews

POST/v1/orgs/:orgId/crm/objects/:object/views

Saves a view (shared ones: Customers admins); an index it needs is added and built.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/views' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "sort": {
      "field": "example",
      "dir": "asc"
    }
  }'
patchOrgCrmObjectsViewsByViewId

PATCH/v1/orgs/:orgId/crm/objects/:object/views/:viewId

Changes a saved view (the caller's own; shared ones: Customers admins).

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/views/{viewId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "sort": {
      "field": "example",
      "dir": "asc"
    }
  }'
deleteOrgCrmObjectsViewsByViewId

DELETE/v1/orgs/:orgId/crm/objects/:object/views/:viewId

Deletes a saved view (the caller's own; shared ones: Customers admins).

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/views/{viewId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmObjectsRecords

GET/v1/orgs/:orgId/crm/objects/:object/records

A page of records by a view, or filters (JSON) and sort; cursor continues.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/records' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmObjectsRecordsQuery

POST/v1/orgs/:orgId/crm/objects/:object/records/query

The same list with the filters in the body.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/records/query' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "view": "example",
    "filters": [
      {
        "field": "example",
        "op": "eq"
      }
    ],
    "sort": {
      "field": "example",
      "dir": "asc"
    }
  }'
postOrgCrmObjectsRecords

POST/v1/orgs/:orgId/crm/objects/:object/records

Creates a record owned by the caller (or ownerId); field errors come back as 422 with errors.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/records' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "fields": {}
  }'
postOrgCrmObjectsRecordsBulk

POST/v1/orgs/:orgId/crm/objects/:object/records/bulk

Updates, transfers or deletes many records; each reports its own result.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/records/bulk' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ids": [
      "example"
    ],
    "operation": "update"
  }'
orgCrmObjectsExport

GET/v1/orgs/:orgId/crm/objects/:object/export

A view (or filters) as CSV, up to 10,000 rows; X-More: 1 when there are more (use an export job).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/export' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmObjectsExports

POST/v1/orgs/:orgId/crm/objects/:object/exports

Exports a view to a file in the background (any size); download it from the job when done.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/objects/{object}/exports' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "view": "example",
    "filters": [
      {
        "field": "example",
        "op": "eq"
      }
    ],
    "sort": {
      "field": "example",
      "dir": "asc"
    }
  }'
orgCrmRecordsById

GET/v1/orgs/:orgId/crm/records/:id

The record, what the caller may do with it, and names of the people and records it refers to.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgCrmRecordsById

PATCH/v1/orgs/:orgId/crm/records/:id

Changes fields and the owner; version refuses a stale edit (409).

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "fields": {},
    "ownerId": "<ownerId>",
    "version": 1
  }'
deleteOrgCrmRecordsById

DELETE/v1/orgs/:orgId/crm/records/:id

Deletes the record; its history and the audit log keep who deleted it.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmRecordsHistory

GET/v1/orgs/:orgId/crm/records/:id/history

Field changes, newest first.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}/history' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmRecordsActivities

GET/v1/orgs/:orgId/crm/records/:id/activities

The timeline: activities related to the record, newest first.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}/activities' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmRecordsActivities

POST/v1/orgs/:orgId/crm/records/:id/activities

Logs a task, call, meeting, note or email on the record (and any others in relatedIds).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}/activities' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "task",
    "subject": "Example"
  }'
postOrgCrmRecordsConvert

POST/v1/orgs/:orgId/crm/records/:id/convert

Converts a lead into an account (or uses one), a contact (or uses one) and an opportunity.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/records/{id}/convert' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": "<accountId>",
    "contactId": "<contactId>",
    "createOpportunity": true
  }'
orgCrmPipelines

GET/v1/orgs/:orgId/crm/pipelines

Opportunity pipelines with their stages.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/pipelines' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmPipelines

POST/v1/orgs/:orgId/crm/pipelines

A pipeline (Customers admins): stages with probability and whether each is open, won or lost.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/pipelines' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "stages": [
      {
        "name": "Example",
        "probability": 1,
        "category": "open"
      }
    ]
  }'
putOrgCrmPipelinesByPipelineId

PUT/v1/orgs/:orgId/crm/pipelines/:pipelineId

Replaces a pipeline's name and stages (Customers admins), over version; a stage with deals can't be removed.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/pipelines/{pipelineId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "stages": [
      {
        "name": "Example",
        "probability": 1,
        "category": "open"
      }
    ]
  }'
deleteOrgCrmPipelinesByPipelineId

DELETE/v1/orgs/:orgId/crm/pipelines/:pipelineId

Deletes a pipeline without opportunities (Customers admins); the default stays.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/pipelines/{pipelineId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmPipelinesBoard

GET/v1/orgs/:orgId/crm/pipelines/:pipelineId/board

The board: each stage's first opportunities by close date with its count and amount; stage and cursor page one column.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/pipelines/{pipelineId}/board' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmJobs

GET/v1/orgs/:orgId/crm/jobs

Recent imports and exports (the caller's; every one for Customers admins).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/jobs' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmJobsByJobId

GET/v1/orgs/:orgId/crm/jobs/:jobId

An import or export: state, progress counts and the first errors.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/jobs/{jobId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmJobsCancel

POST/v1/orgs/:orgId/crm/jobs/:jobId/cancel

Cancels an export that hasn't finished (the caller's, or any for Customers admins); a finished one comes back as it is.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/jobs/{jobId}/cancel' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmJobsDownload

GET/v1/orgs/:orgId/crm/jobs/:jobId/download

A finished export's download link (ten minutes).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/jobs/{jobId}/download' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmImports

POST/v1/orgs/:orgId/crm/imports

Starts an import: up to 5 MB in content, or a presigned uploadUrl for the file (PUT it, then call uploaded).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/imports' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "object": "example",
    "fileName": "Example"
  }'
postOrgCrmImportsUploaded

POST/v1/orgs/:orgId/crm/imports/:jobId/uploaded

Marks a presigned upload complete so the import can be previewed.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/imports/{jobId}/uploaded' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmImportsPreview

POST/v1/orgs/:orgId/crm/imports/:jobId/preview

The header, ten sample rows and a suggested column mapping.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/imports/{jobId}/preview' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgCrmImportsDryRun

POST/v1/orgs/:orgId/crm/imports/:jobId/dry-run

Checks the first 1,000 rows with the mapping, writing nothing.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/imports/{jobId}/dry-run' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "mapping": [
      "example"
    ],
    "options": {
      "mode": "create",
      "ownerId": "<ownerId>",
      "dateOrder": "dmy"
    }
  }'
postOrgCrmImportsStart

POST/v1/orgs/:orgId/crm/imports/:jobId/start

Queues the import; follow it on the job.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/imports/{jobId}/start' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "mapping": [
      "example"
    ],
    "options": {
      "mode": "create",
      "ownerId": "<ownerId>",
      "dateOrder": "dmy"
    }
  }'
orgCrmMeta

GET/v1/orgs/:orgId/crm/meta

The caller's view of Customers: objects, pipelines, settings, the people in the org and what the caller may do.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/meta' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmSummary

GET/v1/orgs/:orgId/crm/summary

Home: the pipeline summary (counters) and the caller's open tasks.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/summary' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgCrmSettings

GET/v1/orgs/:orgId/crm/settings

Customers settings: currency, Mail and Calendar logging, role permissions, with version.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgCrmSettings

PATCH/v1/orgs/:orgId/crm/settings

Currency, Mail and Calendar logging, and what each role may see and change.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/crm/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "version": 1
  }'