approve_or_reject_ai_generated_summaries

DatasetsApi.approve_or_reject_ai_generated_summaries(id, role_id, file_name, update_summary_input_body, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Approve or reject an AI-generated file summary

Approves or rejects (and optionally edits) the AI-generated summary for a dataset file. Caller must be editor or owner. Required query file-name and body Summary + ApprovalStatus (approved|rejected). Fails with IPV-1020 if no summary exists or ApprovalStatus is already APPROVED/REJECTED. API success Message is “Successfully updated labels.” (shared message with the labels PUT path).

Parameters:
  • id (str) – Dataset ID that owns the file. (required)

  • role_id (str) – Amorphic role ID the request is authorized against. Must grant editor or owner access on the dataset. (required)

  • file_name (str) – Full object key of the file, exactly as returned in FileName by GET /datasets/{id}/files. (required)

  • update_summary_input_body (UpdateSummaryInputBody) – (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

ApproveRejectDatasetFileSummariesResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /datasets/{id}/files/summarize

Parameter examples

Name

In

Example

id

path

"b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"

file-name

query

"sales/monthly_orders/upload_date=2026-08-01/notes.txt"

Request

Request / response example

{
  "Summary": "Monthly orders file covering August 2026 sales.",
  "ApprovalStatus": "approved"
}

Success (HTTP 200)

Summary updated. Message is “Successfully updated labels.”

Request / response example

{
  "Message": "Successfully updated labels."
}

Errors

Documented error codes: IPV-1020, AI-1004.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1020 (missing file-name / no summary / already decided / bad body), AI-1004, AUTH-*.

Summary already approved or rejected

{
  "Message": "IPV-1020 - Summary cannot be approved since it has already been approved."
}

Body missing Summary or ApprovalStatus

{
  "Message": "IPV-1020 - Input body should contain 'Summary' and 'ApprovalStatus' keys."
}

HTTP 500

Something went wrong at backend. Input, permission and file-state errors - such as an unsupported file type, a file that is already processed, or a dataset you cannot access - are also reported here.

File has no generated summary

{
  "Message": "IPV-1020 - No generated summary found for the file."
}

Decision already recorded and cannot be reversed

{
  "Message": "IPV-1020 - Summary cannot be rejected since it has already been approved."
}

ApprovalStatus other than approved or rejected

{
  "Message": "IPV-1020 - Input body should contain only the values 'approved' or 'rejected' for the 'ApprovalStatus' key."
}