Ceyu

API recipes

These recipes use the official client, bounded pagination and explicit error handling. Their request shapes are exercised by the SDK test suite.

Create form submissions as tasks

import { CeyuApiError, CeyuClient } from "@ceyu/api";

const ceyu = new CeyuClient({ apiKey: process.env.CEYU_API_KEY! });
try {
  await ceyu.createTask({
    workspace: process.env.CEYU_WORKSPACE_ID!,
    project: process.env.CEYU_PROJECT_ID!,
    title: submission.subject,
    description: submission.message,
  }, { idempotencyKey: `form:${submission.id}` });
} catch (error) {
  if (error instanceof CeyuApiError) console.error(error.code, error.requestId);
  throw error;
}

Read time entries incrementally

Persist next_cursor after each successful page and pass it back as starting_after. Select only the fields needed by the accounting transform.

Notify Slack after a status change

Subscribe only to task update events, verify the raw body, acknowledge immediately, then post to Slack from a queue. Store the Ceyu event ID before sending to make retries harmless.

Build a two-way sync without a loop

Create the endpoint with exclude_own_events, map both systems’ IDs in durable storage, use the external change ID as Idempotency-Key, and reject stale updates with If-Match.