diff --git a/API_REFERENCE_v1.md b/API_REFERENCE_v1.md index a3a318353..d9d53c641 100644 --- a/API_REFERENCE_v1.md +++ b/API_REFERENCE_v1.md @@ -1,5 +1,5 @@ # API v1 Reference -## Aignostics Platform API v1.0.0-ga +## Aignostics Platform API v1.4.0 > Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. @@ -80,7 +80,7 @@ fetch('/api/v1/applications', Returns the list of the applications, available to the caller. -The application is available if any of the versions of the application is assigned to the caller’s organization. +The application is available if any of the versions of the application is assigned to the caller's organization. The response is paginated and sorted according to the provided parameters. #### Parameters @@ -149,7 +149,9 @@ The response is paginated and sorted according to the provided parameters. "string" ], "msg": "string", - "type": "string" + "type": "string", + "input": null, + "ctx": {} } ] } @@ -539,7 +541,9 @@ Allows caller to retrieve information about application version based on provide "string" ], "msg": "string", - "type": "string" + "type": "string", + "input": null, + "ctx": {} } ] } @@ -617,6 +621,7 @@ Returns paginated runs that were submitted by the user. |custom_metadata|query|any|false|Use PostgreSQL JSONPath expressions to filter runs by their custom_metadata.| |page|query|integer|false|none| |page_size|query|integer|false|none| +|for_organization|query|any|false|Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.| |sort|query|any|false|Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.| ##### Detailed descriptions @@ -656,7 +661,6 @@ Returns paginated runs that were submitted by the user. - `application_id` - `version_number` - `custom_metadata` -- `statistics` - `submitted_at` - `submitted_by` - `terminated_at` @@ -700,7 +704,11 @@ Returns paginated runs that were submitted by the user. "submitted_by": "auth0|123456", "terminated_at": "2024-01-15T10:30:45.123Z", "num_preceding_items_org": 0, - "num_preceding_items_platform": 0 + "num_preceding_items_platform": 0, + "scheduling": { + "due_date": "2019-08-24T14:15:22Z", + "deadline": "2019-08-24T14:15:22Z" + } } ] ``` @@ -878,6 +886,55 @@ Status Code **200** |---|---|---|---|---| |»»» *anonymous*|null|false|none|none| +*continued* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»» scheduling|any|false|none|Scheduling constraints set for this run.| + +*anyOf* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»» *anonymous*|[SchedulingResponse](#schemaschedulingresponse)|false|none|Scheduling fields returned in run responses.| +|»»»» due_date|any|false|none|none| + +*anyOf* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»»»» *anonymous*|string(date-time)|false|none|none| + +*or* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»»»» *anonymous*|null|false|none|none| + +*continued* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»»» deadline|any|false|none|none| + +*anyOf* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»»»» *anonymous*|string(date-time)|false|none|none| + +*or* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»»»» *anonymous*|null|false|none|none| + +*or* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|»»» *anonymous*|null|false|none|none| + ##### Enumerated Values |Property|Value| @@ -925,6 +982,10 @@ const inputBody = '{ "department": "D1", "study": "abc-1" }, + "scheduling": { + "deadline": "2026-03-05T23:59:59Z", + "due_date": "2026-03-04T23:59:59Z" + }, "items": [ { "external_id": "slide_1", @@ -1058,6 +1119,10 @@ documentation "department": "D1", "study": "abc-1" }, + "scheduling": { + "deadline": "2026-03-05T23:59:59Z", + "due_date": "2026-03-04T23:59:59Z" + }, "items": [ { "external_id": "slide_1", @@ -1203,7 +1268,11 @@ Access to a run is restricted to the user who created it. "submitted_by": "auth0|123456", "terminated_at": "2024-01-15T10:30:45.123Z", "num_preceding_items_org": 0, - "num_preceding_items_platform": 0 + "num_preceding_items_platform": 0, + "scheduling": { + "due_date": "2019-08-24T14:15:22Z", + "deadline": "2019-08-24T14:15:22Z" + } } ``` @@ -1413,6 +1482,7 @@ Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. "state": "PENDING", "output": "NONE", "termination_reason": "SUCCEEDED", + "error_code": "string", "error_message": "This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed.", "terminated_at": "2024-01-15T10:30:45.123Z", "output_artifacts": [ @@ -1423,12 +1493,11 @@ Use PostgreSQL JSONPath expressions to filter items using their custom_metadata. "state": "PENDING", "termination_reason": "SUCCEEDED", "output": "NONE", + "error_code": "string", "error_message": "string", - "download_url": "http://example.com", - "error_code": "string" + "download_url": "http://example.com" } - ], - "error_code": "string" + ] } ] ``` @@ -1545,7 +1614,7 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»» error_message|any|false|none|The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`| +|»» error_code|any|false|none|none| *anyOf* @@ -1563,13 +1632,13 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»» terminated_at|any|false|none|Timestamp showing when the item reached a terminal state.| +|»» error_message|any|false|none|The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»» *anonymous*|string(date-time)|false|none|none| +|»»» *anonymous*|string|false|none|none| *or* @@ -1581,36 +1650,35 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»» output_artifacts|[[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)]|true|none|The list of the results generated by the application algorithm. The number of files and theirtypes depend on the particular application version, call `/v1/versions/{version_id}` to getthe details.| -|»»» OutputArtifactResultReadResponse|[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)|false|none|none| -|»»»» output_artifact_id|string(uuid)|true|none|The Id of the artifact. Used internally| -|»»»» name|string|true|none|Name of the output from the output schema from the `/v1/versions/{version_id}` endpoint.| -|»»»» metadata|any|false|none|The metadata of the output artifact, provided by the application. Can only be None if the artifact itself was deleted.| +|»» terminated_at|any|false|none|Timestamp showing when the item reached a terminal state.| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»»» *anonymous*|object|false|none|none| +|»»» *anonymous*|string(date-time)|false|none|none| *or* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»»» *anonymous*|null|false|none|none| +|»»» *anonymous*|null|false|none|none| *continued* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»» state|[ArtifactState](#schemaartifactstate)|true|none|none| -|»»»» termination_reason|any|false|none|The reason for termination when state is TERMINATED| +|»» output_artifacts|[[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)]|true|none|The list of the results generated by the application algorithm. The number of files and theirtypes depend on the particular application version, call `/v1/versions/{version_id}` to getthe details.| +|»»» OutputArtifactResultReadResponse|[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)|false|none|none| +|»»»» output_artifact_id|string(uuid)|true|none|The Id of the artifact. Used internally| +|»»»» name|string|true|none|Name of the output from the output schema from the `/v1/versions/{version_id}` endpoint.| +|»»»» metadata|any|false|none|The metadata of the output artifact, provided by the application. Can only be None if the artifact itself was deleted.| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»»» *anonymous*|[ArtifactTerminationReason](#schemaartifactterminationreason)|false|none|none| +|»»»»» *anonymous*|object|false|none|none| *or* @@ -1622,14 +1690,14 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»» output|[ArtifactOutput](#schemaartifactoutput)|true|none|none| -|»»»» error_message|any|false|none|Error message when artifact is in error state| +|»»»» state|[ArtifactState](#schemaartifactstate)|true|none|none| +|»»»» termination_reason|any|false|none|The reason for termination when state is TERMINATED| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»»» *anonymous*|string|false|none|none| +|»»»»» *anonymous*|[ArtifactTerminationReason](#schemaartifactterminationreason)|false|none|none| *or* @@ -1641,13 +1709,14 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»» download_url|any|true|none|The download URL to the output file. The URL is valid for 1 hour after the endpoint is called.A new URL is generated every time the endpoint is called.| +|»»»» output|[ArtifactOutput](#schemaartifactoutput)|true|none|none| +|»»»» error_code|any|false|none|none| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»»» *anonymous*|string(uri)|false|none|none| +|»»»»» *anonymous*|string|false|none|none| *or* @@ -1659,7 +1728,7 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»»» error_code|any|true|read-only|Error code describing the error that occurred during artifact processing.| +|»»»» error_message|any|false|none|none| *anyOf* @@ -1677,19 +1746,19 @@ Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»» error_code|any|true|read-only|Error code describing the error that occurred during item processing.| +|»»»» download_url|any|false|none|The download URL to the output file. The URL is valid for 1 hour after the endpoint is called.A new URL is generated every time the endpoint is called.| *anyOf* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»» *anonymous*|string|false|none|none| +|»»»»» *anonymous*|string(uri)|false|none|none| *or* |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|»»» *anonymous*|null|false|none|none| +|»»»»» *anonymous*|null|false|none|none| ##### Enumerated Values @@ -1789,6 +1858,7 @@ Retrieve details of a specific item (slide) by its external ID and the run ID. "state": "PENDING", "output": "NONE", "termination_reason": "SUCCEEDED", + "error_code": "string", "error_message": "This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed.", "terminated_at": "2024-01-15T10:30:45.123Z", "output_artifacts": [ @@ -1799,12 +1869,11 @@ Retrieve details of a specific item (slide) by its external ID and the run ID. "state": "PENDING", "termination_reason": "SUCCEEDED", "output": "NONE", + "error_code": "string", "error_message": "string", - "download_url": "http://example.com", - "error_code": "string" + "download_url": "http://example.com" } - ], - "error_code": "string" + ] } ``` @@ -1822,6 +1891,90 @@ To perform this operation, you must be authenticated by means of one of the foll OAuth2AuthorizationCodeBearer +### get_artifact_url_v1_runs__run_id__artifacts__artifact_id__file_get + + + +> Code samples + +```python +import requests +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer {access-token}' +} + +r = requests.get('/api/v1/runs/{run_id}/artifacts/{artifact_id}/file', headers = headers) + +print(r.json()) + +``` + +```javascript + +const headers = { + 'Accept':'application/json', + 'Authorization':'Bearer {access-token}' +}; + +fetch('/api/v1/runs/{run_id}/artifacts/{artifact_id}/file', +{ + method: 'GET', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); + +``` + +`GET /v1/runs/{run_id}/artifacts/{artifact_id}/file` + +*Get Artifact Url* + +Download the artifact file with the specified artifact_id, belonging to the specified run. +The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also +be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. + +The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage +bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response. + +#### Parameters + +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|run_id|path|string(uuid)|true|Run id, returned by `POST /runs/` endpoint| +|artifact_id|path|string(uuid)|true|The artifact id to download| + +> Example responses + +> 200 Response + +```json +null +``` + +#### Responses + +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful Response|Inline| +|307|[Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7)|Temporary Redirect - Redirect to the artifact file URL|None| +|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden - You don't have permission to download this artifact|None| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found - Artifact not found for the specified run|None| +|410|[Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9)|Gone - Artifact has been deleted|None| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Validation Error|[HTTPValidationError](#schemahttpvalidationerror)| + +#### Response Schema + + +To perform this operation, you must be authenticated by means of one of the following methods: +OAuth2AuthorizationCodeBearer + + ### delete_run_items_v1_runs__run_id__artifacts_delete @@ -2511,7 +2664,9 @@ or "string" ], "msg": "string", - "type": "string" + "type": "string", + "input": null, + "ctx": {} } ] } @@ -2691,6 +2846,7 @@ ItemOutput "state": "PENDING", "output": "NONE", "termination_reason": "SUCCEEDED", + "error_code": "string", "error_message": "This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed.", "terminated_at": "2024-01-15T10:30:45.123Z", "output_artifacts": [ @@ -2701,12 +2857,11 @@ ItemOutput "state": "PENDING", "termination_reason": "SUCCEEDED", "output": "NONE", + "error_code": "string", "error_message": "string", - "download_url": "http://example.com", - "error_code": "string" + "download_url": "http://example.com" } - ], - "error_code": "string" + ] } ``` @@ -2811,7 +2966,7 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|error_message|any|false|none|The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`| +|error_code|any|false|none|none| anyOf @@ -2829,13 +2984,13 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|terminated_at|any|false|none|Timestamp showing when the item reached a terminal state.| +|error_message|any|false|none|The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`| anyOf |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|» *anonymous*|string(date-time)|false|none|none| +|» *anonymous*|string|false|none|none| or @@ -2847,14 +3002,13 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|output_artifacts|[[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)]|true|none|The list of the results generated by the application algorithm. The number of files and theirtypes depend on the particular application version, call `/v1/versions/{version_id}` to getthe details.| -|error_code|any|true|read-only|Error code describing the error that occurred during item processing.| +|terminated_at|any|false|none|Timestamp showing when the item reached a terminal state.| anyOf |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|» *anonymous*|string|false|none|none| +|» *anonymous*|string(date-time)|false|none|none| or @@ -2862,6 +3016,12 @@ or |---|---|---|---|---| |» *anonymous*|null|false|none|none| +continued + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|output_artifacts|[[OutputArtifactResultReadResponse](#schemaoutputartifactresultreadresponse)]|true|none|The list of the results generated by the application algorithm. The number of files and theirtypes depend on the particular application version, call `/v1/versions/{version_id}` to getthe details.| + ### ItemState @@ -3080,9 +3240,9 @@ OutputArtifact "state": "PENDING", "termination_reason": "SUCCEEDED", "output": "NONE", + "error_code": "string", "error_message": "string", - "download_url": "http://example.com", - "error_code": "string" + "download_url": "http://example.com" } ``` @@ -3133,7 +3293,7 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |output|[ArtifactOutput](#schemaartifactoutput)|true|none|The output status of the artifact (NONE, FULL)| -|error_message|any|false|none|Error message when artifact is in error state| +|error_code|any|false|none|none| anyOf @@ -3151,13 +3311,13 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|download_url|any|true|none|The download URL to the output file. The URL is valid for 1 hour after the endpoint is called.A new URL is generated every time the endpoint is called.| +|error_message|any|false|none|none| anyOf |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|» *anonymous*|string(uri)|false|none|none| +|» *anonymous*|string|false|none|none| or @@ -3169,13 +3329,13 @@ continued |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|error_code|any|true|read-only|Error code describing the error that occurred during artifact processing.| +|download_url|any|false|none|The download URL to the output file. The URL is valid for 1 hour after the endpoint is called.A new URL is generated every time the endpoint is called.| anyOf |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|» *anonymous*|string|false|none|none| +|» *anonymous*|string(uri)|false|none|none| or @@ -3252,6 +3412,10 @@ OutputArtifactVisibility "department": "D1", "study": "abc-1" }, + "scheduling": { + "deadline": "2026-03-05T23:59:59Z", + "due_date": "2026-03-04T23:59:59Z" + }, "items": [ { "external_id": "slide_1", @@ -3320,6 +3484,24 @@ or continued +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|scheduling|any|false|none|Optional scheduling constraints for this run.| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|[SchedulingRequest](#schemaschedulingrequest)|false|none|Scheduling constraints for a run.| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + +continued + |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |items|[[ItemCreationRequest](#schemaitemcreationrequest)]|true|none|List of items (slides) to process. Each item represents a whole slide image (WSI) with its associated metadata and artifacts| @@ -3344,7 +3526,7 @@ RunCreationResponse |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|run_id|string(uuid)|false|none|none| +|run_id|string(uuid)|true|none|none| ### RunItemStatistics @@ -3443,7 +3625,11 @@ RunOutput "submitted_by": "auth0|123456", "terminated_at": "2024-01-15T10:30:45.123Z", "num_preceding_items_org": 0, - "num_preceding_items_platform": 0 + "num_preceding_items_platform": 0, + "scheduling": { + "due_date": "2019-08-24T14:15:22Z", + "deadline": "2019-08-24T14:15:22Z" + } } ``` @@ -3602,6 +3788,24 @@ or |---|---|---|---|---| |» *anonymous*|null|false|none|none| +continued + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|scheduling|any|false|none|Scheduling constraints set for this run.| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|[SchedulingResponse](#schemaschedulingresponse)|false|none|Scheduling fields returned in run responses.| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + ### RunState @@ -3658,6 +3862,112 @@ RunTerminationReason |RunTerminationReason|CANCELED_BY_SYSTEM| |RunTerminationReason|CANCELED_BY_USER| +### SchedulingRequest + + + + + + +```json +{ + "due_date": "2026-03-04T23:59:59Z", + "deadline": "2026-03-05T23:59:59Z" +} + +``` + +SchedulingRequest + +#### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|due_date|any|false|none|Requested completion time. Items are prioritized to meet this target.| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|string(date-time)|false|none|none| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + +continued + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|deadline|any|false|none|Hard deadline. The run will be cancelled if not completed by this time.| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|string(date-time)|false|none|none| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + +### SchedulingResponse + + + + + + +```json +{ + "due_date": "2019-08-24T14:15:22Z", + "deadline": "2019-08-24T14:15:22Z" +} + +``` + +SchedulingResponse + +#### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|due_date|any|false|none|none| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|string(date-time)|false|none|none| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + +continued + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|deadline|any|false|none|none| + +anyOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|string(date-time)|false|none|none| + +or + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» *anonymous*|null|false|none|none| + ### UserReadResponse @@ -3840,7 +4150,9 @@ or "string" ], "msg": "string", - "type": "string" + "type": "string", + "input": null, + "ctx": {} } ``` @@ -3871,6 +4183,8 @@ continued |---|---|---|---|---| |msg|string|true|none|none| |type|string|true|none|none| +|input|any|false|none|none| +|ctx|object|false|none|none| ### VersionReadResponse diff --git a/CLI_REFERENCE.md b/CLI_REFERENCE.md index b211e0b9f..9092293e7 100644 --- a/CLI_REFERENCE.md +++ b/CLI_REFERENCE.md @@ -398,6 +398,7 @@ $ aignostics application run list [OPTIONS] * `--note-regex TEXT`: Optional regex pattern to filter runs by note metadata. * `--query TEXT`: Optional query string to filter runs by note OR tags. * `--note-case-insensitive / --no-note-case-insensitive`: Make note regex search case-insensitive. [default: note-case-insensitive] +* `--for-organization TEXT`: Organization ID to list all runs for. Lists runs from all users in the organization. * `--format TEXT`: Output format: 'text' (default) or 'json' [default: text] * `--help`: Show this message and exit. @@ -578,9 +579,9 @@ $ aignostics application run result download [OPTIONS] RUN_ID [DESTINATION_DIREC * `--create-subdirectory-for-run / --no-create-subdirectory-for-run`: Create a subdirectory for the results of the run in the destination directory [default: create-subdirectory-for-run] * `--create-subdirectory-per-item / --no-create-subdirectory-per-item`: Create a subdirectory per item in the destination directory [default: create-subdirectory-per-item] * `--wait-for-completion / --no-wait-for-completion`: Wait for run completion and download results incrementally [default: wait-for-completion] -* `--qupath-project / --no-qupath-project`: Create a QuPath project referencing input slides and results. -The QuPath project will be created in a subfolder of the destination directory. -This option requires the QuPath extension for Launchpad: start the Launchpad with `uvx --with "aignostics" aignostics ...` +* `--qupath-project / --no-qupath-project`: Create a QuPath project referencing input slides and results. +The QuPath project will be created in a subfolder of the destination directory. +This option requires the QuPath extension for Launchpad: start the Launchpad with `uvx --with "aignostics" aignostics ...` This options requires installation of the QuPath application: Run uvx --with "aignostics" aignostics qupath install [default: no-qupath-project] * `--help`: Show this message and exit. @@ -881,7 +882,7 @@ $ aignostics dataset aignostics download [OPTIONS] SOURCE_URL [DESTINATION_DIREC **Arguments**: -* `SOURCE_URL`: URL to download. Example: gs://aignx-storage-service-dev/sample_data_formatted/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff [required] +* `SOURCE_URL`: URL to download. Example: gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff [required] * `[DESTINATION_DIRECTORY]`: Destination directory to download to [default: (~/Library/Application Support/aignostics/datasets/aignostics)] **Options**: diff --git a/README.md b/README.md index 06067a7b3..d5fb4c276 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,6 @@ [![Coverage](https://codecov.io/gh/aignostics/python-sdk/graph/badge.svg?token=SX34YRP30E)](https://codecov.io/gh/aignostics/python-sdk) [![Uptime](https://uptime.betterstack.com/status-badges/v2/monitor/1wbqa.svg)](https://aignostics.betteruptime.com) -> [!NOTE] -> The Aignostics Python SDK is in alpha, with [Atlas H&E-TME](https://www.aignostics.com/products/he-tme-profiling-product) and the [Aignostics Platform](https://platform.aignostics.com) in [early access](https://www.linkedin.com/posts/aignostics_introducing-atlas-he-tme-aignostics-is-activity-7325865745827979265-Sya9?utm_source=share&utm_medium=member_desktop&rcm=ACoAABRmV7cBCGv8eM_ot_kRTrBsb12olQvoLS4). -> Watch or star this repository to receive updates on new features and improvements of the SDK. - ---- - - ## Introduction The **Aignostics Python SDK** provides multiple ways to interact with the **Aignostics Platform** for running advanced computational pathology applications like [Atlas H&E-TME](https://www.aignostics.com/products/he-tme-profiling-product), which analyzes tumor microenvironments in H&E-stained tissue samples. diff --git a/docs/partials/README_header.md b/docs/partials/README_header.md index 0e4055c30..767a696ea 100644 --- a/docs/partials/README_header.md +++ b/docs/partials/README_header.md @@ -9,9 +9,3 @@ [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=aignostics_python-sdk&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=aignostics_python-sdk) [![Coverage](https://codecov.io/gh/aignostics/python-sdk/graph/badge.svg?token=SX34YRP30E)](https://codecov.io/gh/aignostics/python-sdk) [![Uptime](https://uptime.betterstack.com/status-badges/v2/monitor/1wbqa.svg)](https://aignostics.betteruptime.com) - -> [!NOTE] -> The Aignostics Python SDK is in alpha, with [Atlas H&E-TME](https://www.aignostics.com/products/he-tme-profiling-product) and the [Aignostics Platform](https://platform.aignostics.com) in [early access](https://www.linkedin.com/posts/aignostics_introducing-atlas-he-tme-aignostics-is-activity-7325865745827979265-Sya9?utm_source=share&utm_medium=member_desktop&rcm=ACoAABRmV7cBCGv8eM_ot_kRTrBsb12olQvoLS4). -> Watch or star this repository to receive updates on new features and improvements of the SDK. - ---- diff --git a/docs/source/_static/openapi_v1.json b/docs/source/_static/openapi_v1.json index e3ee044a4..cae9e0200 100644 --- a/docs/source/_static/openapi_v1.json +++ b/docs/source/_static/openapi_v1.json @@ -3,7 +3,7 @@ "info": { "title": "Aignostics Platform API", "description": "\nThe Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. \n\nTo begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. \n\nMore information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com).\n\n**How to authorize and test API endpoints:**\n\n1. Click the \"Authorize\" button in the right corner below\n3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials\n4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint\n\n**Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized.\n\n", - "version": "1.0.0-ga" + "version": "1.4.0" }, "servers": [ { @@ -17,7 +17,7 @@ "Public" ], "summary": "List available applications", - "description": "Returns the list of the applications, available to the caller.\n\nThe application is available if any of the versions of the application is assigned to the caller’s organization.\nThe response is paginated and sorted according to the provided parameters.", + "description": "Returns the list of the applications, available to the caller.\n\nThe application is available if any of the versions of the application is assigned to the caller's organization.\nThe response is paginated and sorted according to the provided parameters.", "operationId": "list_applications_v1_applications_get", "security": [ { @@ -210,6 +210,7 @@ "required": true, "schema": { "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version" } } @@ -582,6 +583,24 @@ "title": "Page Size" } }, + { + "name": "for_organization", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs.", + "title": "For Organization" + }, + "description": "Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs." + }, { "name": "sort", "in": "query", @@ -598,10 +617,10 @@ "type": "null" } ], - "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `statistics`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n", + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n", "title": "Sort" }, - "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `statistics`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n" + "description": "Sort the results by one or more fields. Use `+` for ascending and `-` for descending order.\n\n**Available fields:**\n- `run_id`\n- `application_id`\n- `version_number`\n- `custom_metadata`\n- `submitted_at`\n- `submitted_by`\n- `terminated_at`\n- `termination_reason`\n\n**Examples:**\n- `?sort=submitted_at` - Sort by creation time (ascending)\n- `?sort=-submitted_at` - Sort by creation time (descending)\n- `?sort=state&sort=-submitted_at` - Sort by state, then by time (descending)\n" } ], "responses": { @@ -1104,6 +1123,79 @@ } } }, + "/v1/runs/{run_id}/artifacts/{artifact_id}/file": { + "get": { + "tags": [ + "Public" + ], + "summary": "Get Artifact Url", + "description": "Download the artifact file with the specified artifact_id, belonging to the specified run.\nThe artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also\nbe retrieved via `GET /v1/runs/{run_id}/items/{external_id}`.\n\nThe endpoint may return a redirect response with a presigned URL to download the artifact file from the storage\nbucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.", + "operationId": "get_artifact_url_v1_runs__run_id__artifacts__artifact_id__file_get", + "security": [ + { + "OAuth2AuthorizationCodeBearer": [] + } + ], + "parameters": [ + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Run id, returned by `POST /runs/` endpoint", + "title": "Run Id" + }, + "description": "Run id, returned by `POST /runs/` endpoint" + }, + { + "name": "artifact_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "The artifact id to download", + "title": "Artifact Id" + }, + "description": "The artifact id to download" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "Not Found - Artifact not found for the specified run" + }, + "307": { + "description": "Temporary Redirect - Redirect to the artifact file URL" + }, + "403": { + "description": "Forbidden - You don't have permission to download this artifact" + }, + "410": { + "description": "Gone - Artifact has been deleted" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/v1/runs/{run_id}/artifacts": { "delete": { "tags": [ @@ -1461,6 +1553,7 @@ "properties": { "number": { "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Number", "description": "The number of the latest version", "examples": [ @@ -1518,6 +1611,7 @@ "custom_metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -1602,6 +1696,7 @@ ] }, "metadata_schema": { + "additionalProperties": true, "type": "object", "title": "Metadata Schema" } @@ -1636,6 +1731,7 @@ ] }, "metadata": { + "additionalProperties": true, "type": "object", "title": "Metadata", "description": "The metadata of the artifact, required by the application version. The JSON schema of the metadata can be requested by `/v1/versions/{application_version_id}`. The schema is located in `input_artifacts.[].metadata_schema`", @@ -1675,6 +1771,7 @@ "custom_metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -1753,6 +1850,7 @@ "custom_metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -1820,6 +1918,17 @@ ], "description": "\nWhen the `state` is `TERMINATED` this will explain why\n`SUCCEEDED` -> Successful processing.\n`USER_ERROR` -> Failed because the provided input was invalid.\n`SYSTEM_ERROR` -> There was an error in the model or platform.\n`SKIPPED` -> Was cancelled\n" }, + "error_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Code" + }, "error_message": { "anyOf": [ { @@ -1833,7 +1942,8 @@ "description": "\n The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`\n ", "examples": [ "This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed.", - "The item was not processed because the run was cancelled by the user before the item was processed.User error raised by Application because the input data provided by the user cannot be processed:\nThe image width is 123000 px, but the maximum width is 100000 px", + "The item was not processed because the run was cancelled by the user before the item was processed.", + "User error raised by Application because the input data provided by the user cannot be processed:\nThe image width is 123000 px, but the maximum width is 100000 px", "A system error occurred during the item execution:\n System went out of memory in cell classification", "An unknown system error occurred during the item execution" ] @@ -1861,19 +1971,6 @@ "type": "array", "title": "Output Artifacts", "description": "\nThe list of the results generated by the application algorithm. The number of files and their\ntypes depend on the particular application version, call `/v1/versions/{version_id}` to get\nthe details.\n " - }, - "error_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Code", - "description": "Error code describing the error that occurred during item processing.", - "readOnly": true } }, "type": "object", @@ -1883,8 +1980,7 @@ "custom_metadata", "state", "output", - "output_artifacts", - "error_code" + "output_artifacts" ], "title": "ItemResultReadResponse", "description": "Response schema for items in `List Run Items` endpoint" @@ -2042,6 +2138,7 @@ ] }, "metadata_schema": { + "additionalProperties": true, "type": "object", "title": "Metadata Schema" }, @@ -2081,6 +2178,7 @@ "metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -2109,7 +2207,7 @@ "$ref": "#/components/schemas/ArtifactOutput", "description": "The output status of the artifact (NONE, FULL)" }, - "error_message": { + "error_code": { "anyOf": [ { "type": "string" @@ -2118,36 +2216,34 @@ "type": "null" } ], - "title": "Error Message", - "description": "Error message when artifact is in error state" + "title": "Error Code" }, - "download_url": { + "error_message": { "anyOf": [ { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri" + "type": "string" }, { "type": "null" } ], - "title": "Download Url", - "description": "\nThe download URL to the output file. The URL is valid for 1 hour after the endpoint is called.\nA new URL is generated every time the endpoint is called.\n " + "title": "Error Message" }, - "error_code": { + "download_url": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" }, { "type": "null" } ], - "title": "Error Code", - "description": "Error code describing the error that occurred during artifact processing.", - "readOnly": true + "title": "Download Url", + "description": "\nThe download URL to the output file. The URL is valid for 1 hour after the endpoint is called.\nA new URL is generated every time the endpoint is called.\n ", + "deprecated": true } }, "type": "object", @@ -2155,9 +2251,7 @@ "output_artifact_id", "name", "state", - "output", - "download_url", - "error_code" + "output" ], "title": "OutputArtifactResultReadResponse" }, @@ -2205,6 +2299,7 @@ "custom_metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -2220,6 +2315,23 @@ } ] }, + "scheduling": { + "anyOf": [ + { + "$ref": "#/components/schemas/SchedulingRequest" + }, + { + "type": "null" + } + ], + "description": "Optional scheduling constraints for this run.", + "examples": [ + { + "deadline": "2026-03-05T23:59:59Z", + "due_date": "2026-03-04T23:59:59Z" + } + ] + }, "items": { "items": { "$ref": "#/components/schemas/ItemCreationRequest" @@ -2269,13 +2381,15 @@ "type": "string", "format": "uuid", "title": "Run Id", - "default": "Run id", "examples": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ] } }, "type": "object", + "required": [ + "run_id" + ], "title": "RunCreationResponse" }, "RunItemStatistics": { @@ -2417,6 +2531,7 @@ "custom_metadata": { "anyOf": [ { + "additionalProperties": true, "type": "object" }, { @@ -2500,6 +2615,17 @@ ], "title": "Num Preceding Items Platform", "description": "How many Items from other Runs are due to begin processing before this Run's next Item does." + }, + "scheduling": { + "anyOf": [ + { + "$ref": "#/components/schemas/SchedulingResponse" + }, + { + "type": "null" + } + ], + "description": "Scheduling constraints set for this run." } }, "type": "object", @@ -2537,6 +2663,76 @@ ], "title": "RunTerminationReason" }, + "SchedulingRequest": { + "properties": { + "due_date": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Due Date", + "description": "Requested completion time. Items are prioritized to meet this target.", + "examples": [ + "2026-03-04T23:59:59Z" + ] + }, + "deadline": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Deadline", + "description": "Hard deadline. The run will be cancelled if not completed by this time.", + "examples": [ + "2026-03-05T23:59:59Z" + ] + } + }, + "type": "object", + "title": "SchedulingRequest", + "description": "Scheduling constraints for a run." + }, + "SchedulingResponse": { + "properties": { + "due_date": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Due Date" + }, + "deadline": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Deadline" + } + }, + "type": "object", + "title": "SchedulingResponse", + "description": "Scheduling fields returned in run responses." + }, "UserReadResponse": { "properties": { "id": { @@ -2693,6 +2889,13 @@ "type": { "type": "string", "title": "Error Type" + }, + "input": { + "title": "Input" + }, + "ctx": { + "type": "object", + "title": "Context" } }, "type": "object", @@ -2707,6 +2910,7 @@ "properties": { "version_number": { "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "title": "Version Number", "description": "Semantic version of the application" }, diff --git a/docs/source/_static/openapi_v1.yaml b/docs/source/_static/openapi_v1.yaml index b95947d8e..ee49b2096 100644 --- a/docs/source/_static/openapi_v1.yaml +++ b/docs/source/_static/openapi_v1.yaml @@ -90,6 +90,7 @@ components: description: The number of the latest version examples: - 1.0.0 + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ title: Number type: string released_at: @@ -131,7 +132,8 @@ components: properties: custom_metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: JSON metadata that should be set for the run examples: @@ -175,6 +177,7 @@ components: InputArtifact: properties: metadata_schema: + additionalProperties: true title: Metadata Schema type: object mime_type: @@ -205,6 +208,7 @@ components: title: Download Url type: string metadata: + additionalProperties: true description: The metadata of the artifact, required by the application version. The JSON schema of the metadata can be requested by `/v1/versions/{application_version_id}`. The schema is located in `input_artifacts.[].metadata_schema` examples: - checksum_base64_crc32c: 752f9554 @@ -231,7 +235,8 @@ components: properties: custom_metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: Optional JSON custom_metadata to store additional information alongside an item. examples: @@ -281,7 +286,8 @@ components: properties: custom_metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: The custom_metadata of the item that has been provided by the user on run creation. title: Custom Metadata @@ -301,8 +307,6 @@ components: anyOf: - type: string - type: 'null' - description: Error code describing the error that occurred during item processing. - readOnly: true title: Error Code error_message: anyOf: @@ -311,7 +315,8 @@ components: description: "\n The error message in case the `termination_reason` is in `USER_ERROR` or `SYSTEM_ERROR`\n " examples: - This item was not processed because the threshold of 3 items finishing in error state (user or system error) was reached before the item was processed. - - 'The item was not processed because the run was cancelled by the user before the item was processed.User error raised by Application because the input data provided by the user cannot be processed: + - The item was not processed because the run was cancelled by the user before the item was processed. + - 'User error raised by Application because the input data provided by the user cannot be processed: The image width is 123000 px, but the maximum width is 100000 px' - "A system error occurred during the item execution:\n System went out of memory in cell classification" @@ -385,7 +390,6 @@ components: - state - output - output_artifacts - - error_code title: ItemResultReadResponse type: object ItemState: @@ -514,6 +518,7 @@ components: OutputArtifact: properties: metadata_schema: + additionalProperties: true title: Metadata Schema type: object mime_type: @@ -546,24 +551,23 @@ components: minLength: 1 type: string - type: 'null' + deprecated: true description: "\nThe download URL to the output file. The URL is valid for 1 hour after the endpoint is called.\nA new URL is generated every time the endpoint is called.\n " title: Download Url error_code: anyOf: - type: string - type: 'null' - description: Error code describing the error that occurred during artifact processing. - readOnly: true title: Error Code error_message: anyOf: - type: string - type: 'null' - description: Error message when artifact is in error state title: Error Message metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: The metadata of the output artifact, provided by the application. Can only be None if the artifact itself was deleted. title: Metadata @@ -594,8 +598,6 @@ components: - name - state - output - - download_url - - error_code title: OutputArtifactResultReadResponse type: object OutputArtifactScope: @@ -623,7 +625,8 @@ components: type: string custom_metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: Optional JSON metadata to store additional information alongside the run examples: @@ -652,6 +655,14 @@ components: minItems: 1 title: Items type: array + scheduling: + anyOf: + - $ref: '#/components/schemas/SchedulingRequest' + - type: 'null' + description: Optional scheduling constraints for this run. + examples: + - deadline: '2026-03-05T23:59:59Z' + due_date: '2026-03-04T23:59:59Z' version_number: anyOf: - type: string @@ -668,12 +679,13 @@ components: RunCreationResponse: properties: run_id: - default: Run id examples: - 3fa85f64-5717-4562-b3fc-2c963f66afa6 format: uuid title: Run Id type: string + required: + - run_id title: RunCreationResponse type: object RunItemStatistics: @@ -734,7 +746,8 @@ components: type: string custom_metadata: anyOf: - - type: object + - additionalProperties: true + type: object - type: 'null' description: Optional JSON metadata that was stored in alongside the run by the user examples: @@ -791,6 +804,11 @@ components: format: uuid title: Run Id type: string + scheduling: + anyOf: + - $ref: '#/components/schemas/SchedulingResponse' + - type: 'null' + description: Scheduling constraints set for this run. state: $ref: '#/components/schemas/RunState' description: 'When the run request is received by the Platform, the `state` of it is set to @@ -862,6 +880,46 @@ components: - CANCELED_BY_USER title: RunTerminationReason type: string + SchedulingRequest: + description: Scheduling constraints for a run. + properties: + deadline: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Hard deadline. The run will be cancelled if not completed by this time. + examples: + - '2026-03-05T23:59:59Z' + title: Deadline + due_date: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Requested completion time. Items are prioritized to meet this target. + examples: + - '2026-03-04T23:59:59Z' + title: Due Date + title: SchedulingRequest + type: object + SchedulingResponse: + description: Scheduling fields returned in run responses. + properties: + deadline: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Deadline + due_date: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Due Date + title: SchedulingResponse + type: object UserReadResponse: description: 'Part of response schema for User object in `Get current user` endpoint. @@ -944,6 +1002,11 @@ components: type: object ValidationError: properties: + ctx: + title: Context + type: object + input: + title: Input loc: items: anyOf: @@ -989,6 +1052,7 @@ components: type: string version_number: description: Semantic version of the application + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ title: Version Number type: string required: @@ -1010,7 +1074,7 @@ components: info: description: "\nThe Aignostics Platform is a cloud-based service that enables organizations to access advanced computational pathology applications through a secure API. The platform provides standardized access to Aignostics' portfolio of computational pathology solutions, with Atlas H&E-TME serving as an example of the available API endpoints. \n\nTo begin using the platform, your organization must first be registered by our business support team. If you don't have an account yet, please contact your account manager or email support@aignostics.com to get started. \n\nMore information about our applications can be found on [https://platform.aignostics.com](https://platform.aignostics.com).\n\n**How to authorize and test API endpoints:**\n\n1. Click the \"Authorize\" button in the right corner below\n3. Click \"Authorize\" button in the dialog to log in with your Aignostics Platform credentials\n4. After successful login, you'll be redirected back and can use \"Try it out\" on any endpoint\n\n**Note**: You only need to authorize once per session. The lock icons next to endpoints will show green when authorized.\n\n" title: Aignostics Platform API - version: 1.0.0-ga + version: 1.4.0 openapi: 3.1.0 paths: /v1/applications: @@ -1018,7 +1082,7 @@ paths: description: 'Returns the list of the applications, available to the caller. - The application is available if any of the versions of the application is assigned to the caller’s organization. + The application is available if any of the versions of the application is assigned to the caller''s organization. The response is paginated and sorted according to the provided parameters.' operationId: list_applications_v1_applications_get @@ -1183,6 +1247,7 @@ paths: name: version required: true schema: + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ title: Version type: string responses: @@ -1465,6 +1530,16 @@ paths: minimum: 5 title: Page Size type: integer + - description: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. + in: query + name: for_organization + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Filter runs by organization ID. Available for superadmins (any org) and admins (own org only). When provided, returns all runs for the specified organization instead of only the caller's own runs. + title: For Organization - description: 'Sort the results by one or more fields. Use `+` for ascending and `-` for descending order. @@ -1478,8 +1553,6 @@ paths: - `custom_metadata` - - `statistics` - - `submitted_at` - `submitted_by` @@ -1520,8 +1593,6 @@ paths: - `custom_metadata` - - `statistics` - - `submitted_at` - `submitted_by` @@ -1674,6 +1745,63 @@ paths: summary: Delete Run Items tags: - Public + /v1/runs/{run_id}/artifacts/{artifact_id}/file: + get: + description: 'Download the artifact file with the specified artifact_id, belonging to the specified run. + + The artifact_is is returned by the `GET /v1/runs/{run_id}/items` endpoint as part of the item results, and can also + + be retrieved via `GET /v1/runs/{run_id}/items/{external_id}`. + + + The endpoint may return a redirect response with a presigned URL to download the artifact file from the storage + + bucket. The presigned URL is valid for a limited time, so it should be used immediately after receiving the response.' + operationId: get_artifact_url_v1_runs__run_id__artifacts__artifact_id__file_get + parameters: + - description: Run id, returned by `POST /runs/` endpoint + in: path + name: run_id + required: true + schema: + description: Run id, returned by `POST /runs/` endpoint + format: uuid + title: Run Id + type: string + - description: The artifact id to download + in: path + name: artifact_id + required: true + schema: + description: The artifact id to download + format: uuid + title: Artifact Id + type: string + responses: + '200': + content: + application/json: + schema: {} + description: Successful Response + '307': + description: Temporary Redirect - Redirect to the artifact file URL + '403': + description: Forbidden - You don't have permission to download this artifact + '404': + description: Not Found - Artifact not found for the specified run + '410': + description: Gone - Artifact has been deleted + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - OAuth2AuthorizationCodeBearer: [] + summary: Get Artifact Url + tags: + - Public /v1/runs/{run_id}/cancel: post: description: 'The run can be canceled by the user who created the run.