# Jobs ## Create Classify Job `ClassifyJob classifier().jobs().create(JobCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/classifier/jobs` Create a classify job. Experimental: not production-ready and subject to change. ### Parameters - `JobCreateParams params` - `Optional organizationId` - `Optional projectId` - `List fileIds` The IDs of the files to classify - `List rules` The rules to classify the files - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') - `Optional mode` The classification mode to use - `FAST("FAST")` - `MULTIMODAL("MULTIMODAL")` - `Optional parsingConfiguration` The configuration for the parsing job - `Optional> webhookConfigurations` List of webhook configurations for notifications - `Optional> webhookEvents` Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' (job failed), 'parse.partial_success' (some pages failed), 'parse.pending', 'parse.running', 'parse.cancelled'. If not specified, webhook fires for all events - `Optional webhookHeaders` Custom HTTP headers to include in webhook requests. Use for authentication tokens or custom routing. Example: {'Authorization': 'Bearer xyz'} - `Optional webhookOutputFormat` Format of the webhook payload body. 'string' (default) sends the payload as a JSON-encoded string; 'json' sends it as a JSON object. - `STRING("string")` - `JSON("json")` - `Optional webhookUrl` HTTPS URL to receive webhook POST requests. Must be publicly accessible ### Returns - `class ClassifyJob:` A classify job. - `String id` Unique identifier - `String projectId` The ID of the project - `List rules` The rules to classify the files - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') - `StatusEnum status` The status of the classify job - `PENDING("PENDING")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `PARTIAL_SUCCESS("PARTIAL_SUCCESS")` - `CANCELLED("CANCELLED")` - `String userId` The ID of the user - `Optional createdAt` Creation datetime - `Optional effectiveAt` - `Optional errorMessage` Error message for the latest job attempt, if any. - `Optional jobRecordId` The job record ID associated with this status, if any. - `Optional mode` The classification mode to use - `FAST("FAST")` - `MULTIMODAL("MULTIMODAL")` - `Optional parsingConfiguration` The configuration for the parsing job - `Optional lang` The language to parse the files in - `AF("af")` - `AZ("az")` - `BS("bs")` - `CS("cs")` - `CY("cy")` - `DA("da")` - `DE("de")` - `EN("en")` - `ES("es")` - `ET("et")` - `FR("fr")` - `GA("ga")` - `HR("hr")` - `HU("hu")` - `ID("id")` - `IS("is")` - `IT("it")` - `KU("ku")` - `LA("la")` - `LT("lt")` - `LV("lv")` - `MI("mi")` - `MS("ms")` - `MT("mt")` - `NL("nl")` - `NO("no")` - `OC("oc")` - `PI("pi")` - `PL("pl")` - `PT("pt")` - `RO("ro")` - `RS_LATIN("rs_latin")` - `SK("sk")` - `SL("sl")` - `SQ("sq")` - `SV("sv")` - `SW("sw")` - `TL("tl")` - `TR("tr")` - `UZ("uz")` - `VI("vi")` - `AR("ar")` - `FA("fa")` - `UG("ug")` - `UR("ur")` - `BN("bn")` - `AS("as")` - `MNI("mni")` - `RU("ru")` - `RS_CYRILLIC("rs_cyrillic")` - `BE("be")` - `BG("bg")` - `UK("uk")` - `MN("mn")` - `ABQ("abq")` - `ADY("ady")` - `KBD("kbd")` - `AVA("ava")` - `DAR("dar")` - `INH("inh")` - `CHE("che")` - `LBE("lbe")` - `LEZ("lez")` - `TAB("tab")` - `TJK("tjk")` - `HI("hi")` - `MR("mr")` - `NE("ne")` - `BH("bh")` - `MAI("mai")` - `ANG("ang")` - `BHO("bho")` - `MAH("mah")` - `SCK("sck")` - `NEW("new")` - `GOM("gom")` - `SA("sa")` - `BGC("bgc")` - `TH("th")` - `CH_SIM("ch_sim")` - `CH_TRA("ch_tra")` - `JA("ja")` - `KO("ko")` - `TA("ta")` - `TE("te")` - `KN("kn")` - `Optional maxPages` The maximum number of pages to parse - `Optional> targetPages` The pages to target for parsing (0-indexed, so first page is at 0) - `Optional updatedAt` Update datetime ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.classifier.jobs.ClassifierRule; import com.llamacloud_prod.api.models.classifier.jobs.ClassifyJob; import com.llamacloud_prod.api.models.classifier.jobs.JobCreateParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); JobCreateParams params = JobCreateParams.builder() .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addRule(ClassifierRule.builder() .description("contains invoice number, line items, and total amount") .type("invoice") .build()) .build(); ClassifyJob classifyJob = client.classifier().jobs().create(params); } } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "rules": [ { "description": "contains invoice number, line items, and total amount", "type": "invoice" } ], "status": "PENDING", "user_id": "user_id", "created_at": "2019-12-27T18:11:19.117Z", "effective_at": "2019-12-27T18:11:19.117Z", "error_message": "error_message", "job_record_id": "job_record_id", "mode": "FAST", "parsing_configuration": { "lang": "af", "max_pages": 0, "target_pages": [ 0 ] }, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## List Classify Jobs `JobListPage classifier().jobs().list(JobListParamsparams = JobListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/classifier/jobs` List classify jobs. Experimental: not production-ready and subject to change. ### Parameters - `JobListParams params` - `Optional organizationId` - `Optional pageSize` - `Optional pageToken` - `Optional projectId` ### Returns - `class ClassifyJob:` A classify job. - `String id` Unique identifier - `String projectId` The ID of the project - `List rules` The rules to classify the files - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') - `StatusEnum status` The status of the classify job - `PENDING("PENDING")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `PARTIAL_SUCCESS("PARTIAL_SUCCESS")` - `CANCELLED("CANCELLED")` - `String userId` The ID of the user - `Optional createdAt` Creation datetime - `Optional effectiveAt` - `Optional errorMessage` Error message for the latest job attempt, if any. - `Optional jobRecordId` The job record ID associated with this status, if any. - `Optional mode` The classification mode to use - `FAST("FAST")` - `MULTIMODAL("MULTIMODAL")` - `Optional parsingConfiguration` The configuration for the parsing job - `Optional lang` The language to parse the files in - `AF("af")` - `AZ("az")` - `BS("bs")` - `CS("cs")` - `CY("cy")` - `DA("da")` - `DE("de")` - `EN("en")` - `ES("es")` - `ET("et")` - `FR("fr")` - `GA("ga")` - `HR("hr")` - `HU("hu")` - `ID("id")` - `IS("is")` - `IT("it")` - `KU("ku")` - `LA("la")` - `LT("lt")` - `LV("lv")` - `MI("mi")` - `MS("ms")` - `MT("mt")` - `NL("nl")` - `NO("no")` - `OC("oc")` - `PI("pi")` - `PL("pl")` - `PT("pt")` - `RO("ro")` - `RS_LATIN("rs_latin")` - `SK("sk")` - `SL("sl")` - `SQ("sq")` - `SV("sv")` - `SW("sw")` - `TL("tl")` - `TR("tr")` - `UZ("uz")` - `VI("vi")` - `AR("ar")` - `FA("fa")` - `UG("ug")` - `UR("ur")` - `BN("bn")` - `AS("as")` - `MNI("mni")` - `RU("ru")` - `RS_CYRILLIC("rs_cyrillic")` - `BE("be")` - `BG("bg")` - `UK("uk")` - `MN("mn")` - `ABQ("abq")` - `ADY("ady")` - `KBD("kbd")` - `AVA("ava")` - `DAR("dar")` - `INH("inh")` - `CHE("che")` - `LBE("lbe")` - `LEZ("lez")` - `TAB("tab")` - `TJK("tjk")` - `HI("hi")` - `MR("mr")` - `NE("ne")` - `BH("bh")` - `MAI("mai")` - `ANG("ang")` - `BHO("bho")` - `MAH("mah")` - `SCK("sck")` - `NEW("new")` - `GOM("gom")` - `SA("sa")` - `BGC("bgc")` - `TH("th")` - `CH_SIM("ch_sim")` - `CH_TRA("ch_tra")` - `JA("ja")` - `KO("ko")` - `TA("ta")` - `TE("te")` - `KN("kn")` - `Optional maxPages` The maximum number of pages to parse - `Optional> targetPages` The pages to target for parsing (0-indexed, so first page is at 0) - `Optional updatedAt` Update datetime ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.classifier.jobs.JobListPage; import com.llamacloud_prod.api.models.classifier.jobs.JobListParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); JobListPage page = client.classifier().jobs().list(); } } ``` #### Response ```json { "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "rules": [ { "description": "contains invoice number, line items, and total amount", "type": "invoice" } ], "status": "PENDING", "user_id": "user_id", "created_at": "2019-12-27T18:11:19.117Z", "effective_at": "2019-12-27T18:11:19.117Z", "error_message": "error_message", "job_record_id": "job_record_id", "mode": "FAST", "parsing_configuration": { "lang": "af", "max_pages": 0, "target_pages": [ 0 ] }, "updated_at": "2019-12-27T18:11:19.117Z" } ], "next_page_token": "next_page_token", "total_size": 0 } ``` ## Get Classify Job `ClassifyJob classifier().jobs().get(JobGetParamsparams = JobGetParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/classifier/jobs/{classify_job_id}` Get a classify job. Experimental: not production-ready and subject to change. ### Parameters - `JobGetParams params` - `Optional classifyJobId` - `Optional organizationId` - `Optional projectId` ### Returns - `class ClassifyJob:` A classify job. - `String id` Unique identifier - `String projectId` The ID of the project - `List rules` The rules to classify the files - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') - `StatusEnum status` The status of the classify job - `PENDING("PENDING")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `PARTIAL_SUCCESS("PARTIAL_SUCCESS")` - `CANCELLED("CANCELLED")` - `String userId` The ID of the user - `Optional createdAt` Creation datetime - `Optional effectiveAt` - `Optional errorMessage` Error message for the latest job attempt, if any. - `Optional jobRecordId` The job record ID associated with this status, if any. - `Optional mode` The classification mode to use - `FAST("FAST")` - `MULTIMODAL("MULTIMODAL")` - `Optional parsingConfiguration` The configuration for the parsing job - `Optional lang` The language to parse the files in - `AF("af")` - `AZ("az")` - `BS("bs")` - `CS("cs")` - `CY("cy")` - `DA("da")` - `DE("de")` - `EN("en")` - `ES("es")` - `ET("et")` - `FR("fr")` - `GA("ga")` - `HR("hr")` - `HU("hu")` - `ID("id")` - `IS("is")` - `IT("it")` - `KU("ku")` - `LA("la")` - `LT("lt")` - `LV("lv")` - `MI("mi")` - `MS("ms")` - `MT("mt")` - `NL("nl")` - `NO("no")` - `OC("oc")` - `PI("pi")` - `PL("pl")` - `PT("pt")` - `RO("ro")` - `RS_LATIN("rs_latin")` - `SK("sk")` - `SL("sl")` - `SQ("sq")` - `SV("sv")` - `SW("sw")` - `TL("tl")` - `TR("tr")` - `UZ("uz")` - `VI("vi")` - `AR("ar")` - `FA("fa")` - `UG("ug")` - `UR("ur")` - `BN("bn")` - `AS("as")` - `MNI("mni")` - `RU("ru")` - `RS_CYRILLIC("rs_cyrillic")` - `BE("be")` - `BG("bg")` - `UK("uk")` - `MN("mn")` - `ABQ("abq")` - `ADY("ady")` - `KBD("kbd")` - `AVA("ava")` - `DAR("dar")` - `INH("inh")` - `CHE("che")` - `LBE("lbe")` - `LEZ("lez")` - `TAB("tab")` - `TJK("tjk")` - `HI("hi")` - `MR("mr")` - `NE("ne")` - `BH("bh")` - `MAI("mai")` - `ANG("ang")` - `BHO("bho")` - `MAH("mah")` - `SCK("sck")` - `NEW("new")` - `GOM("gom")` - `SA("sa")` - `BGC("bgc")` - `TH("th")` - `CH_SIM("ch_sim")` - `CH_TRA("ch_tra")` - `JA("ja")` - `KO("ko")` - `TA("ta")` - `TE("te")` - `KN("kn")` - `Optional maxPages` The maximum number of pages to parse - `Optional> targetPages` The pages to target for parsing (0-indexed, so first page is at 0) - `Optional updatedAt` Update datetime ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.classifier.jobs.ClassifyJob; import com.llamacloud_prod.api.models.classifier.jobs.JobGetParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); ClassifyJob classifyJob = client.classifier().jobs().get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"); } } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "rules": [ { "description": "contains invoice number, line items, and total amount", "type": "invoice" } ], "status": "PENDING", "user_id": "user_id", "created_at": "2019-12-27T18:11:19.117Z", "effective_at": "2019-12-27T18:11:19.117Z", "error_message": "error_message", "job_record_id": "job_record_id", "mode": "FAST", "parsing_configuration": { "lang": "af", "max_pages": 0, "target_pages": [ 0 ] }, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Get Classification Job Results `JobGetResultsResponse classifier().jobs().getResults(JobGetResultsParamsparams = JobGetResultsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/classifier/jobs/{classify_job_id}/results` Get the results of a classify job. Experimental: not production-ready and subject to change. ### Parameters - `JobGetResultsParams params` - `Optional classifyJobId` - `Optional organizationId` - `Optional projectId` ### Returns - `class JobGetResultsResponse:` Response model for the classify endpoint following AIP-132 pagination standard. - `List items` The list of items. - `String id` Unique identifier - `String classifyJobId` The ID of the classify job - `Optional createdAt` Creation datetime - `Optional fileId` The ID of the classified file - `Optional result` Result of classifying a single file. - `double confidence` Confidence score of the classification (0.0-1.0) - `String reasoning` Step-by-step explanation of why this classification was chosen and the confidence score assigned - `Optional type` The document type that best matches, or null if no match. - `Optional updatedAt` Update datetime - `Optional nextPageToken` A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. - `Optional totalSize` The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only. ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.classifier.jobs.JobGetResultsParams; import com.llamacloud_prod.api.models.classifier.jobs.JobGetResultsResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); JobGetResultsResponse response = client.classifier().jobs().getResults("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"); } } ``` #### Response ```json { "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "classify_job_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "result": { "confidence": 0, "reasoning": "reasoning", "type": "type" }, "updated_at": "2019-12-27T18:11:19.117Z" } ], "next_page_token": "next_page_token", "total_size": 0 } ``` ## Domain Types ### Classifier Rule - `class ClassifierRule:` A rule for classifying documents - v0 simplified version. This represents a single classification rule that will be applied to documents. All rules are content-based and use natural language descriptions. - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') ### Classify Job - `class ClassifyJob:` A classify job. - `String id` Unique identifier - `String projectId` The ID of the project - `List rules` The rules to classify the files - `String description` Natural language description of what to classify. Be specific about the content characteristics that identify this document type. - `String type` The document type to assign when this rule matches (e.g., 'invoice', 'receipt', 'contract') - `StatusEnum status` The status of the classify job - `PENDING("PENDING")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `PARTIAL_SUCCESS("PARTIAL_SUCCESS")` - `CANCELLED("CANCELLED")` - `String userId` The ID of the user - `Optional createdAt` Creation datetime - `Optional effectiveAt` - `Optional errorMessage` Error message for the latest job attempt, if any. - `Optional jobRecordId` The job record ID associated with this status, if any. - `Optional mode` The classification mode to use - `FAST("FAST")` - `MULTIMODAL("MULTIMODAL")` - `Optional parsingConfiguration` The configuration for the parsing job - `Optional lang` The language to parse the files in - `AF("af")` - `AZ("az")` - `BS("bs")` - `CS("cs")` - `CY("cy")` - `DA("da")` - `DE("de")` - `EN("en")` - `ES("es")` - `ET("et")` - `FR("fr")` - `GA("ga")` - `HR("hr")` - `HU("hu")` - `ID("id")` - `IS("is")` - `IT("it")` - `KU("ku")` - `LA("la")` - `LT("lt")` - `LV("lv")` - `MI("mi")` - `MS("ms")` - `MT("mt")` - `NL("nl")` - `NO("no")` - `OC("oc")` - `PI("pi")` - `PL("pl")` - `PT("pt")` - `RO("ro")` - `RS_LATIN("rs_latin")` - `SK("sk")` - `SL("sl")` - `SQ("sq")` - `SV("sv")` - `SW("sw")` - `TL("tl")` - `TR("tr")` - `UZ("uz")` - `VI("vi")` - `AR("ar")` - `FA("fa")` - `UG("ug")` - `UR("ur")` - `BN("bn")` - `AS("as")` - `MNI("mni")` - `RU("ru")` - `RS_CYRILLIC("rs_cyrillic")` - `BE("be")` - `BG("bg")` - `UK("uk")` - `MN("mn")` - `ABQ("abq")` - `ADY("ady")` - `KBD("kbd")` - `AVA("ava")` - `DAR("dar")` - `INH("inh")` - `CHE("che")` - `LBE("lbe")` - `LEZ("lez")` - `TAB("tab")` - `TJK("tjk")` - `HI("hi")` - `MR("mr")` - `NE("ne")` - `BH("bh")` - `MAI("mai")` - `ANG("ang")` - `BHO("bho")` - `MAH("mah")` - `SCK("sck")` - `NEW("new")` - `GOM("gom")` - `SA("sa")` - `BGC("bgc")` - `TH("th")` - `CH_SIM("ch_sim")` - `CH_TRA("ch_tra")` - `JA("ja")` - `KO("ko")` - `TA("ta")` - `TE("te")` - `KN("kn")` - `Optional maxPages` The maximum number of pages to parse - `Optional> targetPages` The pages to target for parsing (0-indexed, so first page is at 0) - `Optional updatedAt` Update datetime ### Classify Parsing Configuration - `class ClassifyParsingConfiguration:` Parsing configuration for a classify job. - `Optional lang` The language to parse the files in - `AF("af")` - `AZ("az")` - `BS("bs")` - `CS("cs")` - `CY("cy")` - `DA("da")` - `DE("de")` - `EN("en")` - `ES("es")` - `ET("et")` - `FR("fr")` - `GA("ga")` - `HR("hr")` - `HU("hu")` - `ID("id")` - `IS("is")` - `IT("it")` - `KU("ku")` - `LA("la")` - `LT("lt")` - `LV("lv")` - `MI("mi")` - `MS("ms")` - `MT("mt")` - `NL("nl")` - `NO("no")` - `OC("oc")` - `PI("pi")` - `PL("pl")` - `PT("pt")` - `RO("ro")` - `RS_LATIN("rs_latin")` - `SK("sk")` - `SL("sl")` - `SQ("sq")` - `SV("sv")` - `SW("sw")` - `TL("tl")` - `TR("tr")` - `UZ("uz")` - `VI("vi")` - `AR("ar")` - `FA("fa")` - `UG("ug")` - `UR("ur")` - `BN("bn")` - `AS("as")` - `MNI("mni")` - `RU("ru")` - `RS_CYRILLIC("rs_cyrillic")` - `BE("be")` - `BG("bg")` - `UK("uk")` - `MN("mn")` - `ABQ("abq")` - `ADY("ady")` - `KBD("kbd")` - `AVA("ava")` - `DAR("dar")` - `INH("inh")` - `CHE("che")` - `LBE("lbe")` - `LEZ("lez")` - `TAB("tab")` - `TJK("tjk")` - `HI("hi")` - `MR("mr")` - `NE("ne")` - `BH("bh")` - `MAI("mai")` - `ANG("ang")` - `BHO("bho")` - `MAH("mah")` - `SCK("sck")` - `NEW("new")` - `GOM("gom")` - `SA("sa")` - `BGC("bgc")` - `TH("th")` - `CH_SIM("ch_sim")` - `CH_TRA("ch_tra")` - `JA("ja")` - `KO("ko")` - `TA("ta")` - `TE("te")` - `KN("kn")` - `Optional maxPages` The maximum number of pages to parse - `Optional> targetPages` The pages to target for parsing (0-indexed, so first page is at 0)