Conventions and wrappers
Every operation and model is in Swagger; this page covers how the SDK wraps them. Use sdk.api to browse services such as companies, documents, and conversations in your IDE.
Calling conventions
Kotlin calls are suspend functions and return a response wrapper: .body() decodes it, and the wrapper also carries status and headers. TypeScript methods take one parameter object and return the decoded body; reach status and headers through sdk.raw.
Path and query parameters use their Swagger names. For generated operations, the request body goes in input on sdk.api calls and in cmd on mutation hooks and *MutationOptions; Kotlin names it after its type, for example updateSectionCommand. The upload helpers take request instead (see Documents).
DELETE operations can carry JSON bodies. To remove one section tag, pass { name: "Tilhørighet" } as input to deleteTagOnSection (or as cmd to its mutation options); other tags stay attached. Device deregistration likewise requires its device command, including the push token. Deleting a section, a section status, section fractions or an invoice recipient also takes an optional cmd body, which the backend reads before the query parameters. Parking and storage unassignment bodies accept validTo; the wrappers retain validFrom as a deprecated, ignored parameter for source compatibility.
TypeScript results are frozen, so items.sort() or map.set() throws. Copy first, with items.toSorted(), [...items], { ...company } or new Map(map).
Finding the wrapper for an operation
Query options, mutation options and cache keys come from @solibo/solibo-query, and hooks from @solibo/solibo-react (package list). They are named after resources, not operations, and some rename parameters: sdk.api.companies.showCompany({ companyId }) becomes useCompanyById({ id }) and companyByIdQueryOptions(sdk, { id }).
For an endpoint without a named hook, openApiOperationQueryOptions(sdk, { operationId, args, execute }) wraps any call. execute receives the raw SDK (positional bigint arguments, response wrapper), and operationId only labels the cache key. openApiOperationMutationOptions and the React hooks useOpenApiOperationQuery / useOpenApiOperationMutation work the same way.
import { openApiOperationQueryOptions } from '@solibo/solibo-query'
const company = await queryClient.fetchQuery(
openApiOperationQueryOptions(sdk, {
operationId: 'showCompany',
args: [BigInt(companyId)] as const,
execute: (raw, [id]) => raw.api.companies.showCompany(id),
}),
)
Every operation has a factory and hook except those the SDK handles elsewhere: sign-in, MFA verification and token flows go through sdk.auth, the MCP OAuth flow is for MCP clients, integrated document mutations use their own helpers, and the app-store and unsubscribe links are browser endpoints. Lists across every housing community you can access end in ForUser or ForCompanies (useTasksForUser, useInvoicePlansForCompanies) and take companyIds to narrow them; operations that act on many companies at once start with Multiple (useCreateMultipleTasks).
useIssues, useMeetings and useOwnershipChanges read across every housing community (API: company) you can access when companyId is omitted. While the id is loading, pass enabled: !!companyId to useIssues, or spread the matching query options with it into your own useInfiniteQuery call.
Cache keys and defaults
Query keys start with a key-factory array: [issueKeys.list(companyId), ...filters]. Invalidate with { queryKey: [issueKeys.list(companyId)] }, outer brackets included; [issueKeys.all] refreshes every issue query.
Query and React wrappers stay disabled until their required ids are set, include fields in the query key, and invalidate related queries after a successful mutation. Some set a staleTime (up to an hour); the rest use TanStack Query’s default of 0. To change a default, spread the query options into your own useQuery call and override it.
Errors
| Client | A failed call |
|---|---|
| Kotlin | Throws SoliboSDKError (statusCode; errors, each with property and message, and code when the body is only a code; kind; reason). A 429 that outlasts the retries throws RateLimitException (retryAfterSeconds); a sign-in route’s 429 throws it at once, and a sign-in endpoint that answers with a redirect throws RedirectException. A 401 is not thrown: check response.success before calling .body(). |
| TypeScript | Facade calls throw SoliboApiError with status, errors, kind (DEFECT, EXPECTED_AUTH, USER_INPUT or FEATURE_OFF), reason (a FailureReason name, or the raw value this SDK does not know) and isDefect. The underlying Kotlin error is on .cause, and status is undefined for rate limits and network errors. |
| React | Mutation hooks also offer onValidationError(errors => …) on the mutation result, which receives the field errors of a 422. |
The client has already retried 429 responses, and 5xx responses to reads (see What the client does for you): show the message and let the person try again. A failed mutation was sent only once and may still have been applied, so refresh what the person sees before they repeat it. Authentication methods may also return null or false; see Authentication and two-step verification. Wire format, including the two error shapes: developers.solibo.no/api#errors.
@solibo/solibo-query reads any rejection, whatever layer it came from:
| Helper | Gives |
|---|---|
errorStatus(error) | The HTTP status as a number (status or statusCode, a number or a bigint, also on .cause), or undefined when the request got no answer. |
errorDetails(error) | The backend’s problem details: { message, property, rule, value, code, reason } for each. |
errorMessage(error) | Their messages, one per line without repeats, or undefined. |
hasErrorRule(error, rule, property?) | Whether a 422 names that violation, such as EpostIsUsedByAnotherPerson. |
isDefinitiveRejection(error) | Whether asking again cannot help: a 4xx other than 408, 425 and 429. |
defaultQueryRetry(failureCount, error) | A TanStack Query retry: never after a definitive rejection, up to DEFAULT_QUERY_RETRIES (2) more times otherwise. The client has already retried 429 and 5xx inside the call. |
import { QueryClient } from '@tanstack/react-query'
import { defaultQueryRetry } from '@solibo/solibo-query'
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: defaultQueryRetry } } })
Paged lists
Paged endpoints return items, meta, and paging. Pass paging.next as pageToken for the next request, and stop when paging.next is null, absent or END_OF_LIST. Some endpoints return arrays or other collection shapes instead.
Walking pages
import no.solibo.oss.sdk.api.gen.models.Company
val companies = mutableListOf<Company>()
var pageToken: String? = null
do {
val page = sdk.api.companies.indexCompany(pageToken = pageToken, count = 100).body()
companies += page.items
pageToken = page.paging.next?.takeUnless { it == "END_OF_LIST" }
} while (pageToken != null)
import type { Company } from '@solibo/solibo-sdk'
const companies: Company[] = []
let pageToken: string | undefined
do {
const page = await sdk.api.companies.indexCompany({ pageToken, count: 100 })
companies.push(...page.items)
pageToken = page.paging.next && page.paging.next !== 'END_OF_LIST' ? page.paging.next : undefined
} while (pageToken)
In React, paged hooks expose data.pages, fetchNextPage, and hasNextPage:
import { useIssues } from '@solibo/solibo-react'
function IssueList({ companyId }: { companyId: number }) {
const { data, isPending, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = useIssues({ companyId })
const issues = data?.pages.flatMap(page => page.items ?? []) ?? []
if (isPending) return <p>Loading…</p>
if (isError) return <p>Could not load issues.</p>
return (
<>
{issues.map(issue => <div key={String(issue.id)}>{issue.title}</div>)}
{hasNextPage && (
<button disabled={isFetchingNextPage} onClick={() => fetchNextPage()}>Load more</button>
)}
</>
)
}
autoPaginate: true asks the server for every page in one response. Use it for short lists, and walk the pages when a list can be long.
Every page
| Helper | Package | Does |
|---|---|---|
usePagedItems(data) | @solibo/solibo-react | The items of the pages loaded so far, stable while the pages are unchanged. |
useAllPages(query, enabled?) | @solibo/solibo-react | Loads every page of an infinite query one after the other; returns { items, isComplete, isPending, isError, error }. |
DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE | @solibo/solibo-react | 20 for a list shown page by page; 1000, the largest page the backend serves. |
fetchAllPages(fetchPage) | @solibo/solibo-query | Outside React: reads pages until END_OF_LIST and returns their items. |
import { MAX_PAGE_SIZE, useAllPages, useConversationCategories } from '@solibo/solibo-react'
const { items: categories, isComplete } = useAllPages(
useConversationCategories({ companyId, count: MAX_PAGE_SIZE }),
)
Permissions
useUserActions lists the actions the signed-in user holds in a company. Each one is a pattern: * and -1 match any characters, as the backend’s policy matcher does.
| API | Package | Does |
|---|---|---|
matchesAction(actions, action) | @solibo/solibo-query | Whether the held actions cover action. |
matchesAnyAction(actions, required) | @solibo/solibo-query | Whether they cover one of required (true for none). |
useCompanyActions(companyId) | @solibo/solibo-react | Every page of the actions, loaded once and kept five minutes: { actions, has(action), isPending, isComplete, isError, refetch }. |
useHasAction(companyId, action) | @solibo/solibo-react | { allowed, isPending, isError, refetch }; allowed stays false until every page has loaded. |
Sealed types
A result whose contract type is a sealed one carries its wire discriminator as type: residents (solibo.residents.query.domain.PersonResident, …) and conversation participants (solibo.conversation.query.domain.PersonParticipant, …, typed ParticipantTypeName). Test them with the guards from @solibo/solibo-sdk (also /core), which also recognize a model built in Kotlin: isPersonResident, isOrganizationResident, isPersonParticipant, isOrganizationParticipant, isEmployeeParticipant, isInquiryParticipant, isSupplierContactParticipant, isClientUserParticipant and isBoardParticipant.
import { isPersonParticipant, isSupplierContactParticipant } from '@solibo/solibo-sdk'
const profile = isPersonParticipant(participant)
? participant.person?.id
: isSupplierContactParticipant(participant) ? participant.contact?.id : undefined
Dates and URLs
Command fields typed SoliboInstant and SoliboLocalDate are strings. @solibo/solibo-query writes and reads them:
| Helper | Does |
|---|---|
toSoliboInstant(value) | A Date, epoch milliseconds or date string as ISO 8601 UTC. Throws RangeError for an invalid date. |
toSoliboLocalDate(value) | The local calendar day of a Date as YYYY-MM-DD; a YYYY-MM-DD string is kept, never shifted a day. |
instantToDate(value) | A Date from a Date, an ISO string, an SDK date/time result, a YYYY-MM-DD date (local midnight) or epoch milliseconds; undefined for nothing or no date. |
resolveApiUrl(sdk, url) | A relative URL from a response (a profile image, a logo) joined to the client’s API root, apiBaseUrl on the raw API; absolute, data: and blob: URLs stay as they are. resolveUrlAgainst(base, url) takes the root itself. |
Lookups
| API | Package | Does |
|---|---|---|
companySummaryQueryOptions(sdk, { companyId }) (also companyNameQueryOptions) | @solibo/solibo-query | A company’s CompanySummary: { id, name, classification, subTypes }, from indexCompanyNames. Lookups made in the same task share one request per hundred companies; a company the caller may not see fails with 404. Needs only ListCompany. |
useCompanySummary(companyId), useCompanySummaries(ids) (also useCompanyName, useCompanyNames) | @solibo/solibo-react | The same for one company, or { names, isPending, failedIds } for a set, with each company’s classification and sub types. |
allCountriesQueryOptions(sdk), countryById(countries, id) | @solibo/solibo-query | Every country by id, read once and kept a day, with its ISO code (iso). Country ids are backend data: do not hard-code them. |
preferredLanguageCountryId(user) | @solibo/solibo-query | The country id of the signed-in user’s preferred language (preferredLanguage). |
useCountryLookup(), useCountry(id), usePreferredLanguageCountry() | @solibo/solibo-react | The lookup, one country, and the user’s preferred language country with its upper-case iso. Map the ISO code to the app’s own languages. |
Field projections
Pass fields to request fewer response fields. Omitted fields may be absent even when the full model requires them. See Field projections for safe Kotlin and TypeScript examples.
Documents
Start with upload examples or reusing documents.
| Task | React hook |
|---|---|
| Upload one private file | useUploadDocument() |
| Upload to a resource | useUploadDocumentBelongsTo() |
| Upload several private files | useMultiUploadDocument() |
| Upload to a public conversation | usePublicUploadDocumentToConversation() |
| Upload several public conversation files | useMultiUploadPublicDocumentToConversation() |
| Send a public conversation message with pasted images | useCreatePublicConversationMessageWithInlineImages() |
| Create a directory | useCreateDocumentDirectory() |
| Reuse an existing file | useCreateDocumentReference() |
| Resolve a private download URL | useGetDocumentURL(params) |
| Resolve a public download URL | usePublicDocumentURL(params) |
| Resolve a public conversation document URL | usePublicConversationDocumentURL(params) |
| Resolve a public URL from an event handler | usePublicGetDocumentURL(params) |
| Sign up to 100 private documents at once | useDocumentURLs(params) |
| Sign up to 100 public documents at once | usePublicDocumentURLs(params) |
Query factories use the same names without use, followed by MutationOptions or QueryOptions (for example, uploadDocumentMutationOptions). The exception is usePublicDocumentURL, whose factory is publicGetDocumentURLQueryOptions.
The URL hooks cache each rendition, so components that show the same picture share one request. They stay idle until every id is set. The private and public ones also send the lookups a screen makes together as one batch request per company and rendition; a lookup made alone, or with fields, keeps the single-document endpoint. usePublicConversationDocumentURL always asks for the URL. Its sibling usePublicConversationDocument passes redirect through, and that endpoint redirects unless redirect is false.
usePublicGetDocumentURL is imperative. Each call is a request that bypasses the cache, so use it for downloads and other clicks, not for rendering. Configure it with companyIdOverride and call getDocumentURL(documentId), or configure it with slug and call getDocumentURL(conversationId, documentId). The slug (companySlug in other helpers) is the housing community’s public homepage name (Company.slug). A public conversation is an inquiry sent from that page by someone who is not signed in; companyIdOverride is the companyId.
Choosing a multi-file helper
Private uploads take companyId, documentType, and fileList. Add parentId for a directory or belongsToId for resource attachments. Public conversation uploads take companySlug, conversationId, and fileList.
Both multi-file helpers accept FileList or File[] and return a settled result for each file in input order. Inspect each result’s status, even when the mutation succeeds; one failed file does not stop the others. An optional onUploadProgress receives { file, loaded, total, fraction }.
The public conversation uploads resolve to { documentId }, the created document’s id from the X-Document-Id response header (null from a backend that does not send it); in the multi-file helper it is each fulfilled result’s value. An image uploaded this way can be embedded in the same participant’s next open-page message as <img data-solibo-document-id="{documentId}">. useCreatePublicConversationMessageWithInlineImages() does that for pasted images: pass companySlug, conversationId, content with an inlineDocumentImageSlot(slot, alt) marker per image, and inlineImages ({ [slot]: File }). It uploads each referenced image, puts data-solibo-document-id in place of each slot marker, sends the message, and resolves to { content, documentIds }. A slot without a file fails before anything is uploaded; when an upload fails it deletes the images it uploaded and throws PublicConversationInlineImageUploadError without sending. Once the images are uploaded, a failed message leaves them on the conversation. Outside React, use createPublicConversationMessageWithInlineImagesMutationOptions(sdk, queryClient) or createPublicConversationMessageWithInlineImages(sdk, params).
Integrated resource mutations
To create or update a resource together with its documents, use sdk.api.integratedDocuments in Kotlin, *WithDocumentsMutationOptions in TanStack Query, or use*WithDocuments() in React. Settlements, settlement custom costs, expenses, insurances, loans, issues, meetings, routines, suppliers for a company and signed-in inquiries take { cmd, documents }, with documents as { attachments, removeDocumentIds, agreement, inlineDocuments, idempotencyKey, onUploadProgress } where the owner has them; see Resources that own documents, which also covers owner deletes and useChangeSettlementType(). The other helpers cover posts, comments, newsletters, practical information, neighborhood groups, conversations and their draft initial messages, conversation messages, and internal conversation messages (createConversationInternalMessage(...) / useCreateConversationInternalMessageWithDocuments(), whose documents only the internal chat shows).
Use DocumentInput.Upload(...) / DocumentInput.Existing(...) in Kotlin. TypeScript accepts { file }, { fileName, bytes, contentType }, or { sourceDocumentId }. Depending on the resource, pass them as image, attachments, or named inlineDocuments slots. See the post example.
The resource change and document references are saved together after uploads are prepared. Query and React helpers refresh related caches on success.
For conversations, use createConversation(...) / useCreateConversationWithDocuments() for the initial message and updateConversation(...) / useUpdateConversationWithDocuments() to edit a draft’s initial message. Both accept attachments, inlineDocuments, and idempotencyKey; updates also accept removeDocumentIds and require command.content. The update operation only accepts draft conversations. Create keeps its { conversation, documents } result; update returns { resource, documents }, where documents contains the finalized content, document list, and idempotency key. The Kotlin create helper keeps onUploadProgress as its fourth argument; use named arguments for the appended inlineDocuments and idempotencyKey.
Failure and retry behavior
- Conversation creation and draft updates use the same atomic finalization and retry behavior as message creation. Upload failures do not create a conversation. The deprecated
CreateConversationDocumentUploadExceptionis no longer thrown. - For integrated mutations, a definitive backend rejection (a 4xx other than 408, 425 or 429) triggers upload cleanup and is not retried. Cleanup failures appear in
IntegratedDocumentMutationException.rollbackFailures; the exception’sstatusCodeis the refusal’s status, and itscauseis theSoliboSDKErrorwith the backend’s error details. - Automatic finalization retries reuse the prepared document inputs and idempotency key.
- If the final response is lost, the outcome may be unknown and staged uploads are retained. Call the helper again with the exception’s
idempotencyKeyand the same request data and files. The new call uploads the files again under new upload tickets; Solibo Home matches the retry by the key, the request data and the file names, returns the saved result when the first attempt committed, and discards the new uploads. Reusing the key with changed request data or another file is refused with HTTP 400, so use a new key for a changed request. IntegratedDocumentMutationCancellationExceptionexposesphase,outcomeUnknown, andidempotencyKey. Cancellation during finalization can still leave a completed resource; cancellation during upload hasoutcomeUnknown = false.
Download and delete behavior
Download helpers return a signed URL. Request a fresh URL to change image transformations; see image options.
deleteDocument(...) deletes document metadata. It does not follow a storage delete URL returned in the response’s Location header. Only send DELETE to that URL when you intend to permanently remove the underlying file too.
Accounting queries
| Query factory | React hook |
|---|---|
accountingOverviewQueryOptions | useAccountingOverview |
accountingPortfolioOverviewQueryOptions | useAccountingPortfolioOverview |
accountingProjectQueryOptions | useAccountingProject |
accountingEntriesQueryOptions | useAccountingEntries |
companyAccountingEntriesQueryOptions | useCompanyAccountingEntries |
Use the parameters offered by sdk.api.accounting for company filters, dimensions, search, pagination, and field selection. Portfolio and entry hooks return infinite pages.
Periods include periodStart and exclude periodEnd. Keep monetary amounts as decimal strings. Read company coverage and availability metadata alongside results; missing availability does not mean data is available. Your portfolio is the set of housing communities you can access. Leave companyIds out to use all of them; the accounting endpoints reject an explicitly empty list.
Bank account queries
| Query factory | React hook |
|---|---|
companyBankAccountsQueryOptions | useCompanyBankAccounts |
companyBankAccountTransactionsQueryOptions | useCompanyBankAccountTransactions |
Both take the parameters of the matching sdk.api.bankAccounts operation, including fields, pageToken, autoPaginate and count, and return infinite pages. Transactions are newest first, with undated transactions last. Pass from and to together as YYYY-MM-DD dates, or omit both to include undated transactions. count accepts 1–100, and the bank provider does not support autoPaginate. Amounts are unsigned decimal strings; creditDebitIndicator gives the direction.
Invoicing: overdue stages and ledger refresh
| Factory | React hook |
|---|---|
invoicingOverdueTypesQueryOptions | useInvoicingOverdueTypes |
showInvoicingCompanyLedgerRefreshQueryOptions | useInvoicingCompanyLedgerRefresh |
refreshInvoicingCompanyLedgerMutationOptions | useRefreshInvoicingCompanyLedger |
invoicingOverdueTypesQueryOptions lists the overdue stages (expired types) that overdueInvoicesQueryOptions can ask for, as infinite pages. refreshInvoicingCompanyLedger starts a refresh of a company’s ledger from Tripletex and answers with its CustomerLedgerRefreshStatus (IDLE, UPDATING, SUCCEEDED, FAILED, PAUSED); poll showInvoicingCompanyLedgerRefreshQueryOptions while it is UPDATING. The mutation refetches the finance queries when it is accepted and never retries on its own.
invoicePlansQueryOptions / useInvoicePlans take failedSince (epoch milliseconds): the list then holds only the plans whose newest run since then has an invoice that failed and was not sent. It is part of the query key, and running a plan (createInvoicingPlanTransactionsMutationOptions) invalidates the list.
plannedInvoicePreviewsQueryOptions / usePlannedInvoicePreviews({ companyId, year, month }) list the planned invoice of each active plan, with its total, as infinite pages. With year and month it is the invoice dated in that month; without them, each plan’s next invoice. A plan with nothing to invoice has no invoice. The query is keyed under invoicingKeys.preview(companyId), so every change that refreshes a company’s invoice previews refreshes it too.
Utility usage
| Query factory | React hook |
|---|---|
companyUtilityUsageQueryOptions | useCompanyUtilityUsage |
sectionUtilityUsageQueryOptions | useSectionUtilityUsage |
Both take from, to, interval (DAY, WEEK, MONTH), utility (HEAT, HOT_WATER, COLD_WATER, ELECTRICITY) and fields; the section query also takes sectionId and stays idle until both ids are set. from and to are epoch milliseconds whose Europe/Oslo dates are the first and last day included, at most 400 days apart; without them the range ends yesterday and covers 30 days, 26 weeks or 13 months. The company read gives totals per utility with the average per reporting section (null under three sections); the section read is refused for anyone but the section’s owners, tenants, co-habitants and contact persons. The queries are keyed under utilityUsageKeys.company(companyId) and utilityUsageKeys.section(companyId, sectionId); a number and a bigint, or an enum and its name, share one cache entry.
Board member terms and supplier invoice comments
| Task | Factory | React hook |
|---|---|---|
| Set or clear the year a board role’s term ends | setBoardMemberTermMutationOptions | useSetBoardMemberTerm |
| Comment on a supplier invoice | createInvoiceCommentMutationOptions | useCreateInvoiceComment |
useSetBoardMemberTerm() takes { companyId, personId, cmd: { roleId, termEndsYear } }, where termEndsYear: null clears the term; only board chair, member and alternate roles have one, and the role’s validity and access do not change. It refreshes the board member lists and the person. useCreateInvoiceComment() takes { companyId, invoiceId, cmd: { text } } and resolves the new SupplierInvoiceComment. The comments come with each invoice, so it refreshes the company’s supplier invoice lists, the archive and the list across companies.
List filters added in 1.52.0
The newsletter and SMS broadcast lists (newslettersQueryOptions, broadcastsQueryOptions, newslettersForUserQueryOptions, broadcastsForUserQueryOptions) take orderBy (MassCommunicationOrder: PUBLISHED_FIRST, DRAFTS_FIRST, NEWEST_FIRST). documentsForUserQueryOptions takes documentIds. tasksQueryOptions and tasksForUserQueryOptions take taskIds, deleted, includeDeleted and orderDirection (TaskOrderDirection: ASC, DESC). suppliersForCompanyQueryOptions takes category. Each is part of the query key.
Follow-ups
followUpsQueryOptions / useFollowUps({ companyIds, includeAwaitingOthers }) list what the signed-in person should act on across housing communities: supplier invoices first, then expenses, both awaiting their approval, then meeting protocols awaiting their signature. Each item is a SupplierInvoiceFollowUp, ExpenseFollowUp or MeetingProtocolFollowUp; check it with instanceof in TypeScript or is in Kotlin. Every item has a key that is unique across types, the company, progress (done of required) and viewerStatus, plus the ids that the approve, reject and sign hooks need (invoiceId, expenseId, or meetingId and attendeeId).
Without companyIds the list covers every company the person can act in, so a dashboard can call useFollowUps({ count }) and fetch the remaining pages. With companyIds it covers those companies (at most 500); an empty array keeps the query idle. By default only AWAITING_ME items are returned; includeAwaitingOthers: true adds items the person has approved or signed while others have not, with pending naming who still has to act. Send reminders with useCreateInvoiceNotice() (invoices) and useCreateSignatureReminder() (protocols). The query is keyed under followUpKeys.list(), and the invoice, expense and meeting mutations that change an item refresh it.
Company partner agreements
| Task | Factory | React hook |
|---|---|---|
| Check whether a company has an active agreement with a partner | companyPartnerAgreementQueryOptions | useCompanyPartnerAgreement |
| List a company’s partner agreements (staff) | companyPartnerAgreementsQueryOptions | useCompanyPartnerAgreements |
| List a partner’s agreements with every company (staff) | partnerAgreementsQueryOptions | usePartnerAgreements |
| Start or end a company’s agreement with a partner (staff) | updateCompanyPartnerAgreementMutationOptions | useUpdateCompanyPartnerAgreement |
A partner is an integration such as lavli; the backend answers 404 for a partner it does not know. The status query needs GetCompany on the company and stays idle until both companyId and partner are set. The listings and the update are for Solibo staff, and the update is refused for calls made with an integration’s own token. The queries are keyed under companyKeys.partnerAgreements(companyId) and companyKeys.agreementsWithPartner(partner), and the update refreshes both.
Company addresses
| Task | Factory | React hook |
|---|---|---|
| List a company’s addresses | companyAddressesQueryOptions | useCompanyAddresses |
| Add an address | createCompanyAddressMutationOptions | useCreateCompanyAddress |
| Change an address | updateCompanyAddressMutationOptions | useUpdateCompanyAddress |
| Remove an address | deleteCompanyAddressMutationOptions | useDeleteCompanyAddress |
The mutations take { companyId, cmd }, { companyId, addressId, cmd } and { companyId, addressId }. A change replaces every field, so a zip code or area left out of cmd is cleared; sections registered on the address keep it. The backend refuses to remove an address with a 422 while any section, including a deleted one, is registered on it. Norwegian zip codes (countryId 160) must have four digits. Each mutation refreshes the company’s addresses (companyKeys.addresses(companyId)), the company and its detailed view, and the company lists.
Meeting summons PDF
meetingSummonsPdfQueryOptions / useMeetingSummonsPdf({ companyId, meetingId }) fetch the summons PDF, which the server generates on request. It is only available while the meeting is PLANNING or NOTIFIED. The query is keyed under meetingKeys.detail(meetingId), so any mutation that refreshes the meeting also refreshes the PDF.
Section status
sectionStatusQueryOptions / useSectionStatus({ companyId, sectionId }) return the section’s statuses keyed by section id and then by status state, as plain objects (SectionStatusesBySection). Read one state as data[sectionId]?.CHECKED_IN. The raw api.sections.showSectionStatus returns the same nesting as a Map of Maps. sectionStatusesQueryOptions / useSectionStatuses({ companyId }) return one entry per section in the company, each with a statusMap keyed by status state.
Conversation state mutations
Use completeMultipleConversations or reOpenMultipleConversations with BatchConversationStateCommand.conversationIds. Matching *MutationOptions factories and useCompleteMultipleConversations() / useReOpenMultipleConversations() hooks are available.
Mark conversations as spam with spamConversation or spamMultipleConversations. Removing the mark with unspamConversation or unspamMultipleConversations sets the conversation back to NEW. Conversation lists and counts exclude SPAM unless the status filter names it, and ConversationCount.spam is 0 unless it does. The matching hooks are useSpamConversation(), useUnspamConversation(), useSpamMultipleConversations() and useUnspamMultipleConversations(). They refresh every conversation list and count after a change.
The internal (board-only) thread has its own read mark per person: useMarkInternalConversationRead() and useMarkInternalConversationUnread() change only the caller’s internal mark, never the public read state or the counts. They refresh the conversation and the lists, whose items show the mark as internalConversation.readByCurrentUser. useRequestInternalConversationAdministratorInput() asks the company’s administrators for input and resolves with administratorInputRequested and queuedAdministratorNotifications (0 when a request is already pending); the conversation then shows internalConversation.administratorInputRequested. All three take { companyId, conversationId }.
Conversation helpers
| Task | Factory | React hook |
|---|---|---|
| Remove conversations: drafts are deleted for good, the rest trashed, those already in the trash left alone | removeConversationsMutationOptions (removeConversations(sdk, …)) | useRemoveConversations |
Delete a folder, and with removeContents: true first remove the conversations in it and its subfolders (every page) | deleteConversationFolderMutationOptions (deleteConversationFolder(sdk, …)) | useDeleteConversationFolder |
| Change some settings of a category and keep the rest | patchConversationCategoryMutationOptions | usePatchConversationCategory |
| Send an open-page message, with or without pasted images | sendPublicConversationMessageMutationOptions | useSendPublicConversationMessage |
removeConversations takes { companyId, conversations }, each with id and status, and resolves { deletedDraftIds, trashedIds }. A conversation without a status is refused before anything changes. When the trash step fails after drafts were deleted, it rejects with ConversationRemovalError, whose deletedDraftIds are gone for good; nothing was trashed. Without removeContents, the backend moves the folder’s conversations to the root.
The category PUT replaces the name, contact flag, color, template, responsible and co-responsibles, and keeps the description, staffManaged and representAsBoard when they are null. The patch takes { companyId, categoryId, changes }, reads the whole category and sends the merged command (mergeConversationCategoryUpdate(current, changes)), so leaving a field out never clears it. Both the patch and updateConversationCategory refresh the public category lists (categoriesOpen) too. encodeContactTemplate(text) and decodeContactTemplate(html) turn a contact category’s reply template into the HTML the backend stores and back into plain text, without a DOM.
useFlagConversation() and useUnflagConversation() refresh the conversation, every list and the counts.
Resident contact details
updateResidentContactMutationOptions / useUpdateResidentContact() change only a resident’s email and phone: { companyId, residentType: 'PERSON' | 'ORGANIZATION', residentId, email?, phone? }. The SDK sends one PUT /companies/{companyId}/residents/{residentType}/{residentId}/contact request containing only the supplied email and phone. It never reads or resends the resident’s other fields. An empty field keeps the current value. It resolves { status: 'updated' }, or { status: 'conflict', conflict: 'EMAIL_IN_USE' | 'PHONE_IN_USE', property, message, otherPersonId } when another person uses the email or phone (the backend’s 422 rules EpostIsUsedByAnotherPerson and MobilIsUsedByAnotherPerson); nothing changed then. Every other failure rejects.
Push notifications
| Task | Factory | React hook |
|---|---|---|
| List the device owner’s notifications | pushNotificationInboxQueryOptions | usePushNotificationInbox |
| List the notification types and the payload fields each carries | pushNotificationTypesQueryOptions | usePushNotificationTypes |
| Mark a notification read once its content is visible | createPushNotificationReadMutationOptions | useCreatePushNotificationRead |
| Report a notification received or opened | reportPushNotificationReceivedMutationOptions, reportPushNotificationReadMutationOptions | useReportPushNotificationReceived, useReportPushNotificationRead |
Both queries take companyId, fields, pageToken, autoPaginate and count, and return infinite pages. An inbox item’s payload is typed by the notification’s type: NewOppslagPushPayload, NewPracticalInfoPushPayload, NewMessageInConversationPushPayload, NewNeighborhoodPostPushPayload or NewCommunicationCommentPushPayload. Check it with instanceof in TypeScript or is in Kotlin. It is null for a notification whose data matches no type; the raw data map is still there.