Asynchronous mode

An API call that includes the mode=async key-value pair will be satisfied asynchronously:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/search'\
  '?terms=foo'\
  '&mode=async'
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser'\
  '?url=https://example.com/'\
  '&mode=async'
In response, the API will provide a JSON job identifier:
{ "id": "078fd246-f0f7-44a0-aabb-cadd7b12454f" }
{ "id": "1851dab8-4619-409f-893f-47dd3a180bc3" }
The job results or content or job status can be requested at any time thereafter by passing the identifier to https://‍/search/results or https://‍/browser/content:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/search/results'\
  '?id=078fd246-f0f7-44a0-aabb-cadd7b12454f'
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/browser/content'\
  '?id=1851dab8-4619-409f-893f-47dd3a180bc3'
The results or content, if ready, will be returned in the same format as synchronous results or synchronous content; otherwise, a JSON status message will be returned. A retrieving status indicates that the search or request is in progress:
{ "status": "retrieving" }
A failed status indicates that the search or request was unsuccessful and the call should be retried:
{ "status": "failed" }
Here are the scheduling keys and values:
KeyRequiredValue
modeThe synchronous or asynchronous mode of retrieving content, sync or async; sync is the default mode
idThe identifier provided by the API for an asynchronous job