{"components":{"schemas":{"ErrorInfo":{"additionalProperties":false,"properties":{"date_created":{"format":"date-time","type":"string"},"harvest_job_id":{"format":"uuid","type":"string"},"harvest_record_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"message":{"type":"string"},"type":{"type":"string"}},"required":["harvest_job_id","harvest_record_id","id"],"type":"object"},"HTTPError":{"properties":{"detail":{"type":"object"},"message":{"type":"string"}},"type":"object"},"JobInfo":{"additionalProperties":false,"properties":{"date_created":{"format":"date-time","type":"string"},"date_finished":{"format":"date-time","type":"string"},"harvest_source_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"job_type":{"type":"string"},"records_added":{"type":"integer"},"records_deleted":{"type":"integer"},"records_errored":{"type":"integer"},"records_ignored":{"type":"integer"},"records_total":{"type":"integer"},"records_updated":{"type":"integer"},"records_validated":{"type":"integer"},"status":{"enum":["in_progress","complete","new","error"],"type":"string"}},"required":["harvest_source_id","id","status"],"type":"object"},"OrgInfo":{"additionalProperties":false,"properties":{"aliases":{"items":{"type":"string"},"type":"array"},"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"logo":{"type":"string"},"name":{"type":"string"},"organization_type":{"enum":["Federal Government","City Government","State Government","County Government","University","Tribal","Non-Profit"],"type":"string"},"slug":{"maxLength":100,"pattern":"^[a-z0-9-]+$","type":"string"},"source_count":{"type":"integer"}},"required":["id","name","slug"],"type":"object"},"RecordInfo":{"additionalProperties":false,"properties":{"action":{"enum":["create","update","delete"],"type":"string"},"ckan_id":{"type":"string"},"date_created":{"format":"date-time","type":"string"},"date_finished":{"format":"date-time","type":"string"},"harvest_job_id":{"format":"uuid","type":"string"},"harvest_source_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"identifier":{"type":"string"},"parent_identifier":{"type":"string"},"source_hash":{"type":"string"},"source_raw":{"type":"string"},"source_transform":{"additionalProperties":{},"type":"object"},"status":{"enum":["error","success"],"type":"string"}},"required":["harvest_job_id","harvest_source_id","id","identifier"],"type":"object"},"SourceInfo":{"additionalProperties":false,"properties":{"collection_parent_url":{"type":"string"},"frequency":{"enum":["manual","daily","weekly","biweekly","monthly"],"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"notification_emails":{"items":{"type":"string"},"type":"array"},"notification_frequency":{"enum":["on_error","always","on_error_or_update"],"type":"string"},"organization_id":{"format":"uuid","type":"string"},"schema_type":{"enum":["iso19115_1","iso19115_2","dcatus1.1: federal","dcatus1.1: non-federal"],"type":"string"},"source_type":{"enum":["document","waf","waf-collection"],"type":"string"},"url":{"type":"string"}},"required":["frequency","id","name","notification_frequency","organization_id","schema_type","source_type","url"],"type":"object"},"ValidationError":{"properties":{"detail":{"properties":{"<location>":{"properties":{"<field_name>":{"items":{"type":"string"},"type":"array"}},"type":"object"}},"type":"object"},"message":{"type":"string"}},"type":"object"},"ValidationErrorResponseSchema":{"additionalProperties":false,"properties":{"error":{"type":"string"}},"required":["error"],"type":"object"},"ValidationResultSchema":{"additionalProperties":false,"properties":{"validation_errors":{"items":{"items":{"type":"string"},"maxItems":2,"minItems":2,"type":"array"},"type":"array"}},"required":["validation_errors"],"type":"object"},"ValidatorInfo":{"additionalProperties":false,"properties":{"fetch_method":{"enum":["url","paste"],"type":"string"},"json_text":{"type":"string"},"schema":{"enum":["dcatus1.1: federal dataset","dcatus1.1: non-federal dataset"],"type":"string"},"url":{"format":"url","type":"string"}},"required":["fetch_method","schema"],"type":"object"}}},"info":{"title":"Datagov Harvester","version":"0.1.0"},"openapi":"3.1.0","paths":{"/api/validate":{"post":{"description":"Downloads or parses a DCATUS catalog and validates each dataset.","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidatorInfo"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResultSchema"}}},"description":"Successful response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponseSchema"}}},"description":"Failed to download or process the catalog"}},"summary":"Validate a DCAT catalog against a v1.1 or v3.0 schema","tags":["Api"]}},"/harvest_error/{error_id}":{"get":{"parameters":[{"in":"path","name":"error_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorInfo"}}},"description":"Successful response"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Get Harvest Error","tags":["Api"]}},"/harvest_job/{job_id}":{"get":{"parameters":[{"in":"path","name":"job_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobInfo"}}},"description":"View harvest job"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"View Harvest Job","tags":["Api"]}},"/harvest_job/{job_id}/errors/{error_type}":{"get":{"parameters":[{"in":"path","name":"job_id","required":true,"schema":{"type":"string"}},{"in":"path","name":"error_type","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"format":"binary","type":"string"}}},"description":"Successful response"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Download Harvest Errors By Job","tags":["Api"]}},"/harvest_job_errors/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}},"/harvest_jobs/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}},"/harvest_record/{record_id}":{"get":{"parameters":[{"in":"path","name":"record_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInfo"}}},"description":"Successful response"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Get Harvest Record","tags":["Api"]}},"/harvest_record/{record_id}/errors":{"get":{"parameters":[{"in":"path","name":"record_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ErrorInfo"},"type":"array"}}},"description":"List of errors for this record"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Get All Harvest Record Errors","tags":["Api"]}},"/harvest_record/{record_id}/raw":{"get":{"parameters":[{"in":"path","name":"record_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"type":"object"},"application/xml":{"type":"object"}},"description":"Raw harvest record contents"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Get Harvest Record Raw","tags":["Api"]}},"/harvest_record/{record_id}/transformed":{"get":{"parameters":[{"in":"path","name":"record_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"type":"object"}},"description":"Transformed harvest record contents"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"Get Harvest Record Transformed","tags":["Api"]}},"/harvest_record_errors/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}},"/harvest_records/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}},"/harvest_source/{source_id}":{"get":{"parameters":[{"in":"path","name":"source_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceInfo"}}},"description":"View harvest source"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"View Harvest Source","tags":["Api"]}},"/harvest_sources/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}},"/organization/{org_identifier}":{"get":{"description":"This route used to accept only UUIDs. It now resolves either a UUID or a\nslug to an organization, then prefers the slug when linking back to the\norganization page.","parameters":[{"in":"path","name":"org_identifier","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgInfo"}}},"description":"View organization info"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Not found"}},"summary":"View an organization by UUID or slug.","tags":["Api"]}},"/organizations/":{"get":{"parameters":[{"in":"query","name":"harvest_job_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"harvest_source_id","required":false,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"facets","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"per_page","required":false,"schema":{"type":"integer"}},{"in":"query","name":"count","required":false,"schema":{"type":"boolean"}},{"in":"query","name":"order_by","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"$ref":"#/components/schemas/OrgInfo"},{"$ref":"#/components/schemas/SourceInfo"},{"$ref":"#/components/schemas/RecordInfo"},{"$ref":"#/components/schemas/JobInfo"}]},"type":"array"}}},"description":"List of reuslts for this query"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Json Builder Query","tags":["Api"]}}},"servers":[{"url":"https://harvest.data.gov"}],"tags":[{"name":"Api"}]}
