FriendChise Docs

Tools

Endpoints for built-in tools including item lists, conversions, roster templates, and the scan-to-task AI feature

FriendChise includes a set of built-in operational tools for franchise teams. These endpoints expose the tool data to authenticated org members.

Get tools by kind

GET /api/orgs/[orgId]/task-tools?kind=[conversion|item-list|roster]

Returns all tools of a given kind for the organization.

Authentication

Requires org membership.

Query parameters

ParamTypeRequiredValuesDescription
kindstringYesconversion, item-list, rosterType of tool to return

Response

{
  "items": [ ... ]
}

The shape of each item in items depends on kind:

  • conversion — unit conversion sets (e.g. weight, volume, temperature)
  • item-list — named item lists for inventory, prep, or ordering
  • roster — roster templates for scheduling

Errors

StatusReason
400kind is missing or not one of the allowed values
401Not authenticated
403Not a member of the org

List tool items (item list — paginated)

GET /api/orgs/[orgId]/tools/item-list

Returns a paginated list of items from the organization's item-list tool. Includes signed image URLs for items that have images.

Authentication

Requires org membership.

Query parameters

ParamTypeDefaultMaxDescription
pageinteger1Page number
limitinteger24100Items per page
searchstringFilter by item name or unit

Response

{
  "items": [
    {
      "id": "item_01abc",
      "name": "Bread Flour",
      "unit": "kg",
      "imgUrl": "orgs/org_01abc/tools/item_01abc.jpg",
      "imageSignedUrl": "https://supabase.co/..."
    }
  ],
  "totalCount": 18,
  "totalPages": 1,
  "page": 1,
  "pageSize": 24,
  "search": ""
}

imageSignedUrl is null if the item has no image.


Get scan-to-task history

GET /api/orgs/[orgId]/tools/scan-to-task/history

Returns a cursor-paginated list of previous scan-to-task results for the organization, including drafted tasks and potential duplicates.

The scan-to-task feature processes an uploaded document or photo with an AI model and extracts a draft task (title, description, steps). This endpoint returns the results of past scans.

Authentication

Requires MANAGE_TASKS permission in the org.

Query parameters

ParamTypeDefaultMaxDescription
cursorstringID of the last result from the previous page
limitinteger2550Results per page

Response

{
  "results": [
    {
      "id": "scan_01abc",
      "batchId": "batch_01abc",
      "fileName": "recipe-card.jpg",
      "fileKind": "image",
      "fileSize": 204800,
      "draft": {
        "title": "Vanilla Custard Filling",
        "description": "Whisk egg yolks and sugar...",
        "sourceText": "From the original recipe card."
      },
      "error": null,
      "taskId": null,
      "createdAt": "2026-08-15T14:30:00.000Z",
      "updatedAt": "2026-08-15T14:30:01.000Z",
      "duplicateCandidates": [
        {
          "taskId": "tsk_existing",
          "title": "Custard Filling",
          "score": 0.89
        }
      ]
    }
  ],
  "nextCursor": "scan_last_id"
}
FieldDescription
draftExtracted task draft from the AI model, or null if extraction failed
errorError message if processing failed, or null
taskIdID of the task created from this result, or null if not yet converted
duplicateCandidatesUp to 3 existing tasks in the org that may overlap with this draft (similarity score 0–1)
nextCursorUse as cursor on the next request; null when no more results

Errors

StatusReason
400Invalid cursor value (does not match a scan result in this org)
401Not authenticated
403User lacks MANAGE_TASKS permission
500Unexpected server error

GET /api/menu/[token]/items

Returns the items on a publicly shared menu. This endpoint does not require authentication — it is accessible to anyone with a valid menu token.

Path parameters

ParamDescription
tokenPublic share token for the menu

Response

Paginated list of menu items with signed image URLs.

{
  "items": [
    {
      "id": "item_01abc",
      "name": "Original Glazed",
      "description": "Classic yeast doughnut with vanilla glaze.",
      "imageSignedUrl": "https://..."
    }
  ],
  "totalCount": 12
}

Errors

StatusReason
404Token does not match any active menu

AI Scan to Task

The scan-to-task workflow is now available through mobile-facing REST endpoints:

  • POST /api/orgs/[orgId]/tools/scan-to-task/upload-urlMANAGE_TASKS, accepts { fileName, mimeType }, returns { signedUrl, path }, and reports 400, 401, 403, or 500 when signing fails.
  • POST /api/orgs/[orgId]/tools/scan-to-taskMANAGE_TASKS, accepts { sources, instruction? }, returns { results }, and reports 400, 401, 403, 415, 429, or 500 on scan failure. Demo-limit responses return { "error": "Sign up to continue using this feature." }.
  • POST /api/orgs/[orgId]/tools/scan-to-task/confirmMANAGE_TASKS, accepts { resultId, fileName, title, description, summary, durationMin, peopleRequired, minWaitDays, maxWaitDays } with optional color and sourceText, returns 200 { taskId, resultId }, and can return 400, 403, 409, or 500.
  • POST /api/orgs/[orgId]/tools/scan-to-task/clearMANAGE_TASKS, accepts { resultId }, returns 200 { ok: true } when the scan result is cleared, and can return 400, 403, 404, or 500 if the payload is invalid, the caller lacks access, the result is missing, or the server errors.

See scan-to-task history for the results endpoint that is already available.