TYRA Cloud Functions API (2025-12-10)

Download OpenAPI specification:

Blog-portfolio

exportBlogPosts

Generate a PDF for selected blog posts

Function returns a file_ref objectId. Use the obtained objectId to query the job status using Live Query.

Request Body schema: application/json
required
posts
required
string[]

Array of all selected posts' objectIds.

schoolId
required
string

ObjectID of the school

imageSize
'auto'|'large'|'medium'|'small'

Size proportion of images (Default: 'auto')

kidId
string

ObjectID for a kid to generate a portfolio for

imageOnNewPage
boolean

If images should be placed on a seperate page from text blocks (Default: false)

includeReflections
boolean

If reflections should be included in the PDF (Default: false)

includeCurriculums
boolean

If governing documents should be included in the PDF (Default: false)

coverPage
coverpage | null

Cover Page object (title, subtitle, image) if a cover page should be present, otherwise null.

filename
string

Desired of the file to be generated

Responses

Request samples

Content type
application/json
{
  • "posts": null,
  • "schoolId": "string",
  • "imageSize": null,
  • "kidId": "string",
  • "imageOnNewPage": true,
  • "includeReflections": true,
  • "includeCurriculums": true,
  • "coverPage": null,
  • "filename": "string"
}

Response samples

Content type
application/json
"string"

Contacts

getContacts

Fetches and returns a list of Person contact objects for a given school, selecting and filtering fields according to the caller’s role and each person’s own privacy setting.

  • Admins receive all available fields (identifiers, contact info, personal details, and sensitive data).
  • Teachers receive most fields except the most sensitive ones reserved for admins.
  • Parents receive only core identifier and public fields by default, with additional hiding of contact info or all fields based on each person’s USER_SETTING (HIDE_CONTACT_INFO or HIDE_ALL).
Request Body schema: application/json
required
schoolId
required
string

School ID to fetch contacts from.

fields
array<string>

The name of all fields to return. See {Person} object for a complete list.

roleId
required
string

Desired User Role to fetch from.

Responses

Request samples

Content type
application/json
{
  • "schoolId": "string",
  • "fields": null,
  • "roleId": "string"
}

Response samples

Content type
application/json
{ }

Kids

checkInOutKids

Will check in or check out a list of kids. Several options can be attached. To be used to check in or out even a single kid.

Will also save Log (kids log) and Notification. If sendPush, push notification is sent.

Request Body schema: application/json
required
schoolId
required
string

School id.

kidIds
required
string[]

Array of ids of Kids to check in or out.

isCheckIn
required
boolean

Whether to check in, othewise check out.

modifiedCheckInOutTime
required
date|undefined

An alternative timestamp for check in or out. If not defined, current time is used. To use for instance it the staff forgot to do it.

pickupUserRoleIds
required
(string|null)[]

People, in the form of UserRole ids (connected to User or AlternativeContact), which will be assigned to pick up the kid at end of school day. One entry for each kid, if a certain kid will not have a pickuper assigned, set the value to null. The array is allowed to be empty or shorter than the kid id list.

pickupTime
required
string

A new pickutime to be assigned for each kid in kidIds.

performerId
required
string

The UserRole which did perform the check in or out. Used for notices and push.

sendPush
required
boolean

Whether push should be sent afterwards.

Responses

Request samples

Content type
application/json
{
  • "schoolId": "string",
  • "kidIds": null,
  • "isCheckIn": true,
  • "modifiedCheckInOutTime": null,
  • "pickupUserRoleIds": null,
  • "pickupTime": "string",
  • "performerId": "string",
  • "sendPush": true
}

Response samples

Content type
application/json
null

setKidNote

Adjusts one of the three available checkinout notes for a kid.

Request Body schema: application/json
required
schoolId
required
string

School id.

kidId
required
string

Kid id to adjust checkinout note for.

noteType
required
kid_note_type

The type of note to adjust.

remove
required
boolean

If true the note will be removed instead of set.

comment
required
string|undefined

Content of the note to be set.

sendPush
required
boolean

Whether push should be sent afterwards.

Responses

Request samples

Content type
application/json
{
  • "schoolId": "string",
  • "kidId": "string",
  • "noteType": null,
  • "remove": true,
  • "comment": null,
  • "sendPush": true
}

Response samples

Content type
application/json
null

setKidPickup

Adjusts the pickup time and person who will pick up the kid.

Request Body schema: application/json
required
schoolId
required
string

School id.

kidId
required
string

Kid id to perform the operation for.

pickupUserRoleId
required
string|undefined

UserRoleid (connected to User or AlternativeContact), which will be assigned to pick up the kid at end of school day.

pickupTime
required
string

A new pickup time to be assigned to the kid.

performerId
required
string

The UserRole which did perform the operation. Used for notices and push.

sendPush
required
boolean

Whether push should be sent afterwards.

Responses

Request samples

Content type
application/json
{
  • "schoolId": "string",
  • "kidId": "string",
  • "pickupUserRoleId": null,
  • "pickupTime": "string",
  • "performerId": "string",
  • "sendPush": true
}

Response samples

Content type
application/json
null

Login

getJWT

Get Json Web Token for access to REST API.

Request Body schema: application/json
required
roleId
required
string

User Role ID

Responses

Request samples

Content type
application/json
{
  • "roleId": "string"
}

Response samples

Content type
application/json
{ }

initiateLoginSession

Initiates a login session between client and server.

Possible login actions include:

  • Verify - Verify MFA code sent to user
  • BankID - Auth using Mobilt BankID
  • Choice - Choose one of multiple users tied to username
  • Idp - Continue on external IdP site
Request Body schema: application/json
required
username
required
string

Username of the person trying to log in.

loginMethod
required
number

Username type (email, phone, nin)

clientType
required
string

Client platform (Web, Android iOS)

chosenId
string

User's objectId (if already selected by loginAction.Choice)

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "loginMethod": 0,
  • "clientType": "string",
  • "chosenId": "string"
}

Response samples

Content type
application/json
{ }

Person

createPerson

Creates a new Person object.

Request Body schema: application/json
required
givenName
required
string

The person's given name.

familyName
required
string

The person's family name.

displayName
string

The person's display name.

civicNo
string

The person's civic number.

email
string

The person's email address.

emailType
emailtype

The person's email type.

phone
string

The person's phone number.

phoneType
phonenumbertype

The person's phone type.

streetAddress
string

The person's street address.

locality
string

The person's locality.

postalCode
string

The person's postal code.

country
string

The person's country.

loginMethod
user_type

The preferred login method.

userId
string

The user ID to link to the person.

schoolId
required
string

The school ID.

Responses

Request samples

Content type
application/json
{
  • "givenName": "string",
  • "familyName": "string",
  • "displayName": "string",
  • "civicNo": "string",
  • "email": "string",
  • "emailType": null,
  • "phone": "string",
  • "phoneType": null,
  • "streetAddress": "string",
  • "locality": "string",
  • "postalCode": "string",
  • "country": "string",
  • "loginMethod": null,
  • "userId": "string",
  • "schoolId": "string"
}

Response samples

Content type
application/json
"string"

findPerson

Finds a person object for a school

Request Body schema: application/json
required
username
string

The username for the person.

userId
string

The objectId for a user to search for.

schoolId
required
string

ObjectId for the school.

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "userId": "string",
  • "schoolId": "string"
}

Response samples

Content type
application/json
null

validateInviteForm

Validate user-input for creating a person object

Request Body schema: application/json
required
territory
number

School territory (only used for civicNo validation)

email
string

Email address to validate

phone
string

Phone number to validate

civicNo
string

Civic Number (NIN) to validate

Responses

Request samples

Content type
application/json
{
  • "territory": 0,
  • "email": "string",
  • "phone": "string",
  • "civicNo": "string"
}

Response samples

Content type
application/json
null

Roles

createRole

Creates a user role for a given person based on the provided role type.

Supported role types:

  • USER_ROLE_TYPE.PARENT: Creates a guardian role.
  • USER_ROLE_TYPE.TEACHER, USER_ROLE_TYPE.ADMIN, USER_ROLE_TYPE.SUPER_ADMIN: Creates a staff role.

If req.params.personUUID is not provided, the function attempts to look up the Person using req.params.userId.

Request Body schema: application/json
required
personUUID
string

The UUID of the Person.

userId
string

The objectId of the User to link if personUUID isn't provided.

schoolId
required
string

The objectId of the School. (required)

roleNum
required
number

The role number (USER_ROLE_TYPE). (required)

title
string

Optional title for the role.

department
string

The objectId of the Department.

kidId
string

The objectId of the Kid, for parent role.

configuration
string

Serialized configuration for the role.

directActivation
boolean

Whether to activate the role immediately.

Responses

Request samples

Content type
application/json
{
  • "personUUID": "string",
  • "userId": "string",
  • "schoolId": "string",
  • "roleNum": 0,
  • "title": "string",
  • "department": "string",
  • "kidId": "string",
  • "configuration": "string",
  • "directActivation": true
}

Response samples

Content type
application/json
"string"

repairRole

Helper function to repair a user role.

Request Body schema: application/json
required
object
required
object

Missing or invalid field: object

Responses

Request samples

Content type
application/json
{
  • "object": { }
}

Response samples

Content type
application/json
{ }

School

createSchool

Create a new school

Request Body schema: application/json
required
display_school_name
required
string

Display name of the school

timezone
required
string

IATA time zone of the school

territory
required
number

ISO 3166-1 numeric country code

organisation_id
string

SS12K org ID

organisation_context_id
string

SS12K org context ID

pipedrive_deal_id
string

Pipedrive Deal ID

Responses

Request samples

Content type
application/json
{
  • "display_school_name": "string",
  • "timezone": "string",
  • "territory": 0,
  • "organisation_id": "string",
  • "organisation_context_id": "string",
  • "pipedrive_deal_id": "string"
}

Response samples

Content type
application/json
{ }

Users

requestPasswordReset

Used to request a "forgot password" email for the user. Can be used without being authenticated.

Request Body schema: application/json
required
username
required
string

Username for the user requesting a new password.

Responses

Request samples

Content type
application/json
{
  • "username": "string"
}

Response samples

Content type
application/json
{ }

deleteUserRole

Delete a user role

Request Body schema: application/json
required
userRoleId
required
string

The ObjectID of the user role to delete.

deletedByMyself
boolean

Whether the function is called by the user role owner or not.

sendPush
boolean

Whether to send push notification.

Responses

Request samples

Content type
application/json
{
  • "userRoleId": "string",
  • "deletedByMyself": true,
  • "sendPush": true
}

Response samples

Content type
application/json
{ }

deleteOwnUserRole

Delete of own user role.

Request Body schema: application/json
required
userRoleId
required
string

User Role to delete.

sendPush
boolean

Whether to send push notification.

Responses

Request samples

Content type
application/json
{
  • "userRoleId": "string",
  • "sendPush": true
}

Response samples

Content type
application/json
{ }

findUsers

Cloud function to find existing users by searching for existing records using NIN, email, or phone. It returns matched user data, with anonymization for non-matching fields.

Request Body schema: application/json
required
nin
string

National Identification Number.

email
string

Email of the user.

phone
string

Phone number of the user.

Responses

Request samples

Content type
application/json
{
  • "nin": "string",
  • "email": "string",
  • "phone": "string"
}

Response samples

Content type
application/json
null

setNIN

Set NIN for initiator

Request Body schema: application/json
required
nin
string|undefined

Param nin can be a string or undefined, in which case it is unset in the db. This is considered the users choice to not submit a nin.

territory
required
number

the territory of the nin, despite the Users territory.

Responses

Request samples

Content type
application/json
{
  • "nin": null,
  • "territory": 0
}

Response samples

Content type
application/json
{ }

verifyPassword

Verify that a given password matches the user's password. Mainly used to authorize sensitive actions in the app.

Request Body schema: application/json
required
password
required
string

The user-supplied password

Responses

Request samples

Content type
application/json
{
  • "password": "string"
}

Response samples

Content type
application/json
true