Run apps endpoint (Deprecated)
In this document, API_ROOT
defines where to route API requests for file operations, and its value is aihub.instabase.com/api/v2/zero-shot-idp/projects/app
.
IB-Context
header in all Run apps API requests for the call to complete in the organization context. This context is validated against any specified input directory or output workspace value. For example, if the IB-Context
is a user’s community account but the API request lists a shared workspace in an organization as the output workspace, the call fails. The same applies if the IB-Context
header is omitted, in which case the default community context is used.Using file paths as app input
When running apps by name or by app ID, there are two methods to specify the app’s input:
-
Preferred: Use the
batch_id
parameter to process all files in the specified batch. See the Batches endpoint for more information. -
Supported: Use the
input_dir
parameter to process all files in a specific input folder in the filesystem. This requires specifying the file path to a location in a connected drive.
The format of the file path varies if you have a community or organization account.
-
Community accounts:
/<USER-ID>/my-repo/fs/<DRIVE-NAME>/<INPUT-FOLDER>/
-
Organization accounts:
/<ORGANIZATION-ID>/<WORKSPACE>/fs/<DRIVE-NAME>/<INPUT-FOLDER>/
Running apps by app ID
Run an app by its app ID through sending a POST
request to API_ROOT/<string:app_id>/run
with the request body encoded as JSON.
You can find the app ID in the app’s AI Hub URL. For example, https://aihub.instabase.com/hub/apps/528c36e8-ac5b-490d-a41b-7eec9c404b87.
Request parameters
Parameters are required unless marked as optional.
Response schema
Examples
Request
Example (Python):
Response
The response body is a JSON object.
If successful:
Running apps by name
Run an app by its name through sending a POST
request to API_ROOT/run
with the request body encoded as JSON.
Request parameters
Parameters are required unless marked as optional.
Response schema
Examples
Request
Example (Python):
Response
The response body is a JSON object.
If successful:
Running apps in memory
Apps can also be run in memory by sending a POST
request to API_ROOT/<string:app_id>/run/sync
with the request body encoded as JSON.
Request parameters
Parameters are required unless marked as optional.
Response schema
The response contains all extracted fields. Extracted fields are dependent on how the app is built. If a field isn’t found, an empty string ''
is returned instead
Examples
Request
Example (Python):
Response
The response body is a JSON object.
If successful:
Webhook parameters
You can use the webhook_config
setting to ensure your application is notified when an app run completes.
Instabase POSTs JSON-encoded data of the format below to the webhook endpoint:
The response body contains the following fields:
-
status
:"OK" | "ERROR"
-
msg
: (optional) Error message. Present only if status is ERROR. -
job_id
: A unique identifier for the job. -
binary_path
: The path reference to flow binary file used to execute the app. -
input_dir
: Input directory. -
output
: The full path to the root output folder.
To acknowledge receipt of the event, your endpoint must return a 2xx HTTP status code. All response codes outside this range, including 3xx codes, indicate to Instabase that you did not receive the event.
If Instabase does not receive a 2xx HTTP status code, the notification attempt is repeated up to 7 times.