Developers

Build on the school record

SchoolHub is the system of record for school data. The MySeed apps and approved partners read it through the Connect API, never by copying the school database.

  1. Step 1

    Install

    MySeed issues a one-time install code from the platform console. The installer reads GET /connect/v1/discovery, creates an Ed25519 key pair, and registers the public key and your webhook address in one call.

  2. Step 2

    Authenticate

    Sign a short JWT with your Ed25519 key (private_key_jwt) and exchange it at POST /connect/v1/oauth/token for a five-minute access token. Send the MySeed account in X-MySeed-Subject.

  3. Step 3

    Find the school

    GET /connect/v1/schools lists schools that accept connections, with the verification methods each one allows for students and guardians.

  4. Step 4

    Link the account

    Redeem a link or QR code, complete a phone code, submit student details, or create a request for the registrar or an office visit. Instant methods return a connection; the others return a request to poll.

  5. Step 5

    Read and act

    Use the connection to read the timetable, attendance, assignments, materials, results, report cards, invoices and messages, and to submit work or start a payment. Capabilities on the connection say what is allowed.

  6. Step 6

    Stay current

    Receive a signed webhook for every change, then read the details through the connection. Events carry identifiers and notification text, not school records.

Install in one call

No keys are copied by hand. The installer keeps the private key on your server and returns the webhook signing secret once. A school appears in the app school search when it has MySeed Connect and switches the apps on.

# On the MySeed Education System server, with the code from the SchoolHub console
npx myseed-schoolhub-install   --url https://api.school.myseed.com.et   --code XXXX-XXXX-XXXX-XXXX   --client-id myseed-education-prod   --webhook-url https://education.example.et/hooks/schoolhub

# Or from code
import { installSchoolHub, clientFromInstallation } from '@myseed/schoolhub-sdk';

const inst = await installSchoolHub({ baseUrl, installCode, clientId: 'myseed-education-prod', webhookUrl });
// Store inst.privateKeyJwk and inst.webhookSecret in your secret store.
const schoolhub = clientFromInstallation(inst);
await schoolhub.status(); // client, webhook and last delivery

Two APIs, one contract

Every request and response is defined once with Zod in the shared contracts package and published as OpenAPI 3.1.

Connect API

For the MySeed Education System gateway and the Student and Parent apps. Base path /connect/v1.

Connection capabilities

  • timetable
  • calendar
  • announcements
  • attendance
  • assignments
  • submit_assignments
  • materials
  • results
  • report_cards
  • fees
  • pay_fees
  • messaging
  • absence_explanations
  • correction_requests
  • bank_transfer
  • id_card

School API

Everything the SchoolHub portal does, for schools on the API module. Base path /api/v1, with session or API key authentication and Idempotency-Key support on writes.

TypeScript SDK

@myseed/schoolhub-sdk wraps the Connect API with typed calls, token handling and webhook verification. There is no direct database access: every read goes through the API.

// Exchange a client assertion for an access token (Node 20+)
import { SignJWT, importJWK } from 'jose';

const key = await importJWK(privateJwk, 'EdDSA');
const assertion = await new SignJWT({})
  .setProtectedHeader({ alg: 'EdDSA', kid: privateJwk.kid })
  .setIssuer(clientId).setSubject(clientId)
  .setAudience('https://api.school.myseed.com.et/connect/v1/oauth/token')
  .setIssuedAt().setExpirationTime('2m').setJti(crypto.randomUUID())
  .sign(key);

const { access_token } = await fetch('https://api.school.myseed.com.et/connect/v1/oauth/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    grant_type: 'client_credentials',
    client_id: clientId,
    client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
    client_assertion: assertion,
  }),
}).then((r) => r.json());

Webhooks

Each delivery carries X-SchoolHub-Signature: t=<unix seconds>,v1=<HMAC-SHA256 of t.body>. Deliveries retry with backoff for up to a day.

// Verify a webhook signature
import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifySignature(header, rawBody, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > toleranceSeconds) return false;
  const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
  const given = Buffer.from(parts.v1 ?? '');
  return given.length === expected.length && timingSafeEqual(Buffer.from(expected), given);
}

Event types

connect.connection.activated
A MySeed account was linked to a student record
connect.connection.suspended
A connection was paused (enrollment ended or school paused it)
connect.connection.revoked
A connection was revoked
connect.link_request.updated
A link request was approved, rejected or needs more information
school.enrollment.changed
A student changed section, grade or campus
school.enrollment.ended
A student left the school
school.guardian_link.changed
A guardian access profile changed
school.attendance.recorded
Attendance was submitted for a section
school.attendance.absent
A student was marked absent or late
school.timetable.published
A section timetable was published or changed
school.calendar.changed
A calendar event was added or changed
school.announcement.published
An announcement was published
school.assignment.published
An assignment was published
school.assignment.due_soon
An assignment is due within 24 hours
school.submission.received
A submission was received
school.submission.returned
A teacher returned a submission
school.material.published
A material was published or updated
school.material.withdrawn
A material was withdrawn
school.result.published
Assessment results were published
school.result.revised
A published mark was corrected
school.report_card.published
Report cards were published
school.message.created
A new parent-teacher message
school.invoice.issued
An invoice was issued
school.invoice.due_soon
An invoice is due within 3 days
school.payment.confirmed
A payment was recorded or confirmed
school.payment.verification_updated
A bank transfer was verified, recorded or rejected
school.application.received
The school received an admission application
school.application.updated
An admission application changed status (review, interview, accepted, waitlisted, rejected, enrolled)
school.id_card.issued
A student ID card was issued or replaced