{"openapi":"3.0.0","info":{"title":"Context Evaluation Report Application API","description":"API methods of this application cannot be called directly. Instead, you should trigger Crowdin's platform API endpoint, Crowdin will authorize your request and route it to this app.\n\nExample call for crowdin.com \n\n    curl --request GET \n    --url \"https://crowdin.com/api/v2/applications/context-evaluation-report/api/data?report=raw&projects=479\" \n    --header \"Authorization: Bearer 70cf05deasdas78c84c73c4cf986ee0a3ee911w1dsad384e3c4asd1qdbbcf6b6db5732e\" \nExample call for Crowdin Enterprise \n\n    curl --request GET \n    --url \"https://acme.crowdin.com/api/v2/applications/context-evaluation-report/api/data?report=raw&projects=479&startDate=2023-06-01T06%3A32%3A01.048Z&endDate=2023-06-23T06%3A32%3A01.048Z\" \n    --header \"Authorization: Bearer 70cf05dee35sad12rfes0a3ee911462e7b0723rfdfrg1e45bbcf6b6db5732e\" \n","version":"1.0.0","x-logo":{"url":"https://support.crowdin.com/assets/crowdin-logo.svg"}},"servers":[{"url":"{protocol}//{host}/api/v2/applications/context-evaluation-report/api"}],"paths":{"/generate-report":{"post":{"summary":"Generate a Context Evaluation Report","operationId":"generateReport","description":"Initiates the generation of a context evaluation report for a specific project. This report evaluates whether the provided source strings include sufficient context for an unambiguous translation. The request payload must adhere to either the context-based or task-based schema.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ContextBasedSchema"},{"$ref":"#/components/schemas/TaskBasedSchema"}]}}}},"responses":{"202":{"description":"Report generation has been successfully initiated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportStatus"}}}},"400":{"description":"Invalid request. The payload does not match the required schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict. Another report generation process is already in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error while initiating report generation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/check-report":{"post":{"summary":"Check Report Generation Status","operationId":"checkReportStatus","description":"Retrieves the current status of a report generation job using the provided report identifier. Returns detailed job information including progress, timestamps, and associated attributes.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportIdSchema"}}}},"responses":{"200":{"description":"Successfully retrieved the report status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportStatus"}}}},"404":{"description":"Report not found for the provided identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error while retrieving the report status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/cancel-report":{"post":{"summary":"Cancel an Ongoing Report Generation","operationId":"cancelReportGeneration","description":"Cancels an in-progress report generation job using the provided report identifier. This operation is only valid if the report status is \"in_progress\".\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportIdSchema"}}}},"responses":{"204":{"description":"Report generation has been successfully canceled."},"400":{"description":"The report is not in progress and cannot be canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Report not found for the provided identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error while canceling the report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/download-report":{"post":{"summary":"Download a Completed Report","operationId":"downloadReport","description":"Provides a signed URL for downloading a completed context evaluation report. The request must include a valid report identifier and specify the desired file format (JSON, CSV, or XLSX). The report can only be downloaded if its generation status is finished.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadReportSchema"}}}},"responses":{"200":{"description":"Successfully generated a download URL for the completed report.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"A signed URL for downloading the report."},"expireIn":{"type":"string","format":"date-time","description":"Expiration timestamp for the download URL."}}}}}},"400":{"description":"The report is not ready for download.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Report not found for the provided identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error while processing the download request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ContextBasedSchema":{"type":"object","required":["projectId","aiPromptId"],"properties":{"projectId":{"type":"number","description":"The unique numeric identifier for the project."},"aiPromptId":{"type":"number","description":"The identifier for the AI prompt used for context evaluation."},"dateFrom":{"type":"string","format":"date-time","description":"Optional start date filter for source strings."},"dateTo":{"type":"string","format":"date-time","description":"Optional end date filter for source strings."},"branchIds":{"type":"array","items":{"type":"number"},"description":"Optional list of branch IDs to filter the source strings."},"directoryIds":{"type":"array","items":{"type":"number"},"description":"Optional list of directory IDs to filter the source strings."},"fileIds":{"type":"array","items":{"type":"number"},"description":"Optional list of file IDs to filter the source strings."},"labelIds":{"type":"array","items":{"type":"number"},"description":"Optional list of label IDs to filter the source strings."},"labelIncludeType":{"type":"string","enum":["include","exclude"],"description":"Optional parameter indicating whether to include or exclude the specified labels."}}},"TaskBasedSchema":{"type":"object","required":["projectId","aiPromptId","taskIds"],"properties":{"projectId":{"type":"number","description":"The unique numeric identifier for the project."},"aiPromptId":{"type":"number","description":"The identifier for the AI prompt used for context evaluation."},"taskIds":{"type":"array","items":{"type":"number"},"description":"List of task IDs to filter the source strings."}}},"ReportIdSchema":{"type":"object","required":["reportId"],"properties":{"reportId":{"type":"string","format":"uuid","description":"The unique identifier of the report job."}}},"DownloadReportSchema":{"type":"object","required":["reportId","format"],"properties":{"reportId":{"type":"string","format":"uuid","description":"The unique identifier of the report job."},"format":{"type":"string","enum":["json","csv","xlsx"],"description":"The desired file format for the downloadable report."}}},"ReportStatus":{"type":"object","properties":{"identifier":{"type":"string","description":"Unique identifier of the report job."},"status":{"type":"string","description":"Current status of the report (e.g., in_progress, finished, failed, canceled)."},"progress":{"type":"number","description":"Percentage progress of the report generation."},"attributes":{"type":"object","description":"Additional attributes associated with the report job."},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the report job was created."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the report job was last updated."},"startedAt":{"type":"string","format":"date-time","description":"Timestamp when the report job started processing."},"finishedAt":{"type":"string","format":"date-time","description":"Timestamp when the report job completed."}}},"ErrorResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string","description":"Detailed error message."},"errors":{"type":"array","items":{"type":"object","properties":{"instancePath":{"type":"string","description":"JSON pointer to the property that caused the error."},"schemaPath":{"type":"string","description":"JSON pointer to the part of the schema that was violated."},"keyword":{"type":"string","description":"Validation keyword that failed."},"params":{"type":"object","additionalProperties":true,"description":"Additional details regarding the validation error."},"message":{"type":"string","description":"Explanation of the validation error."}}}}}}}}}},"tags":[]}