approve_or_reject_ai_generated_labels

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

Approve or reject generated labels

Records an approve or reject decision for labels generated on a file. Requires editor access. Only labels already generated for the file may be listed, and a decision cannot be reversed once made. Approved labels are added to the dataset keywords.

Parameters:
  • id (str) – Dataset id. (required)

  • role_id (str) – User role id (required)

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

  • request_body (Dict[str, str]) – (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:

UpdateLabelsResponse

Returns:

Returns the result object.

Request and Response Examples

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

Request

Decide two generated labels

{
  "invoice": "approved",
  "quarterly-report": "rejected"
}

Approve a single label

{
  "invoice": "approved"
}

Success (HTTP 200)

Successful API response

Request / response example

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

Errors

Documented error codes: IPV-1020.

HTTP 400

Missing required request parameters

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 labels

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

Body names a label that was not generated

{
  "Message": "IPV-1020 - Input body should contain only the generated labels."
}

Value other than approved or rejected

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

Decision already recorded and cannot be reversed

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