Skip to content

Create classification job

POST/v1/jobs/classification-jobs/

Create a user-requested classification job from an uploaded file.

Body

Sent as multipart/form-data.

  • filefileRequired

    Document to classify.

  • classesarray of objects or null

    Optional list of {label, description} objects. When omitted, system default classes are used. When provided, only these classes are used.

    Show child attributesHide child attributes
    • labelstringRequired

      Class label returned by the classifier.

    • descriptionstringRequired

      Short description of when this class applies.

  • nicknamestring or null

    Optional nickname for easier job identification.

Returns

200 with a JSON object.

Show response attributesHide response attributes
  • detailstringRequired
  • classification_jobobjectRequired
    Show child attributesHide child attributes
    • job_idstringRequired

      Unique job identifier.

    • nicknamestring or null

      Display name you gave the job.

    • processing_statusstringRequired

      Where the job is in its lifecycle: pending (received, being inspected), queued (accepted, waiting to be processed), processing, completed (the result can be downloaded) or failed (the job's error and error_code say why). completed and failed are final.

      One of pending, processing, completed, failed, queued

    • created_atstring or null

      When the job was created.

    • updated_atstring or null

      When the job last changed.

    • processing_time_secondsnumber or null

      Time the job took to process, once it has finished.

    • credits_costnumber

      Credits charged for the job.

    • errorstring or null

      Why the job failed, when it did.

    • error_codestring or null

      Stable error code of a failed job, from the same vocabulary as API errors.

    • file_namestring or null

      Name of the uploaded file, when the job has one.

    • page_countinteger or null

      Pages in the document, once it has been inspected.

    • job_typestringRequired

      One of classification

    • document_classstring or null

      Majority page label for the document, or 'mixed' when the vote ties.

Errors

Every error has the same JSON body. See Errors for the error codes and when to retry.

  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 410Gone
  • 413Request Entity Too Large
  • 422Unprocessable Entity
  • 429Too Many Requests
  • 500Internal Server Error