Skip to main content
← All documentationContents ↓

TypeScript SDK

The official @simply360/sdk package — installation, configuration, the resource clients it exposes, and code examples for common operations.

Overview

The official Simply360 TypeScript SDK (@simply360/sdk) provides a typed client for the Simply360 REST API. It works in Node.js 18+, modern browsers, and edge runtimes. The SDK is a thin, typed wrapper over the HTTP API — one resource client per top-level resource, each method maps to a single HTTP request.

Installation

The SDK ships as the @simply360/sdk package. It is currently in developer preview and is not yet published to the public npm registry — contact developers@simply360.app for access, and watch the API Changelog for the public release announcement. Once the package is available in your registry, install it with:

npm install @simply360/sdk

Basic Setup

import { Simply360 } from '@simply360/sdk';

const s360 = new Simply360({
  apiKey: process.env.S360_API_KEY!, // s360_live_...
});

Configuration Options

OptionTypeDefaultDescription
apiKey string — Static API key. Provide either apiKey or getToken.
getToken () => Promise<string> | string — Dynamic token provider, used for Cognito JWT or OAuth2 flows where the token refreshes.
teamSimplyId string — Team simplyId, sent as X-Team-Id. Required when using a Cognito JWT.
allowUnauthenticated boolean false Allow requests without credentials to documented unauthenticated public endpoints.
baseUrl string https://api.simply360.app Override to target a non-production environment.
timeout number 30000 Request timeout in milliseconds.
headers Record<string, string> {} Extra headers added to every request.

Switching Teams Mid-Session

If you build an app that switches between teams (e.g., the Simply360 webapp), you can update the team header on the existing client without recreating it:

s360.setTeamSimplyId('NEW0-TEAM-SIMP');

The older setTeamId method still works but is a deprecated alias for setTeamSimplyId.

Resource Clients

The Simply360 class exposes one resource client per top-level resource. The most commonly used clients are:

PropertyResource
s360.dataRecordsData records (CRUD, search, batch, audit log, files, children/related)
s360.dataCollectionsData collections and field schemas
s360.dataViewsData Views and Data View records
s360.dataWizardsWizards, schemas, and execution
s360.messagesOutgoing messages and message status
s360.messageTemplatesMessage templates (CRUD)
s360.conversationsConversations and conversation messages
s360.reportsReports and report execution
s360.automationsAutomations, executions, manual triggers
s360.filesFile metadata, download URLs, image variants
s360.actionTagsSimplyTags and scan history
s360.webhooksWebhook subscriptions and delivery logs
s360.apiKeysAPI keys (create, list, rotate, revoke)
s360.sessionTokensSession tokens (create, get, revoke)
s360.calendarYour Calendar sources, items, search, and settings, with conditional settings updates
s360.usersUsers (current, list, get)
s360.auditLogAudit log entries
s360.constituentAuthConstituent identity verification flows
s360.appStoreApp-store purchase verification and entitlements

Newer platform surfaces follow the same pattern — the SDK also exposes clients such as s360.signingRequests, s360.billing, s360.paymentAccounts, s360.contentTemplates, s360.styleKits, s360.websites (plus the related Website Studio clients), s360.actionCredentials, and s360.teamAgent. Every method maps to a single documented REST endpoint.

Your Calendar

s360.calendar.listSources() returns your readable Calendar Data Views, Bookings, and connected calendars. Call listItems({ groupKey, sourceKeys, start, end, displayZone, cursor?, limit?, includeOverdueTasks? }) for one group's sources in a UTC window of at most 14 days. Source keys come from the sources response; optional overdue tasks apply only to the first page. These calls retain the selected Team's X-Team-Id and your record, field, and Bookings permissions. Hidden display fields remain null.

search({ groupKey, sourceKeys, text, start, end, displayZone, order?, limit?, cursor? }) finds one group's items whose shown text holds every word of text (2 to 100 characters, at most 8 words; case and accents are ignored) in a UTC range of up to 366 days. Calendar Data View records match on their readable title, location, and description; Simply Bookings match on the title, the meeting type, and the invitee name where you may see it. A hidden field is never searched. order is ASC (soonest first, the default) or DESC (most recent first). The SDK sends the text in the JSON body of POST /v1/calendar/search, never in the URL. Matches are the same items, with the same item keys, as listItems; page with nextCursor and the same request. Only the platform group can be searched for now.

Calendar requires a signed-in person acting for themselves (Cognito JWT or user-bound OAuth), rather than an API key, session token, installation, or reviewer. OAuth reads require calendar:read; record and Bookings sources also require their canonical read scopes. getSettings() returns preferences and data.revision, the revision used in the strong ETag. Use updateSettings(patch, { ifMatch: revision }) with calendar:write; the SDK quotes the revision in If-Match. A stale revision returns 412; a missing precondition returns 428.

const { data } = await s360.calendar.getSettings();
await s360.calendar.updateSettings({ showWeekNumbers: true }, { ifMatch: data.revision });

Style Kit Studio

s360.styleKits exposes strict TypeScript wire contracts for the renderer-neutral StyleKitSource and resolved ResolvedStyleKit shapes. Updates require the current expectedSourceVersion and expectedSourceDigestSha256, returned by the prior read. To resolve an unsaved constituent-mobile draft, pass the full source to resolveStudioDraftPreview(teamStyleKitSimplyId, { teamSimplyId, styleKitSimplyId, source }); the response is a short-lived resolved presentation and does not save the draft.

const preview = await s360.styleKits.resolveStudioDraftPreview('STYL-0001-0001', {
  teamSimplyId: 'TEAM-0000-0001',
  styleKitSimplyId: 'STYL-0001-0001',
  source,
});

const permit = await s360.styleKits.createStudioPreviewPermit('APPS-0001-0001', {
  teamConstituentMobileAppSimplyId: 'APPS-0001-0001',
  teamStyleKitSimplyId: 'STYL-0001-0001',
  sourceVersion: source.sourceVersion,
  sourceDigestSha256,
});

Preview permits are one-use, short-lived authorization bound to the exact Team, app, Style Kit source version, and digest. They are not constituent sessions or general API tokens. Permit responses include a strict resolved Style Kit, and preview/asset responses are non-cacheable; immutable asset URLs are content-pinned and expire with the preview session.

Conversation Messages and Recoverable Attachments

The webapp, Simply Anywhere, and SDK share POST /v1/conversations/inbox/{conversationSimplyId}/messages. Inbox sends require a current Team User with conversation respond access; an API key alone does not grant that access. sendInboxMessage and addAgentMessage are aliases for the same operation.

// Save this operation and its key before the first attempt.
// After a timeout or app restart, reload it unchanged instead of generating a new key.
const operation = {
  idempotencyKey: crypto.randomUUID(),
  content: 'Your registration is ready.',
  attachments: [{ fileSimplyId: 'FILE-0001-0001' }],
};
const result = await s360.conversations.sendInboxMessage('CONV-0001-0001', operation);
const delivery = result.data.delivery;
if (delivery?.status === 'SENT' && delivery.success === true && result.data.message.simplyId?.trim()) {
  // Confirm this operation as sent; preserve any newer composer draft.
}

The key is required by both SDK send methods, sent in the Idempotency-Key header, and scoped to the conversation and authenticated author. Save it before the first request and reuse it with the exact payload after a lost response. Missing or malformed keys fail before sending. Reusing a key with different content, note mode, content type, or ordered attachment IDs returns 409 IDEMPOTENCY_KEY_CONFLICT. HTTP success alone does not establish delivery: SENT, FAILED, UNCERTAIN, and PENDING distinguish the outcomes. An uncertain provider handoff must be checked under its original identity, never retried as a new message.

Upload conversation files through s360.files.upload with purpose: 'CONVERSATION_ATTACHMENT', the target conversationSimplyId, optional isInternalNote, and a saved uploadRequestKey. Reuse the same bytes and declaration when resuming. Low-level createUpload replays return the original intent; only pending uploads include an upload capability. Scanning or completed replays need no new binary upload. The compact hashed operation claim is durable, while the upload intent expires after 24 hours; an expired or missing original fails explicitly instead of creating another File.

Conversation attachments remain private and pass quarantine, malware scanning, and content validation before receiving a File Simply ID. Send at most five files of up to 25 MiB each, and wait for every selected file to complete. Constituent-visible attachments support Chat; other delivery channels reject attachments explicitly. Internal notes retain Team access rules. Inbox sending and conversation-scoped uploads require a signed-in Team User identity through Cognito, first-party OAuth, or marketplace user delegation; API keys and session tokens cannot use them. Current Team membership, conversation visibility and assignment, respond permission, File classification, and scope permissions are checked at the relevant upload, send, and download boundaries. No upload request lowers a Team's classification policy or creates a standalone public grant.

Presigned File Uploads

Some API methods return a short-lived presigned upload URL for direct-to-storage file staging. Use the SDK helper to PUT the bytes instead of writing a raw fetch call in app code:

import { uploadPresignedFile } from '@simply360/sdk';

const presigned = await s360.dataRecords.presignAiGraphUpload({
  fileName: file.name,
  contentType: file.type || 'application/octet-stream',
});

await uploadPresignedFile({
  uploadUrl: presigned.data.uploadUrl,
  body: file,
  contentType: file.type || 'application/octet-stream',
});

The helper resolves after any 2xx response and throws when the storage service returns a non-2xx response.

Common Operations

List Records

const response = await s360.dataRecords.list({
  dataCollectionSimplyId: 'XXXX-XXXX-XXXX',
  limit: 50,
  sort: '-createdAt',
  fields: 'FLDS-FRST-NAME,FLDS-LAST-NAME,FLDS-EMAL-ADDR',
});

// response.data: DataRecord[]
// response.meta.pagination.total: number

Get a Record

const response = await s360.dataRecords.get('WXYZ-5678-IJKL');
console.log(response.data.fields);

Create a Record

const response = await s360.dataRecords.create({
  dataCollectionSimplyId: 'XXXX-XXXX-XXXX',
  fields: {
    'FLDS-FRST-NAME': 'Jane',
    'FLDS-LAST-NAME': 'Doe',
    'FLDS-EMAL-ADDR': 'jane@example.com',
  },
});

Update a Record (partial)

await s360.dataRecords.update('WXYZ-5678-IJKL', {
  fields: { 'FLDS-EMAL-ADDR': 'jane.doe@newdomain.com' },
});

Replace a Record (full overwrite)

await s360.dataRecords.replace('WXYZ-5678-IJKL', {
  fields: { /* full set of fields */ },
});

Delete a Record

await s360.dataRecords.delete('WXYZ-5678-IJKL');

Search Records

const response = await s360.dataRecords.search({
  dataCollectionSimplyId: 'XXXX-XXXX-XXXX',
  query: 'Jane',
  filters: [
    { field: 'FLDS-EMAL-ADDR', operator: 'contains', value: '@example.com' },
  ],
  limit: 10,
});

Batch Operations

Batch create, update, and delete accept at most 100 records per API request. MCP invokes these same API-owned operations with the same limits, validation, and results. Commits are per record. Always inspect results and errors, even on HTTP success. When the remaining request budget is too short to start another record, untouched entries return code: "NOT_ATTEMPTED" with their original input index; completed records remain in results.

For retry-safe creates and updates, supply a distinct canonical lowercase UUIDv4 idempotencyKey for each record and preserve its exact payload when retrying. Keys are optional; unkeyed writes and batch deletes do not provide durable replay. Do not automatically retry an ambiguous unkeyed write timeout. Updates can also supply expectedUpdatedAt from a prior read to reject stale edits. Set a default dataCollectionSimplyId for the request or specify it per item; per-item Collections override the default and support mixed-Collection batches. Collection and Field values use public Simply IDs.

await s360.dataRecords.batchCreate({
  dataCollectionSimplyId: 'XXXX-XXXX-XXXX',
  records: [
    { fields: { 'FLDS-NAME-0001': 'A' }, idempotencyKey: '018f3a12-0000-4000-8000-000000000001' },
    { fields: { 'FLDS-NAME-0001': 'B' }, idempotencyKey: '018f3a12-0000-4000-8000-000000000002' },
  ],
});

await s360.dataRecords.batchUpdate({
  dataCollectionSimplyId: 'XXXX-XXXX-XXXX',
  records: [
    { dataRecordSimplyId: 'WXYZ-5678-IJKL', fields: { 'FLDS-EMAL-0001': 'a@x.com' }, idempotencyKey: '018f3a12-0000-4000-8000-000000000003' },
    { dataRecordSimplyId: 'MNOP-9012-QRST', fields: { 'FLDS-EMAL-0001': 'b@x.com' }, idempotencyKey: '018f3a12-0000-4000-8000-000000000004' },
  ],
});

await s360.dataRecords.batchDelete({
  dataRecordSimplyIds: ['WXYZ-5678-IJKL', 'MNOP-9012-QRST'],
});

Working with Collections

const collections = await s360.dataCollections.list();

const detail = await s360.dataCollections.get('XXXX-XXXX-XXXX');
console.log(detail.data.fields); // included by default

const fields = await s360.dataCollections.listFields('XXXX-XXXX-XXXX');

Executing a Data View

Get the records that match a saved Data View's filters and sort:

const records = await s360.dataViews.getRecords('VIEW-1234-ABCD', {
  limit: 50,
  offset: 0,
});

Simply Action Tags

The actionTags client exposes typed URL/Link Page CRUD, custom social previews, retained scan analytics, CSV import/export, custom domains, and signed webhooks. The dataRecords list/search methods accept the shared Action-attribution audience filter. Standalone API-key use requires the 500-Action band or higher. Account, Team User, saved-payment-method, and billing methods are first-party Cognito Team Admin operations even though they share generated SDK types; an API key cannot use them.

const action = await s360.actionTags.create({
  name: 'Visitor resources',
  actionType: 'LINK_PAGE',
  socialPreview: {
    mode: 'CUSTOM',
    title: { en: 'Visitor resources' },
    imageFileSimplyId: 'FILE-1234-ABCD',
    imageAlt: { en: 'Visitor center logo' },
  },
  linkPageSettings: {
    title: 'Welcome',
    theme: 'SYSTEM',
    callsToAction: [{ label: 'Hours', url: 'https://example.org/hours' }],
  },
});

const attributedGuests = await s360.dataRecords.list({
  dataCollectionSimplyId: 'COLL-1234-ABCD',
  actionTagAttribution: {
    simplyActionTagSimplyIds: [action.data.id],
    match: 'ANY',
  },
});

const dryRun = await s360.actionTags.importCsv({ csv, dryRun: true });
if (dryRun.data.validRows === dryRun.data.totalRows) {
  await s360.actionTags.importCsv({
    csv,
    dryRun: false,
    idempotencyKey: crypto.randomUUID(),
  });
}

Reuse an import idempotency key only when retrying the exact same CSV. Webhook creation returns its HMAC secret once. Domain listing is a pure read; verifyDomain() is the explicit reconciliation mutation. Powered record/Wizard fields are rejected for a standalone Team rather than silently removed.

Pagination

The SDK uses manual offset pagination — advance the offset yourself until response.meta.pagination.hasMore is false. Maximum page size is 100. See Pagination, Sorting & Field Selection for details.

let offset = 0;
const limit = 100;
const all: DataRecord[] = [];

while (true) {
  const response = await s360.dataRecords.list({ dataCollectionSimplyId, limit, offset });
  all.push(...response.data);
  if (!response.meta.pagination.hasMore) break;
  offset += limit;
}

Error Handling

The SDK throws ApiError for any non-2xx response. Responses that cannot be parsed (for example, an HTML error page from an intermediary) are also surfaced as ApiError rather than a raw parse error. See Error Handling for details.

import { Simply360, ApiError } from '@simply360/sdk';

try {
  await s360.dataRecords.get('NONE-XIST-ENT0');
} catch (error) {
  if (error instanceof ApiError) {
    console.error(error.statusCode, error.code, error.message);
  }
}

TypeScript Types

All request and response types are exported from the SDK. Use them to type your own functions and data structures.

import type {
  Simply360Config,
  ApiResponse,
  ApiListResponse,
  DataRecord,
  DataCollection,
  ListRecordsParams,
  CreateRecordParams,
  SearchRecordsParams,
} from '@simply360/sdk';

function processRecords(response: ApiListResponse<DataRecord>) {
  for (const record of response.data) {
    // record is fully typed
    console.log(record.dataRecordSimplyId, record.fields);
  }
}

Targeting a Different Environment

The SDK targets production by default. To use an enabled non-production environment, override baseUrl with the matching API base URL:

const s360 = new Simply360({
  apiKey: process.env.S360_API_KEY!,
  baseUrl: process.env.SIMPLY360_API_URL ?? 'https://api.simply360.app',
});
# Staging
export SIMPLY360_API_URL="https://api.staging.simply360.app"

# Development
export SIMPLY360_API_URL="https://api.dev.simply360.app"

Staging is a paid add-on or an included offer benefit. Development is a separate, limited preview add-on or beta grant; Staging access does not include Development. Use an API key created in the selected environment — credentials do not cross environment boundaries. See Environments for the complete endpoint and access matrix.

↑