@uidu/client reference
Every export of @uidu/client, grouped by domain — 154 functions, generated from the source.
Every function takes a UiduClient as its first argument. Kind: read runs a query, write runs a mutation and returns its payload (check errors), helper is pure. Auth: public token works in the browser; Bearer needs an account token (apiKey) and must run server-side — see Writes. CLI lists the uidu commands that call the function.
Domains: Client & utilities · CMS — Sites · CMS — Projects (legacy) · Stories · Help center · Knowledge base · Search · Forms · Events · Donations · Courses · Calls · Jobs & applications · Contacts & deals · Campaigns · People (HR) · Goals (OKRs) · Spaces, tasks & notes · Bookings & calendars · Models (custom data) · Provisioning & actions
Client & utilities
Client construction, errors, pagination, field-value helpers.
Guide: Client & utilities.
UiduClient— Sends GraphQL documents to one uidu endpoint with the configured credentials, and throws aUiduErrorwhen a request fails.UiduError— WhatUiduClientthrows:codeisGRAPHQL_ERROR(withgraphQLErrors),NETWORK_ERROR,TOKEN_ERRORorCONFIG_ERROR.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createClient | helper | — | — | Build a UiduClient; it needs a workspace or an endpoint, and authenticates with publicToken, apiKey or getToken. |
fromBridge | helper | — | — | Client config for a custom app, from a connected @uidu/app-bridge: the bridge's GraphQL endpoint, with its session token asked for per request. |
normalizeFieldValueContent | helper | — | — | Wrap a content payload in { value } unless it already carries a value key. Returns the input untouched when there is nothing to do. |
normalizeFieldValuesAttributes | helper | — | — | Normalize a standalone fieldValuesAttributes array. Exported for callers that assemble one by hand outside an SDK mutation. |
paginate | read | — | — | Walks every page of a Relay-style connection and returns a flat array of nodes. |
Types: PaginateOptions, UiduClientConfig, UiduErrorOptions
CMS — Sites
The new CMS: Site → page/block Models → ModelItems.
Guide: CMS — Sites.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createSite | write | Bearer | sites create | Provisions a new Site in the workspace/account (tenantId). Bearer token (apiKey) — this is workspace admin territory, never a public write. Returns the mutation payload as-is, including errors. |
getPageBySlug | read | public token | — | A page of the Site by slug, with its field values and its ordered blocks. Only published pages unless includeDrafts. |
getSingletonBlock | read | public token | — | A singleton of the Site — the header, the footer, the nav — by its Model's shortname, with its field values and blocks. |
getSite | read | public token | — | A Site by its id — for previews, where there is no domain to go by. |
getSiteByDomain | read | public token | — | The Site served on domain (e.g. www.acme.org), or null. |
listSitePages | read | public token | — | The Site's pages, for navigation and sitemaps: published only unless includeDrafts, singletons (header, footer) left out. |
Types: Site, SiteBlock, SiteFields, SiteModel, SitePage, SitePageSummary
CMS — Projects (legacy)
Legacy CMS: Project → Page → PageBlock → FieldValue.
Guide: CMS — Projects (legacy).
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createFieldValue | write | Bearer | field create | Create a field value, e.g. set a page block's field (fieldId, content). Returns the payload (with errors) or null; the new value is at fieldValue.node. |
createPage | write | Bearer | page create | Create a legacy CMS page from a templateId, with slug and optional metadataAttributes (there is no projectId attribute). Returns the payload (with errors) or null. |
createPageBlock | write | Bearer | block create | Place a template block on a page (pageId, templateBlockId, both numeric). Returns the payload (with errors) or null. |
createProject | write | Bearer | project create | Create a legacy CMS project (name, slug, domain). Returns the payload (with errors) or null; the new project is at project.node. |
getPage | read | public token | page get | A legacy CMS page by project and slug, with its metadata and ordered pageBlocks (and any linked form's questions), or null. |
getTemplate | read | public token | — | A legacy CMS template by id, with every page it holds and their blocks, or null. |
listPages | read | public token | pages list | The pages of a legacy CMS project (id and slug), one Relay page at a time; use paginate with ListPagesDocument for all of them. |
listProjects | read | public token | projects list | The workspace's CMS projects. A page lives in one, and getPage needs its id. |
Types: Page, Template
Documents (for paginate): ListPagesDocument
Stories
Blog posts / news.
Guide: Stories.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createStory | write | Bearer | stories create | Create a story; returns the payload as-is, { errors, story }, validation failures included. |
getStory | read | public token | stories get | One story with its rich-text body, or null. |
listStories | read | public token | stories list | The workspace's stories as a flat array of summaries (no body); page with first/after. |
updateStory | write | Bearer | stories update | Update a story: { input: { id, attributes } } (create it with createStory). Returns the payload (with errors) or null. |
Types: Story
Documents (for paginate): ListStoriesDocument
Help center
Help-center channels.
Guide: Help center.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createChannel | write | Bearer | channel create | Create a help-center channel. Returns the payload (with errors) or null. The new channel is at channel.node. |
deleteChannel | write | Bearer | channel delete | Delete a help-center channel by { input: { id } }. Returns the payload (with errors) or null. |
getChannel | read | public token | channel get | One help center channel with its collections and their articles in a single request (the last 100 of each), or null. |
listChannels | read | public token | channel list | The workspace's help center channels. isDefault marks the one the workspace treats as its main channel — a caller that has no channel id configured should prefer it over the first row. |
updateChannel | write | Bearer | channel update | Update a help-center channel: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Types: Channel
Knowledge base
KB collections and articles.
Guide: Knowledge base.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createKbArticle | write | Bearer | kb-articles create | Create a knowledge-base article in attributes.kbCollectionId. Returns the payload (with errors) or null. The new article is at kbArticle.node. |
createKbCollection | write | Bearer | kb-collections create | Create a knowledge-base collection. Returns the payload (with errors) or null. The new collection is at kbCollection.node. |
deleteKbArticle | write | Bearer | kb-articles delete | Delete a knowledge-base article by { input: { id } }. Returns the payload (with errors) or null. |
deleteKbCollection | write | Bearer | kb-collections delete | Delete a knowledge-base collection by { input: { id } }. Returns the payload (with errors) or null. |
getKbArticle | read | public token | kb-articles get | One knowledge-base article with its rich-text body and its collection, or null. |
getKbCollection | read | public token | kb-collections get | One knowledge-base collection with its first 50 articles, or null. |
listKbArticles | read | public token | kb-articles list | Knowledge-base articles across every collection, as a flat array; page with first/after (or last/before). |
listKbCollections | read | public token | kb-collections list | The workspace's knowledge-base collections as a flat array; page with first/after (or last/before). |
updateKbArticle | write | Bearer | kb-articles update | Update a knowledge-base article: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateKbCollection | write | Bearer | kb-collections update | Update a knowledge-base collection: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Types: KbArticle, KbCollection
Documents (for paginate): ListKbArticlesDocument, ListKbCollectionsDocument
Search
Workspace-wide full-text search.
Guide: Search.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
search | read | public token | — | Search the workspace index, optionally limited to models, with filters and sorting in params; page with first/after. |
Types: SearchResult
Forms
Forms, their questions, and visitor responses.
Guide: Forms.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createForm | write | Bearer | forms create | Create a form, questions included via attributes.formQuestionsAttributes. Returns the payload (with errors) or null. The new form is at form.node. |
createFormResponse | write | Bearer | — | Submit a new response to a form; returns the payload as-is, { errors, formResponse }, validation failures included. |
deleteForm | write | Bearer | forms delete | Delete a form by { input: { id } }. Returns the payload (with errors) or null. |
getForm | read | public token | forms get | One form with its questions (inputs, a connection of FormQuestion nodes with field metadata) ready to render, or null. |
listForms | read | public token | forms list | The workspace's forms as a flat array of summaries, without their questions (use getForm for those); page with first/after. |
updateForm | write | Bearer | forms update | Update a form: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateFormResponse | write | Bearer | — | Update a form response (answers by field value id, or a state event like 'complete!'); returns { errors, formResponse } as-is. |
Types: Form
Documents (for paginate): ListFormsDocument
Events
Events, their instances, and attendances (RSVPs).
Guide: Events.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createAttendance | write | Bearer | attendances create | RSVP a contact to an event: attendableId is an event instance id, never the event id. |
createEvent | write | Bearer | events create | Create an event; returns the payload as-is, { errors, event }, validation failures included. |
getEvent | read | public token | events get | One event with its primary address, its next or current instance and all its instances, or null. |
listEvents | read | public token | events list | The workspace's events as a flat array of summaries, each with its next or current instance; page with first/after. |
updateEvent | write | Bearer | events update | Update an event: { input: { id, attributes } } (create it with createEvent). Returns the payload (with errors) or null. |
Types: Event
Documents (for paginate): ListEventsDocument
Donations
Donation campaigns and donations.
Guide: Donations.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createDonation | write | Bearer | — | Record a donation (amount in cents) to a campaign, creating the donor's contact inline; returns { errors, donation } as-is. |
createDonationCampaign | write | Bearer | donations create | Create a donation campaign (goal in cents); returns the payload as-is, { errors, donationCampaign }. |
deleteDonationCampaign | write | Bearer | donations delete | Delete a donation campaign by { input: { id } }. Returns the payload (with errors) or null. |
getDonationCampaign | read | public token | donations get | One donation campaign with its body, its totals (goal, donationsAmount, in cents) and its donor form, or null. |
listDonationCampaigns | read | public token | donations list | The workspace's donation campaigns as a flat array of summaries with their totals in cents; page with first/after. |
updateDonationCampaign | write | Bearer | donations update | Update a donation campaign: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Types: DonationCampaign
Documents (for paginate): ListDonationCampaignsDocument
Courses
Courses, lectures and enrollments.
Guide: Courses.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createCourse | write | Bearer | courses create | Create a course from { input: { attributes } }. Returns the payload (with errors) or null. |
deleteCourse | write | Bearer | courses delete | Delete a course by { input: { id } }. Returns the payload (with errors) or null. |
getCourse | read | public token | courses get | One course with its rich-text body, or null. |
getEnrollment | read | Bearer | — | One enrollment with its course, contact and custom fields (fieldValuesByShortname), or null. |
getLecture | read | public token | — | One lecture with its body, its course and its nextLecture / previousLecture for navigation, or null. |
listCourses | read | public token | courses list | The workspace's courses as a flat array, optionally filtered with search params; page with first/after. |
listEnrollments | read | Bearer | — | Course enrollments as a flat array, optionally filtered with search params; page with first/after. |
listLectures | read | public token | — | Lectures across every course as a flat array (filter by course.id yourself), with scopes, orderBy, from/to; page with first/after. |
updateCourse | write | Bearer | courses update | Update a course: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Types: Course, Enrollment, Lecture
Documents (for paginate): ListCoursesDocument, ListEnrollmentsDocument, ListLecturesDocument
Calls
Open calls (grants, applications windows).
Guide: Calls.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
getCall | read | public token | calls get | One call (a job opening or open call) with its application form, same shape as getForm, or null. |
listCalls | read | public token | calls list | The workspace's calls as a flat array of summaries, without their forms; page with first/after. |
Types: Call
Documents (for paginate): ListCallsDocument
Jobs & applications
Job postings (calls of kind job) and the applications to them.
Guide: Jobs & applications.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
completeApplication | write | Bearer | — | Submit a draft application, the last step of applying. |
createApplication | write | Bearer | applications create | Submit an application to a job. Pass attributes.applicableId (the job's id) plus contactAttributes and/or formResponseAttributes. Returns the mutation payload as-is (including any errors) rather than throwing. |
getJob | read | public token | jobs get | Fetch a single job posting; returns null if the call is not a job. |
listApplications | read | Bearer | applications list | List applications across the workspace (requires a Bearer token). |
listJobs | read | public token | jobs list | List job postings (calls of kind job). |
updateApplication | write | Bearer | — | Update an application, optionally firing a state event (event: 'complete!'). Returns the mutation payload as-is (including any errors) rather than throwing. |
Types: Application, Job
Documents (for paginate): ListApplicationsDocument
Contacts & deals
CRM contacts, organisations and deals.
Guide: Contacts & deals.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createContact | write | Bearer | contacts create | Create a CRM contact from { input: { attributes } }. Returns the payload (with errors) or null. |
createDeal | write | Bearer | deals create | Create a deal in a pipeline (attributes.pipelineId, statusId). Returns the payload (with errors) or null. The new deal is at deal.node. |
deleteContact | write | Bearer | contacts delete | Delete a contact by { input: { id } }. Returns the payload (with errors) or null. |
getContact | read | Bearer | contacts get | One contact with its address and custom fields (fieldValuesByShortname), or null; a public token sees none. |
getDeal | read | Bearer | deals get | One deal with its pipeline, status and owner (user), or null; amount is in cents. |
listContacts | read | Bearer | contacts list | Every contact the client may see, as an array: the field is not a connection, so there is no pagination. |
listDeals | read | Bearer | deals list | The workspace's deals as a flat array, optionally filtered with search params; page with first/after. |
updateDeal | write | Bearer | deals update | Update a deal, e.g. move it to another statusId: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Types: Contact, Deal
Documents (for paginate): ListDealsDocument
Campaigns
Marketing and email campaigns.
Guide: Campaigns.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
getCampaign | read | Bearer | campaigns get | One campaign with its preferences and target list, or null; a public token sees none. |
listCampaigns | read | Bearer | campaigns list | The workspace's campaigns as a flat array, optionally filtered by kind and status; page with first/after. |
listEmailCampaigns | read | Bearer | — | The email blasts of the workspace's campaigns with their delivery metrics (sent, opened, clicked), as a flat array; page with first/after. |
Types: Campaign
Documents (for paginate): ListCampaignsDocument, ListEmailCampaignsDocument
People (HR)
Employees, employments (contracts), compensations, time clocks, benefits and HR reference data.
Guide: People (HR).
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
contractEvents | helper | — | — | Flatten employment history into dated contract events, most recent first: - the employee's earliest contract is a hire (assunzione) on its start date; - every later contract is a variation (variazione) on its start date; - any contract with an end date yields a termination (cessazione) on it. |
createBenefit | write | Bearer | benefits create | Create a benefit in the workspace's catalog (name, category, provider, employer/employee costs). Returns the payload (with errors) or null; it is at benefit.node. |
createBenefitEnrollment | write | Bearer | benefit-enrollments create | Enroll an employment in a benefit (benefitId, employmentId, enrolledAt). Returns the payload (with errors) or null; it is at benefitEnrollment.node. |
createCcnl | write | Bearer | ccnls create | Create a CCNL (national collective labor contract) — the first-class Ccnl record (code, sector, contract levels), distinct from the Kind-tagged rows listCcnls returns above. Employment.ccnl / ccnlId point at this first-class type. Requires a Bearer token (apiKey). |
createCompensation | write | Bearer | compensations create | Add a pay item to an employment (attributes.employmentId, amount, currency, frequency, effectiveFrom). Returns the payload (with errors) or null. The new item is at compensation.node. |
createEmployee | write | Bearer | employees create | Create the HR record for a workspace user (attributes.userId). Returns the payload (with errors) or null. The new employee is at employee.node. |
createEmployment | write | Bearer | employments create | Hire: open a new employment (contract) for attributes.employeeId with its start date, kind, role and hours. Returns the payload (with errors) or null. The new employment is at employment.node. |
createTimeClock | write | Bearer | time-clocks create | Record a time-clock punch (beginsAt, optional finishesAt, resourceId). Returns the payload (with errors) or null. The new punch is at timeClock.node. |
deleteCompensation | write | Bearer | compensations delete | Delete a pay item by { input: { id } }. Returns the payload (with errors) or null. |
deleteEmployment | write | Bearer | employments delete | Delete an employment by { input: { id } } (to end a contract, use terminateEmployment instead). Returns the payload (with errors) or null. |
getEmployee | read | Bearer | — | One employee with current employment, today's time clocks and the shifts of the week starting weekStartingAt (see weekStartFor), or null. |
listCcnls | read | Bearer | ccnls list | List the CCNLs (national collective labor contracts) configured for the workspace — used for an employment's ccnlId. |
listCircles | read | Bearer | — | List the workspace circles. Circles come in two flavours distinguished by kind: org units (e.g. departments — used as an employment's circleId) and roles (kind === 'role' — used as an employment's roleId). Use listRoles when you only want the role-Circles. |
listEmployees | read | Bearer | employees list | The workspace's employees with their current employment, as a flat array; page with first/after. |
listEmploymentHistory | read | Bearer | — | List every employee with their full employment (contract) history — not just the current one. Use contractEvents to turn this into a flat, dated list of hires, terminations and contract variations. |
listKinds | read | Bearer | — | List Kind records for the given polymorphic models. |
listOffices | read | Bearer | offices list | List the workspace offices — used for an employment's employmentOfficesAttributes. |
listRoles | read | Bearer | roles list | List only the role-Circles (structured job titles) — an employment's roleId. |
terminateEmployment | write | Bearer | — | Terminate (cessazione) an employment by closing it with an end date and reason. Thin semantic wrapper over updateEmployment. endReason is one of: resignation, termination, contract_end, retirement, other, resignation_just_cause, dismissal_just_cause, dismissal_subjective_reason, dismissal_objective_reason, collective_dismissal, mutual_agreement, probation_failed, death, business_closure. |
updateCompensation | write | Bearer | compensations update | Update a pay item: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateEmployee | write | Bearer | employees update | Update an employee's HR record (code, kiosk PIN, time-clock flags): { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateEmployment | write | Bearer | employments update | Update an employment: { input: { id, attributes } }; to end one, prefer terminateEmployment. Returns the payload (with errors) or null. |
weekStartFor | helper | — | — | Compute the Monday of the week containing date as an ISO8601 date string. Useful for the weekStartingAt argument required by getEmployee (and any other weekly-aggregated employee fields). |
Types: Circle, CompensationRecord, ContractEvent, ContractEventType, Employee, EmployeeContracts, EmploymentRecord, Kind, Office
Documents (for paginate): ListEmployeesDocument
Goals (OKRs)
Objectives, key results and timeframes, plus value/progress helpers.
Guide: Goals (OKRs).
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
getGoal | read | Bearer | goals get | One goal with its key results (subgoals). |
goalProgress | helper | — | — | How far the goal is, 0 to 1 (above 1 when it overshoots). goal.progress itself is percent x100: 10000 is done. |
goalTimeElapsed | helper | — | — | How much of the goal's timeframe has passed, 0 to 1, or null when it has none. A goal whose goalProgress is below this is behind schedule. |
goalValue | helper | — | — | A stored goal value (initialValue, currentValue, targetValue) in the unit a person typed: uidu keeps every one of them x100. For percentage that is percent points (45 = 45%), for currency whole units of goal.currency, for checkbox 1 or 0. null stays null. |
isGoalBehind | helper | — | — | Behind schedule: less done than time elapsed, by more than tolerance (0.1 = ten points). false for a goal with no timeframe or one already accomplished. The goal's own status (off_track, needs_attention) is its owner's judgement — show it next to this, don't replace one with the other. |
listGoals | read | Bearer | goals list | Every goal of the workspace (objectives and key results alike), newest first. Without first, all of them. |
listTimeframes | read | Bearer | timeframes list | The workspace's timeframes (the periods goals run over, active marks the current ones) as a flat array; page with first/after. |
toGoalRaw | helper | — | — | The inverse of goalValue, for updateGoal. |
updateGoal | write | Bearer | goals update | Authoring (Bearer / apiKey). Returns the payload, incl. errors. initialValue / currentValue / targetValue are stored x100: pass toGoalRaw(value), never the number a person typed. |
Types: Goal, Timeframe
Documents (for paginate): ListGoalsDocument, ListTimeframesDocument
Spaces, tasks & notes
Collaboration primitives: spaces, tasks, notes.
Guide: Spaces, tasks & notes.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createNote | write | Bearer | notes create | Create a note. Returns the payload (with errors) or null; the new note is at note.node. |
createSpace | write | Bearer | spaces create | Create a space, the container tasks live in. Returns the payload (with errors) or null; the new space is at space.node. |
createTask | write | Bearer | tasks create | Create a task, usually in a space (attributes.spaceId). Returns the payload (with errors) or null. |
deleteNote | write | Bearer | notes delete | Delete a note by { input: { id } }. Returns the payload (with errors) or null. |
deleteSpace | write | Bearer | spaces delete | Delete a space by { input: { id } }. Returns the payload (with errors) or null. |
deleteTask | write | Bearer | tasks delete | Delete a task by { input: { id } }. Returns the payload (with errors) or null. |
updateNote | write | Bearer | notes update | Update a note: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateSpace | write | Bearer | spaces update | Update a space: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateTask | write | Bearer | tasks update | Update a task, e.g. its statusId or dates: { input: { id, attributes } }. Returns the payload (with errors) or null. |
Bookings & calendars
Bookings, calendars and calendar events.
Guide: Bookings & calendars.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
getBooking | read | Bearer | bookings get | One booking with its contact, totals in cents and custom fields (fieldValuesByShortname), or null; a public token sees none. |
getCalendar | read | public token | — | One calendar (name, color, time zone), or null. |
getCalendarEvent | read | public token | — | One calendar event with its rich-text body and its calendar, or null. |
listBookings | read | Bearer | bookings list | The workspace's bookings as a flat array; page with first/after (or last/before); a public token gets an empty list. |
listCalendarEvents | read | public token | — | Calendar events as a flat array, optionally narrowed by calendarIds and named scopes (e.g. upcoming); page with first/after. |
listCalendars | read | public token | — | The workspace's calendars as a flat array; page with first/after (or last/before). |
Types: Booking, Calendar, CalendarEvent
Documents (for paginate): ListBookingsDocument, ListCalendarEventsDocument, ListCalendarsDocument
Models (custom data)
Define your own record types (Models, Fields) and store ModelItems.
Guide: Models (custom data).
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createField | write | Bearer | — | Pass fieldableId (the model) with fieldableType: 'Model': a custom app may only name a type that matches the record it loads. |
createFieldOption | write | Bearer | — | Add an option to a select-kind field (attributes.fieldId, name, color). Returns the payload (with errors) or null. |
createModel | write | Bearer | — | Create a model in a WorkspaceApp (attributes.modelableId, name, namePlural). Returns the payload (with errors) or null. |
createModelItem | write | Bearer | — | Pass attributes.modelId and attributes.fieldValuesAttributes — build the latter by shortname with toFieldValuesAttributes. |
deleteField | write | Bearer | — | Delete a field from its model by { input: { id } }. Returns the payload (with errors) or null. |
deleteFieldOption | write | Bearer | — | Delete a select option by { input: { id } }. Returns the payload (with errors) or null. |
deleteFieldValue | write | Bearer | — | Clear a single value by its FieldValue id; deleteLinkedRecord: true also deletes the record it links to. Returns the payload (with errors) or null. |
deleteModelItem | write | Bearer | — | Delete an item by { input: { id } }. Returns the payload (with errors) or null. |
ensureModel | write | Bearer | — | Find the app's model by name, or create it — and any of fields it lacks. Returns the model with all its fields. What a custom app runs on its first load until schemas come from an install-time manifest (custom apps spec, step 3). Throws a UiduError (MUTATION_ERROR) when a write is refused. |
getModel | read | Bearer | — | One model with its fields, or null when the id is not a Model. |
getModelItem | read | Bearer | — | One model item with its values and its model.id, or null when the id is not a ModelItem. |
listModelItems | read | Bearer | — | A model's items. Each carries fieldValuesByShortname — { room: 'Aula Magna', when: '…' } — the easiest shape to read values from. |
listModels | read | Bearer | — | The models of a WorkspaceApp, with their fields. |
toFieldValuesAttributes | helper | — | — | { room: 'Aula Magna' } → [{ fieldId: '<id of room>', content: { value: 'Aula Magna' } }], for createModelItem / updateModelItem. Throws on a shortname the model doesn't have; skips undefined values. |
updateField | write | Bearer | — | Update a field (name, required, preferences…): { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateFieldOption | write | Bearer | — | Update a select option: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateFieldValue | write | Bearer | — | Set a single value by its FieldValue id: { input: { id, attributes: { content: { value } } } }. Returns the payload (with errors) or null. |
updateModel | write | Bearer | — | Rename or reconfigure a model: { input: { id, attributes } }. Returns the payload (with errors) or null. |
updateModelItem | write | Bearer | — | Update an item: { input: { id, attributes: { fieldValuesAttributes } } }, built with toFieldValuesAttributes. Returns the payload (with errors) or null. |
Types: EnsureModelOptions, Model, ModelField, ModelFieldOption, ModelItem
Provisioning & actions
Create workspaces, rotate API credentials, and run any tool-flagged ActionKey.
Guide: Provisioning & actions.
| Function | Kind | Auth | CLI | Description |
|---|---|---|---|---|
createWorkspace | write | Bearer | workspace create | Create a workspace owned by the authenticated account (attributes.name, subdomain…). Returns the payload (with errors) or null. |
executeAction | write | Bearer | tools call | Run any backend action by key (an ActionKey flagged of_kind_tool_key), with optional id and attributes; returns { result, errors } or null. |
generateWorkspaceApiCredentials | write | Bearer | workspace credentials | Rotate + return a workspace's API credentials (apiKey/apiSecret). Operates on the current workspace. Use the returned credentials to wire a scaffolded app. |