Skip to main content
Four calls that do real work. Each one is complete — paste it, and it runs. They assume your key is in an environment variable and that you have picked a workspace, either by setting a default or by passing workspace as shown. See Quickstart if you have not made a key yet.

1 · How many credits are left

The one call that takes no workspace — credits belong to the account, not to a single workspace.
Worth running on a schedule if you have automation that spends — a job that stops for want of credits is easier to prevent than to notice.

2 · What is going out this week

meta_line is the same sentence the schedule board shows you, so it is the right thing to put in a status message. To see where a specific piece has got to, content.status gives you counts by state plus the pieces behind them.

3 · Find something in the library, then open it

Two calls, because searching and fetching are different jobs. Search first:
Then fetch one in full, using both the kind and the id from the search result — an id alone is not enough, because different kinds of thing can share one:
An empty query returns the most recent items, which is a cheap way to see what a workspace has.

4 · Ask your knowledge base a question

Ask it the way you would ask a person — it matches on meaning, not on keywords, so a whole question works better than two words. relevance lets you drop weak hits before you show them to anyone.

Also useful

connections.status answers which providers a workspace has connected and which need attention, split into connected, needs_attention and available. It is the call to make before an automation tries to publish somewhere, so a failure becomes a warning you saw coming.

Two habits worth keeping

  • Branch on ok, never on the status code. An action that declines still answers 200. Errors and refusals has the full list.
  • Log working_in alongside the result. It is the fastest way to catch an integration quietly working in the wrong workspace.
Every action, with its arguments and its answers, is in the API reference.