Skip to main content

Request methods

The HelpGenie API supports two ways to make requests: the ApiService.invoke() pattern (recommended for TypeScript projects) and direct HTTP requests. The ApiService class handles authentication, request formatting, and response unwrapping automatically:
The invoke method accepts an options object with these fields:
string
required
The API resource to target. Must be one of the 13 supported resources.
string
required
The action to perform. Common actions: all, list, get, create, update, delete.
string | number
The record identifier. Required for get, update, and delete actions.
object
The request payload. Used with create and update actions. Structure varies by resource.

Direct HTTP requests

You can also call the Edge Function directly. The API accepts both a body-based resource/action pattern and standard REST-style HTTP methods.
Send the resource, action, and data in the request body:

Common actions

Most resources support a standard set of actions. Some resources add custom actions specific to their domain.

list vs all

The API distinguishes between two fetching actions:
  • all returns full records with related data (joins, counts, nested objects). Use this when you need complete information.
  • list returns minimal records with only key fields (typically id and name). Use this for populating dropdowns, selectors, or anywhere you need a lightweight list.
Pagination differs between all and list.
  • The all action on genies uses cursor-based pagination. The response includes nextCursor and hasMore fields. Pass cursor in the request data to fetch the next page.
  • Most other resources use offset-based pagination. The response includes count, and you control paging with limit and offset in the request data.

Request examples

Create a resource

Get a single resource

Update a resource

Delete a resource

Response structure

All responses use a consistent envelope:

Success response

For list and all actions, data is an array:
When using ApiService.invoke(), the response is automatically unwrapped. You receive the data value directly, not the full envelope.

Error response

See Error handling for all error codes.

Admin mode and impersonation

Users with the internal_admin role can operate on behalf of other users by including an impersonatedUserId in the request data. This is used for provisioning trial agents, bulk operations, and testing.
Impersonation is only available to internal_admin users. Non-admin requests that include impersonatedUserId will be ignored or rejected.

Query parameters

When using REST-style HTTP requests, query parameters are automatically extracted and passed to handlers:
When using the body-based approach, include pagination and filter parameters in the data object: