# Files ## Get Pipeline File Status Counts `FileGetStatusCountsResponse pipelines().files().getStatusCounts(FileGetStatusCountsParamsparams = FileGetStatusCountsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/pipelines/{pipeline_id}/files/status-counts` Get files for a pipeline. ### Parameters - `FileGetStatusCountsParams params` - `Optional pipelineId` - `Optional dataSourceId` - `Optional onlyManuallyUploaded` ### Returns - `class FileGetStatusCountsResponse:` - `Counts counts` The counts of files by status - `long totalCount` The total number of files - `Optional dataSourceId` The ID of the data source that the files belong to - `Optional onlyManuallyUploaded` Whether to only count manually uploaded files - `Optional pipelineId` The ID of the pipeline that the files belong to ### 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.pipelines.files.FileGetStatusCountsParams; import com.llamacloud_prod.api.models.pipelines.files.FileGetStatusCountsResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileGetStatusCountsResponse response = client.pipelines().files().getStatusCounts("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"); } } ``` #### Response ```json { "counts": { "foo": 0 }, "total_count": 0, "data_source_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "only_manually_uploaded": true, "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ``` ## Get Pipeline File Status `ManagedIngestionStatusResponse pipelines().files().getStatus(FileGetStatusParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/pipelines/{pipeline_id}/files/{file_id}/status` Get status of a file for a pipeline. ### Parameters - `FileGetStatusParams params` - `String pipelineId` - `Optional fileId` ### Returns - `class ManagedIngestionStatusResponse:` - `Status status` Status of the ingestion. - `NOT_STARTED("NOT_STARTED")` - `IN_PROGRESS("IN_PROGRESS")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `PARTIAL_SUCCESS("PARTIAL_SUCCESS")` - `CANCELLED("CANCELLED")` - `Optional deploymentDate` Date of the deployment. - `Optional effectiveAt` When the status is effective - `Optional> error` List of errors that occurred during ingestion. - `String jobId` ID of the job that failed. - `String message` List of errors that occurred during ingestion. - `Step step` Name of the job that failed. - `MANAGED_INGESTION("MANAGED_INGESTION")` - `DATA_SOURCE("DATA_SOURCE")` - `FILE_UPDATER("FILE_UPDATER")` - `PARSE("PARSE")` - `TRANSFORM("TRANSFORM")` - `INGESTION("INGESTION")` - `METADATA_UPDATE("METADATA_UPDATE")` - `Optional jobId` ID of the latest job. ### 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.pipelines.ManagedIngestionStatusResponse; import com.llamacloud_prod.api.models.pipelines.files.FileGetStatusParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileGetStatusParams params = FileGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build(); ManagedIngestionStatusResponse managedIngestionStatusResponse = client.pipelines().files().getStatus(params); } } ``` #### Response ```json { "status": "NOT_STARTED", "deployment_date": "2019-12-27T18:11:19.117Z", "effective_at": "2019-12-27T18:11:19.117Z", "error": [ { "job_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "message": "message", "step": "MANAGED_INGESTION" } ], "job_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ``` ## Add Files To Pipeline Api `List pipelines().files().create(FileCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **put** `/api/v1/pipelines/{pipeline_id}/files` Add files to a pipeline. ### Parameters - `FileCreateParams params` - `Optional pipelineId` - `List body` - `String fileId` The ID of the file - `Optional customMetadata` Custom metadata for the file - `class UnionMember0:` - `List` - `String` - `double` - `boolean` ### 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.pipelines.files.FileCreateParams; import com.llamacloud_prod.api.models.pipelines.files.PipelineFile; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileCreateParams params = FileCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody(FileCreateParams.Body.builder() .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build()) .build(); List pipelineFiles = client.pipelines().files().create(params); } } ``` #### Response ```json [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config_hash": { "foo": { "foo": "bar" } }, "created_at": "2019-12-27T18:11:19.117Z", "custom_metadata": { "foo": { "foo": "bar" } }, "data_source_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "external_file_id": "external_file_id", "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "file_size": 0, "file_type": "file_type", "indexed_page_count": 0, "last_modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "permission_info": { "foo": { "foo": "bar" } }, "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resource_info": { "foo": { "foo": "bar" } }, "status": "NOT_STARTED", "status_updated_at": "2019-12-27T18:11:19.117Z", "updated_at": "2019-12-27T18:11:19.117Z" } ] ``` ## Update Pipeline File `PipelineFile pipelines().files().update(FileUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **put** `/api/v1/pipelines/{pipeline_id}/files/{file_id}` Update a file for a pipeline. ### Parameters - `FileUpdateParams params` - `String pipelineId` - `Optional fileId` - `Optional customMetadata` Custom metadata for the file - `class UnionMember0:` - `List` - `String` - `double` - `boolean` ### Returns - `class PipelineFile:` A file associated with a pipeline. - `String id` Unique identifier for the pipeline file. - `String pipelineId` The ID of the pipeline that the file is associated with. - `Optional configHash` Hashes for the configuration of the pipeline. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional createdAt` When the pipeline file was created. - `Optional customMetadata` Custom metadata for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional dataSourceId` The ID of the data source that the file belongs to. - `Optional externalFileId` The ID of the file in the external system. - `Optional fileId` The ID of the file. - `Optional fileSize` Size of the file in bytes. - `Optional fileType` File type (e.g. pdf, docx, etc.). - `Optional indexedPageCount` The number of pages that have been indexed for this file. - `Optional lastModifiedAt` The last modified time of the file. - `Optional name` Name of the file. - `Optional permissionInfo` Permission information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional projectId` The ID of the project that the file belongs to. - `Optional resourceInfo` Resource information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional status` Status of the pipeline file. - `NOT_STARTED("NOT_STARTED")` - `IN_PROGRESS("IN_PROGRESS")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `CANCELLED("CANCELLED")` - `Optional statusUpdatedAt` The last time the status was updated. - `Optional updatedAt` When the pipeline file was last updated. ### 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.pipelines.files.FileUpdateParams; import com.llamacloud_prod.api.models.pipelines.files.PipelineFile; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileUpdateParams params = FileUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build(); PipelineFile pipelineFile = client.pipelines().files().update(params); } } ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config_hash": { "foo": { "foo": "bar" } }, "created_at": "2019-12-27T18:11:19.117Z", "custom_metadata": { "foo": { "foo": "bar" } }, "data_source_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "external_file_id": "external_file_id", "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "file_size": 0, "file_type": "file_type", "indexed_page_count": 0, "last_modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "permission_info": { "foo": { "foo": "bar" } }, "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resource_info": { "foo": { "foo": "bar" } }, "status": "NOT_STARTED", "status_updated_at": "2019-12-27T18:11:19.117Z", "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Delete Pipeline File `pipelines().files().delete(FileDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **delete** `/api/v1/pipelines/{pipeline_id}/files/{file_id}` Delete a file from a pipeline. ### Parameters - `FileDeleteParams params` - `String pipelineId` - `Optional fileId` ### 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.pipelines.files.FileDeleteParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileDeleteParams params = FileDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build(); client.pipelines().files().delete(params); } } ``` ## List Pipeline Files2 `FileListPage pipelines().files().list(FileListParamsparams = FileListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/pipelines/{pipeline_id}/files2` List files for a pipeline with optional filtering, sorting, and pagination. ### Parameters - `FileListParams params` - `Optional pipelineId` - `Optional dataSourceId` - `Optional fileNameContains` - `Optional limit` - `Optional offset` - `Optional onlyManuallyUploaded` - `Optional orderBy` - `Optional> statuses` Filter by file statuses - `NOT_STARTED("NOT_STARTED")` - `IN_PROGRESS("IN_PROGRESS")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `CANCELLED("CANCELLED")` ### Returns - `class PipelineFile:` A file associated with a pipeline. - `String id` Unique identifier for the pipeline file. - `String pipelineId` The ID of the pipeline that the file is associated with. - `Optional configHash` Hashes for the configuration of the pipeline. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional createdAt` When the pipeline file was created. - `Optional customMetadata` Custom metadata for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional dataSourceId` The ID of the data source that the file belongs to. - `Optional externalFileId` The ID of the file in the external system. - `Optional fileId` The ID of the file. - `Optional fileSize` Size of the file in bytes. - `Optional fileType` File type (e.g. pdf, docx, etc.). - `Optional indexedPageCount` The number of pages that have been indexed for this file. - `Optional lastModifiedAt` The last modified time of the file. - `Optional name` Name of the file. - `Optional permissionInfo` Permission information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional projectId` The ID of the project that the file belongs to. - `Optional resourceInfo` Resource information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional status` Status of the pipeline file. - `NOT_STARTED("NOT_STARTED")` - `IN_PROGRESS("IN_PROGRESS")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `CANCELLED("CANCELLED")` - `Optional statusUpdatedAt` The last time the status was updated. - `Optional updatedAt` When the pipeline file was last updated. ### 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.pipelines.files.FileListPage; import com.llamacloud_prod.api.models.pipelines.files.FileListParams; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); FileListPage page = client.pipelines().files().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"); } } ``` #### Response ```json { "files": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pipeline_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config_hash": { "foo": { "foo": "bar" } }, "created_at": "2019-12-27T18:11:19.117Z", "custom_metadata": { "foo": { "foo": "bar" } }, "data_source_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "external_file_id": "external_file_id", "file_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "file_size": 0, "file_type": "file_type", "indexed_page_count": 0, "last_modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "permission_info": { "foo": { "foo": "bar" } }, "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "resource_info": { "foo": { "foo": "bar" } }, "status": "NOT_STARTED", "status_updated_at": "2019-12-27T18:11:19.117Z", "updated_at": "2019-12-27T18:11:19.117Z" } ], "limit": 0, "offset": 0, "total_count": 0 } ``` ## Domain Types ### Pipeline File - `class PipelineFile:` A file associated with a pipeline. - `String id` Unique identifier for the pipeline file. - `String pipelineId` The ID of the pipeline that the file is associated with. - `Optional configHash` Hashes for the configuration of the pipeline. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional createdAt` When the pipeline file was created. - `Optional customMetadata` Custom metadata for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional dataSourceId` The ID of the data source that the file belongs to. - `Optional externalFileId` The ID of the file in the external system. - `Optional fileId` The ID of the file. - `Optional fileSize` Size of the file in bytes. - `Optional fileType` File type (e.g. pdf, docx, etc.). - `Optional indexedPageCount` The number of pages that have been indexed for this file. - `Optional lastModifiedAt` The last modified time of the file. - `Optional name` Name of the file. - `Optional permissionInfo` Permission information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional projectId` The ID of the project that the file belongs to. - `Optional resourceInfo` Resource information for the file. - `class UnionMember0:` - `List` - `String` - `double` - `boolean` - `Optional status` Status of the pipeline file. - `NOT_STARTED("NOT_STARTED")` - `IN_PROGRESS("IN_PROGRESS")` - `SUCCESS("SUCCESS")` - `ERROR("ERROR")` - `CANCELLED("CANCELLED")` - `Optional statusUpdatedAt` The last time the status was updated. - `Optional updatedAt` When the pipeline file was last updated.