{"openapi":"3.1.0","info":{"title":"DPS Submission Service API","description":"API for Digital Preservation Submission Service. This API requires OAuth2 client credentials for authentication.\n\n## Error Responses\n\nAll error responses follow **RFC 9457 Problem Details for HTTP APIs** standard. Errors are returned in JSON format with `application/problem+json` media type.\n\n### Error Response Structure\n\n```json\n{\n  \"type\": \"https://digitalpreservation.no/problems/submission-not-found\",\n  \"title\": \"Submission Not Found\",\n  \"status\": 404,\n  \"detail\": \"Submission with ID abc123 was not found\",\n  \"instance\": \"/v1/contracts/4eaf/submissions/abc123\",\n  \"timestamp\": \"2025-10-14T10:03:00.123Z\",\n  \"errorCategory\": \"NOT_FOUND\"\n}\n```\n\nSee the **ProblemDetail** schema below for complete documentation.","version":"1.0.0"},"servers":[{"url":"https://api.nb.no/dps-submission","description":"Generated server url"}],"security":[{"oauth2":[]}],"tags":[{"name":"Submissions","description":"Operations related to submissions"},{"name":"Files","description":"Operations related to files"},{"name":"Disseminations","description":"Operations related to disseminations"},{"name":"Internal","description":"Internal operations"}],"paths":{"/v1/disseminations":{"get":{"tags":["Internal"],"summary":"Get next disseminations for processing","description":"Returns a list of disseminations ready for processing, ordered by priority and creation date. Automatically sets status to 'QUEUED' for returned disseminations. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"getDisseminations","parameters":[{"name":"page","in":"query","description":"Page number (zero-based)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Size of each page","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedModelDisseminationResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}}}},"post":{"tags":["Disseminations"],"summary":"Create a new dissemination request","description":"Initiates a dissemination process for a given AIP (Archival Information Package). The user must have the appropriate permissions for the contract associated with the AIP. The service will verify that the AIP is in a 'preserved' state before starting the dissemination. If a dissemination request for the same AIP is already in progress by the same client, a conflict error will be returned.","operationId":"createDissemination","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDisseminationRequest"}}},"required":true},"responses":{"201":{"description":"Dissemination requested","headers":{"Location":{"description":"The URI of the created dissemination resource.","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisseminationResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - AIP does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"AIP Not Found":{"description":"AIP Not Found","value":{"type":"https://digitalpreservation.no/problems/aip-not-found","title":"AIP Not Found","status":404,"detail":"AIP with ID nb:aip:123456 was not found in the metadata service","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/events","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"409":{"description":"Conflict - Dissemination state conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Dissemination Conflict":{"description":"Dissemination Conflict","value":{"type":"https://digitalpreservation.no/problems/dissemination-conflict","title":"Dissemination Conflict","status":409,"detail":"Dissemination with ID 3kMnPQwOB7x3Pu9gfG0gJV already exists","instance":"/v1/disseminations","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}},"422":{"description":"Unprocessable Entity - AIP is not in preserved state","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"AIP Not Preserved":{"description":"AIP Not Preserved","value":{"type":"https://digitalpreservation.no/problems/aip-not-preserved","title":"AIP Not Preserved","status":422,"detail":"AIP with ID nb:aip:123456 is not preserved. Current status: PENDING","instance":"/v1/disseminations","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"BUSINESS_RULE_VIOLATION","currentStatus":"PENDING"}}}}}}}}},"/v1/disseminations/{disseminationId}/status":{"post":{"tags":["Internal"],"summary":"Update dissemination status","description":"Update dissemination status when processing in DPS. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"updateDisseminationStatus","parameters":[{"name":"disseminationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":true,"schema":{"type":"string","description":"Status of the dissemination.","enum":["RECEIVED","QUEUED","DOWNLOADING_FROM_REPOSITORY","FIXITY_CHECK","UPLOADING_TO_S3","DISSEMINATED","FAILED","REJECTED"]}}],"responses":{"200":{"description":"Dissemination status updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisseminationResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Dissemination does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Dissemination Not Found":{"description":"Dissemination Not Found","value":{"type":"https://digitalpreservation.no/problems/dissemination-not-found","title":"Dissemination Not Found","status":404,"detail":"Dissemination with ID 3kMnPQwOB7x3Pu9gfG0gJV was not found","instance":"/v1/disseminations/3kMnPQwOB7x3Pu9gfG0gJV","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}}}}},"/v1/disseminations/download-url":{"post":{"tags":["Internal"],"summary":"Generate download URL for S3 file","description":"Generates a presigned URL for downloading a file from S3 using the file path. Used by NiFi for dissemination. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"generateDownloadUrl","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDownloadUrlRequest"}}},"required":true},"responses":{"200":{"description":"Download URL generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDownloadUrlResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}}}}},"/v1/contracts/{contractId}/submissions":{"get":{"tags":["Submissions"],"summary":"Retrieve submissions for given contract","description":"Returns a paginated list of submissions for the contract, ordered by creation date. Use the optional 'objectId' and 'archiveId' query parameters to filter the result; multiple filters are combined with AND. Returns an empty page if no submissions match.","operationId":"getSubmissions","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"objectId","in":"query","description":"Filter by object ID (exact match)","required":false,"schema":{"type":"string"}},{"name":"archiveId","in":"query","description":"Filter by archive ID (exact match)","required":false,"schema":{"type":"string","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"}},{"name":"page","in":"query","description":"Page number (zero-based)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Size of each page","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Submissions found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedModelSubmissionResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}}}},"post":{"tags":["Submissions"],"summary":"Create a new submission","description":"Creates a new submission for the specified contract. The submission is initialized with the status REGISTERED. The request body must include the objectId and any relevant metadata. The combination of contractId and objectId must be unique. Returns 409 if a submission with the same objectId already exists for the given contractId.","operationId":"createSubmission","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubmissionRequest"}}},"required":true},"responses":{"201":{"description":"Submission created","headers":{"Location":{"description":"The URI of the created submission resource.","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"409":{"description":"Conflict - AIP conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"AIP Conflict":{"description":"AIP Conflict","value":{"type":"https://digitalpreservation.no/problems/aip-conflict","title":"AIP Conflict","status":409,"detail":"AIP with ID nb:aip:123456 already exists","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}},"502":{"description":"Bad Gateway - Metadata operation failed in external service","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Metadata Operation Failed":{"description":"Metadata Operation Failed","value":{"type":"https://digitalpreservation.no/problems/metadata-operation-failed","title":"Metadata Operation Failed","status":502,"detail":"Failed to perform metadata operation in external service","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"EXTERNAL_SERVICE_ERROR"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}/status":{"post":{"tags":["Internal"],"summary":"Update submission status","description":"Update submission status when transferred to DPS. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"updateSubmissionStatus","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}},{"name":"status","in":"query","description":"New status for the submission","required":true,"schema":{"type":"string","description":"Status of the submission.","enum":["REGISTERED","UPLOAD_COMPLETED","PROCESSING","PRESERVED","REJECTED"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubmissionStatusRequest"}}}},"responses":{"200":{"description":"Submission status updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Submission does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Found":{"description":"Submission Not Found","value":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}/finalize":{"post":{"tags":["Submissions"],"summary":"Finalize submission","description":"Once all files have been uploaded, call this endpoint to finalize the submission. The submission must contain at least one registered, non-empty file, and every registered file must exist in S3. A finalized submission cannot be finalized again.","operationId":"finalizeSubmission","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"responses":{"200":{"description":"Submission finalized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Submission does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Found":{"description":"Submission Not Found","value":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"409":{"description":"Conflict - Submission is already finalized and cannot be modified","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Finalized":{"description":"Submission Finalized","value":{"type":"https://digitalpreservation.no/problems/submission-finalized","title":"Submission Already Finalized","status":409,"detail":"Cannot modify submission with ID 7mVKGHwOA6w2Ot8feF9fIU because it has already been finalized","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/finalize","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}},"422":{"description":"Unprocessable Entity - No files registered for submission","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"No Files Registered":{"description":"No Files Registered","value":{"type":"https://digitalpreservation.no/problems/no-files-registered","title":"No Files Registered","status":422,"detail":"Submission has no registered files","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/finalize","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"BUSINESS_RULE_VIOLATION"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}/files":{"post":{"tags":["Files"],"summary":"Register file and receive upload URL","operationId":"registerFile","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterFileRequest"}}},"required":true},"responses":{"201":{"description":"File registered and upload URL generated","headers":{"Location":{"description":"The URI of the created file resource.","style":"simple"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"409":{"description":"Conflict - File state conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"File Conflict":{"description":"File Conflict","value":{"type":"https://digitalpreservation.no/problems/file-conflict","title":"File Conflict","status":409,"detail":"File already registered in submission","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/files","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}}}},"delete":{"tags":["Internal"],"summary":"Delete submission files from S3","description":"Deletes all files in S3 for a preserved submission. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"deleteSubmissionFilesFromS3","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"responses":{"204":{"description":"Submission files deleted from S3"},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Submission does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Found":{"description":"Submission Not Found","value":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"422":{"description":"Unprocessable Entity - Submission is not in preserved state","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Preserved":{"description":"Submission Not Preserved","value":{"type":"https://digitalpreservation.no/problems/submission-not-preserved","title":"Submission Not Preserved","status":422,"detail":"Cannot delete files from S3 unless submission status is PRESERVED","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/files","currentStatus":"PROCESSING","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"BUSINESS_RULE_VIOLATION"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}/events":{"get":{"tags":["Submissions"],"summary":"Get PREMIS Events for a Submission","description":"Returns all PREMIS events for the specified submission. Requires read or write access to the contract.","operationId":"getEvents","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"responses":{"200":{"description":"List of PREMIS events for the submission","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventDto"}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - AIP does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"AIP Not Found":{"description":"AIP Not Found","value":{"type":"https://digitalpreservation.no/problems/aip-not-found","title":"AIP Not Found","status":404,"detail":"AIP with ID nb:aip:123456 was not found in the metadata service","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/events","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"502":{"description":"Bad Gateway - Failed to retrieve events from external service","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Event Retrieval Failed":{"description":"Event Retrieval Failed","value":{"type":"https://digitalpreservation.no/problems/event-retrieval-failed","title":"Event Retrieval Failed","status":502,"detail":"Failed to retrieve events from metadata service","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/events","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"EXTERNAL_SERVICE_ERROR"}}}}}}}},"post":{"tags":["Submissions"],"summary":"Submit a PREMIS Event with associated Agent","description":"Submit a PREMIS-style Event along with its associated Agent for a specific submission.\nThe event can optionally reference specific files within the submission using the fileRef field.\n\nThe submission must be in REGISTERED status to accept events. The user must have write access to the contract.\n","operationId":"submitEvent","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitEventDto"}}},"required":true},"responses":{"204":{"description":"Event successfully submitted to metadata service"},"400":{"description":"Bad Request - Invalid input or validation failed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Validation Error":{"description":"Validation Error","value":{"type":"https://digitalpreservation.no/problems/validation-error","title":"Validation Error","status":400,"detail":"Validation failed","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"VALIDATION_ERROR","validationErrors":{"objectId":["must not be null"],"metadata":["must not be null"]}}}}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - AIP does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"AIP Not Found":{"description":"AIP Not Found","value":{"type":"https://digitalpreservation.no/problems/aip-not-found","title":"AIP Not Found","status":404,"detail":"AIP with ID nb:aip:123456 was not found in the metadata service","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/events","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"502":{"description":"Bad Gateway - Event submission failed to external service","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Event Submission Failed":{"description":"Event Submission Failed","value":{"type":"https://digitalpreservation.no/problems/event-submission-failed","title":"Event Submission Failed","status":502,"detail":"Failed to submit event to metadata service","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/events","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"EXTERNAL_SERVICE_ERROR"}}}}}}}}},"/v1/submissions":{"get":{"tags":["Internal"],"summary":"Get next submissions for processing","description":"Returns a list of completed submissions ready for processing, ordered by priority and creation date. Requires 'DPS_SUBMISSION_HANDLER' role.","operationId":"getSubmissions_1","parameters":[{"name":"page","in":"query","description":"Page number (zero-based)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Size of each page","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedModelSubmissionResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}}}}},"/v1/disseminations/{disseminationId}":{"get":{"tags":["Disseminations"],"summary":"Get dissemination by ID","description":"Retrieve a specific dissemination by its ID. User must have read permission for the associated contract.","operationId":"getDisseminationById","parameters":[{"name":"disseminationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Dissemination found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisseminationResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Dissemination does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Dissemination Not Found":{"description":"Dissemination Not Found","value":{"type":"https://digitalpreservation.no/problems/dissemination-not-found","title":"Dissemination Not Found","status":404,"detail":"Dissemination with ID 3kMnPQwOB7x3Pu9gfG0gJV was not found","instance":"/v1/disseminations/3kMnPQwOB7x3Pu9gfG0gJV","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}":{"get":{"tags":["Submissions"],"summary":"Retrieve submission","description":"Retrieve a submission by contract and submission ID. Use the 'include' query parameter to optionally embed related data: FILES (registered files), DESCRIPTIVE_METADATA (Dublin Core metadata), EVENTS (PREMIS preservation events with agents).","operationId":"getSubmission","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}},{"name":"include","in":"query","description":"Optional sections to include in the response","required":false,"explode":false,"schema":{"type":"array","items":{"type":"string","enum":["FILES","DESCRIPTIVE_METADATA","EVENTS"]}}}],"responses":{"200":{"description":"Submission found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionDetailResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Submission does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Found":{"description":"Submission Not Found","value":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}}}},"delete":{"tags":["Submissions"],"summary":"Delete a submission","description":"Deletes a submission. The following conditions must be met:\n- The submission must not have any registered files. All files must be deleted before the submission can be deleted.\n- The submission must be in the REGISTERED status. Finalized submissions (e.g., with status UPLOAD_COMPLETED) cannot be deleted.\nIf these conditions are not met, the service will return an error indicating why the deletion is not allowed.","operationId":"deleteSubmission","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}}],"responses":{"204":{"description":"Submission deleted"},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - Submission does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Not Found":{"description":"Submission Not Found","value":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"409":{"description":"Conflict - Submission has registered files and cannot be deleted","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Has Files":{"description":"Submission Has Files","value":{"type":"https://digitalpreservation.no/problems/submission-has-files","title":"Submission Has Files","status":409,"detail":"Cannot delete submission with ID 7mVKGHwOA6w2Ot8feF9fIU because it has 5 registered files","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}}}}},"/v1/contracts/{contractId}/submissions/{submissionId}/files/{fileId}":{"get":{"tags":["Files"],"summary":"Retrieve a specific file by its ID","operationId":"getFile","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}},{"name":"fileId","in":"path","description":"Unique identifier for the file in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"2XQ3lsRHSDAZbOD2MZoynf","pattern":"^[0-9a-zA-Z]{22}$"}}],"responses":{"200":{"description":"File retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - File does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"File Not Found":{"description":"File Not Found","value":{"type":"https://digitalpreservation.no/problems/file-not-found","title":"File Not Found","status":404,"detail":"File with ID 2XQ3lsRHSDAZbOD2MZoynf was not found in submission 7mVKGHwOA6w2Ot8feF9fIU","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/files/2XQ3lsRHSDAZbOD2MZoynf","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}}}},"delete":{"tags":["Files"],"summary":"Delete a file","description":"Deletes a file from a submission. The following condition must be met:\n- The parent submission must be in the REGISTERED status. Files cannot be deleted from finalized submissions.\nIf this condition is not met, the service will return an error indicating that files cannot be deleted from finalized submissions.","operationId":"deleteFile","parameters":[{"name":"contractId","in":"path","description":"ID of the contract, in Base16 format - 4 characters)","required":true,"schema":{"type":"string","example":"4eaf","pattern":"^[0-9a-f]{4}$"}},{"name":"submissionId","in":"path","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"7mVKGHwOA6w2Ot8feF9fIU","pattern":"^[0-9a-zA-Z]{22}$"}},{"name":"fileId","in":"path","description":"Unique identifier for the file in Base62 format - 22 characters. The ID is case-sensitive.","required":true,"schema":{"type":"string","example":"2XQ3lsRHSDAZbOD2MZoynf","pattern":"^[0-9a-zA-Z]{22}$"}},{"name":"deleteFromS3","in":"query","description":"If true, also deletes the file object from S3","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"204":{"description":"File deleted"},"401":{"description":"Unauthorized - Authentication is required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Unauthorized":{"description":"Unauthorized","value":{"type":"https://digitalpreservation.no/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Authentication credentials are missing or invalid","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"403":{"description":"Forbidden - User does not have the required permissions","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Access Denied":{"description":"Access Denied","value":{"type":"https://digitalpreservation.no/problems/access-denied","title":"Access Denied","status":403,"detail":"You do not have permission to access this resource","instance":"/v1/contracts/4eaf/submissions","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"AUTHORIZATION_ERROR"}}}}}},"404":{"description":"Not Found - File does not exist","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"File Not Found":{"description":"File Not Found","value":{"type":"https://digitalpreservation.no/problems/file-not-found","title":"File Not Found","status":404,"detail":"File with ID 2XQ3lsRHSDAZbOD2MZoynf was not found in submission 7mVKGHwOA6w2Ot8feF9fIU","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/files/2XQ3lsRHSDAZbOD2MZoynf","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"}}}}}},"409":{"description":"Conflict - Submission is already finalized and cannot be modified","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"},"examples":{"Submission Finalized":{"description":"Submission Finalized","value":{"type":"https://digitalpreservation.no/problems/submission-finalized","title":"Submission Already Finalized","status":409,"detail":"Cannot modify submission with ID 7mVKGHwOA6w2Ot8feF9fIU because it has already been finalized","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU/finalize","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"CONFLICT"}}}}}}}}}},"components":{"schemas":{"CreateDisseminationRequest":{"type":"object","description":"Request body for creating a new dissemination.","properties":{"archiveId":{"type":"string","description":"Archive ID (UUIDv7) of the object you are trying to disseminate.","example":"019c7114-86fd-721c-b094-c0cfa4b39a43","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"},"priority":{"type":"integer","format":"int32","default":50,"description":"Priority of the dissemination (1-100). Lower number means higher priority.","example":50,"maximum":100,"minimum":1}},"required":["archiveId"]},"ProblemDetail":{"type":"object","description":"RFC 9457 Problem Details - Standard error response format","example":{"type":"https://digitalpreservation.no/problems/submission-not-found","title":"Submission Not Found","status":404,"detail":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf","instance":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU","timestamp":"2025-10-14T08:15:30.123Z","errorCategory":"NOT_FOUND"},"properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. This is a unique identifier for the type of error.","example":"https://digitalpreservation.no/problems/submission-not-found"},"title":{"type":"string","description":"A short, human-readable summary of the problem type","example":"Submission Not Found"},"status":{"type":"integer","format":"int32","description":"The HTTP status code","example":404},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem","example":"Submission with ID 7mVKGHwOA6w2Ot8feF9fIU was not found for contract 4eaf"},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem","example":"/v1/contracts/4eaf/submissions/7mVKGHwOA6w2Ot8feF9fIU"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp when the error occurred (ISO 8601 format)","example":"2025-10-14T08:15:30.123Z"},"errorCategory":{"type":"string","description":"Category of the error for monitoring and analytics purposes","enum":["NOT_FOUND","CONFLICT","VALIDATION_ERROR","BUSINESS_RULE_VIOLATION","AUTHORIZATION_ERROR","INTERNAL_ERROR","EXTERNAL_SERVICE_ERROR"],"example":"NOT_FOUND"},"validationErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Field-level validation errors. Present for validation failures; each field maps to a list of messages.","example":{"objectId":["must not be null"],"metadata":["must not be null"]}},"currentStatus":{"type":"string","description":"Current status of the resource. Present for business rule violations that depend on state.","example":"PENDING"}}},"DisseminationResponse":{"type":"object","properties":{"disseminationId":{"type":"string","description":"Unique identifier for the dissemination in Base62 format - 22 characters. The ID is case-sensitive.","example":"8Z7x1T9rN0Xc2B5Yq4L3zP","pattern":"^[0-9a-zA-Z]{22}$"},"archiveId":{"type":"string","description":"Archive identifier of the object","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"clientId":{"type":"string","description":"Client ID from JWT authentication token","example":"client-id"},"contractId":{"type":"string","description":"Contract ID associated with the dissemination","example":"2d17"},"objectId":{"type":"string","description":"Object ID (original name) of the disseminated content","example":"digifoto_5584a028-ba43-4ecb-bb67-7663cc802010"},"sumSizeInBytes":{"type":"integer","format":"int64","description":"Total size of the disseminated content in bytes","example":123456},"status":{"type":"string","description":"Status of the dissemination","enum":["RECEIVED","QUEUED","DOWNLOADING_FROM_REPOSITORY","FIXITY_CHECK","UPLOADING_TO_S3","DISSEMINATED","FAILED","REJECTED"],"example":"FIXITY_CHECK"},"priority":{"type":"integer","format":"int32","description":"Priority of the dissemination","example":50},"dateCreated":{"type":"string","format":"date-time","description":"Date when the dissemination was created","example":"2025-09-09T12:34:56.123456+01:00"}},"required":["archiveId","disseminationId","status"]},"GenerateDownloadUrlRequest":{"type":"object","properties":{"s3FilePath":{"type":"string","description":"S3 file path to generate download URL for","example":"client123/4eaf/submission456/document.pdf","minLength":1},"expiresInHours":{"type":"integer","format":"int32","description":"Number of hours until the URL expires. If not provided, uses the default configured value.","example":2,"minimum":1}},"required":["s3FilePath"]},"GenerateDownloadUrlResponse":{"type":"object","properties":{"downloadUrl":{"type":"string","description":"Presigned download URL for the S3 file","example":"https://bucket.s3.amazonaws.com/path/to/file.pdf?X-Amz-Algorithm=..."},"s3FilePath":{"type":"string","description":"The S3 file path that was requested","example":"clientid/contractid/05tlVc2iVpAAgl9ZYH4lER/representations/primary_20250325/data/bilde_1.jpg"},"expirationDate":{"type":"string","format":"date-time","description":"The exact date and time when the URL expires in ISO 8601 format with timezone","example":"2025-09-09T12:34:56.123456+01:00"}}},"AlternativeTitle":{"type":"object","description":"Represents a alternative title for a digital resource.","properties":{"type":{"type":"string","description":"Type of title","example":"originaltittel","minLength":1},"value":{"type":"string","description":"The alternative title","example":"Ola and Kari on fishing trip in Rondane","minLength":1},"lang":{"type":"string","description":"Language code (ISO 639-3).","example":"eng","pattern":"^[a-z]{3}$"}},"required":["type","value"]},"Authority":{"type":"object","description":"Represents a reference to an authority with source, code, and URI.","properties":{"source":{"type":"string","description":"Source for authority data.","example":"Felles autoritetsregister (BARE)","minLength":1},"code":{"type":"string","description":"Authority code.","example":90362181,"minLength":1},"uri":{"type":"string","description":"URI for the authority resource.","example":"https://bibsys-almaprimo.hosted.exlibrisgroup.com/permalink/f/nelpa2/AUTREG90362181","minLength":1}},"required":["code","source","uri"]},"Contributor":{"type":"object","properties":{"name":{"type":"string","description":"Contributor name","example":"Nordmann, Ola","minLength":1},"type":{"type":"string","description":"Contributor type","enum":["person","korporasjon","konferanse","standardtittel"],"example":"person"},"role":{"type":"string","description":"Contributor role","example":"avbildet"},"authority":{"$ref":"#/components/schemas/Authority","description":"Authority"}},"required":["name"]},"CreateSubmissionRequest":{"type":"object","description":"Metadata for the submission to be created","properties":{"objectId":{"type":"string","description":"Object identificator for the submission. The value must be unique within the contract.","example":"av_6e8bc430-9c3a11d9","pattern":"^[0-9a-zA-Z\\-_]{3,200}$"},"priority":{"type":"integer","format":"int32","default":50,"description":"Priority of the submission (1-100). Lower number means higher priority.","example":50,"maximum":100,"minimum":1},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Metadata for the submission."}},"required":["metadata","objectId"]},"Creator":{"type":"object","properties":{"name":{"type":"string","description":"Creator name","example":"Marek, Václav","minLength":1},"type":{"type":"string","description":"Creator type","enum":["person","korporasjon","konferanse","standardtittel"],"example":"person"},"role":{"type":"string","description":"Creator role","example":"fotograf"},"authority":{"$ref":"#/components/schemas/Authority","description":"Authority"}},"required":["name"]},"Description":{"type":"object","properties":{"value":{"type":"string","description":"Beskrivelse av ressursen.","example":"Bildet er en del av samlingen etter Václav Marek, der han fulgte Ola og Kari Nordmann Norge på langs. Václav Marek var en engelskmann som var interessert i Norge og norsk natur.","minLength":1},"lang":{"type":"string","description":"Språkkode (ISO 639-3).","example":"nob","minLength":1,"pattern":"^[a-z]{3}$"}},"required":["lang","value"]},"Identifier":{"type":"object","description":"Represents an identifier for a resource.","properties":{"type":{"type":"string","description":"Type of identifier","example":"URN","minLength":1},"value":{"type":"string","description":"The value of the identifier","example":"URN:NBN:no-nb_digifoto_20220311_00191_NB_PE_VM_M_05_09_01_036","minLength":1}},"required":["type","value"]},"Language":{"type":"object","description":"Language relevant to the resource.","properties":{"type":{"type":"string","description":"Language type","example":"undertekster","minLength":1},"value":{"type":"string","description":"Language code (ISO 639-3).","example":"nor","minLength":1,"pattern":"^[a-z]{3}$"}},"required":["type","value"]},"Metadata":{"type":"object","description":"Represents metadata for a digital resource based on Dublin Core Elements.","properties":{"type":{"type":"string","description":"Type of the resource.","enum":["Artikkel","Avis","Bok","Brev","Epost","Manuskript","Musikkmanuskript","Noter","Programrapport","Programstatistikk","Småtrykk","Tidsskrift","Lydbok","Musikk","Radio","Dokumentasjonslyd","Film","Fjernsyn","Bilde","Kart","Postkort","Plakat","Referansemateriale"],"example":"Bilde"},"identifier":{"type":"array","description":"List of identifiers for the resource.","items":{"$ref":"#/components/schemas/Identifier"},"minItems":1},"title":{"$ref":"#/components/schemas/Title","description":"Title of the resource."},"alternative":{"type":"array","description":"Alternative titles for the resource.","items":{"$ref":"#/components/schemas/AlternativeTitle"}},"creator":{"type":"array","description":"Creators of the resource.","items":{"$ref":"#/components/schemas/Creator"}},"contributor":{"type":"array","description":"Contributors to the resource.","items":{"$ref":"#/components/schemas/Contributor"}},"publisher":{"type":"array","description":"Publishers of the resource.","items":{"$ref":"#/components/schemas/Publisher"}},"spatial":{"type":"array","description":"Spatial characteristics of the resource.","items":{"$ref":"#/components/schemas/Spatial"}},"date":{"type":"array","description":"Relevant dates for the resource.","items":{"$ref":"#/components/schemas/MetadataDate"}},"language":{"type":"array","description":"Language used in the resource.","items":{"$ref":"#/components/schemas/Language"}},"relation":{"type":"array","description":"Describes a relationship where the current resource is part of another resource.","items":{"$ref":"#/components/schemas/Relation"}},"provenance":{"type":"array","description":"Information about the history of the resource.","items":{"$ref":"#/components/schemas/Provenance"}},"source":{"type":"array","description":"Source resources from which the described resource is derived.","items":{"$ref":"#/components/schemas/Source"}},"subject":{"type":"array","description":"Subject keywords for the resource.","items":{"$ref":"#/components/schemas/Subject"}},"description":{"type":"array","description":"Descriptions of the resource.","items":{"$ref":"#/components/schemas/Description"}}},"required":["identifier","title","type"]},"MetadataDate":{"type":"object","description":"Represents a date associated with an event in the lifecycle of the resource. The date value must conform to the ISO 8601 standard.","properties":{"type":{"type":"string","description":"Type of the date (e.g., 'created', 'modified', 'published').","example":"digitalisert","minLength":1},"value":{"type":"string","description":"The date value, conforming to ISO 8601-2 (e.g., '2023-10-27', '2023-10', '2023-10-27T10:30:00Z').","example":"2022-03-05T14:28:12+02:00","minLength":1}},"required":["type","value"]},"Provenance":{"type":"object","description":"Information about any changes that have an impact on the resource's authenticity, integrity and interpretation ","properties":{"value":{"type":"string","example":"Bildet er del av en digital samling, som ble donert til Nasjonalbiblioteket av Ola Nordmann 2025-01-01.","minLength":1},"lang":{"type":"string","description":"Language code (ISO 639-3).","example":"nor","pattern":"^[a-z]{3}$"}},"required":["value"]},"Publisher":{"type":"object","properties":{"name":{"type":"string","description":"Publisher name","example":"Nasjonalbiblioteket","minLength":1},"type":{"type":"string","description":"Publisher type","enum":["person","korporasjon","konferanse","standardtittel"],"example":"Korporasjon"},"authority":{"$ref":"#/components/schemas/Authority","description":"Authority"}},"required":["name"]},"Relation":{"type":"object","description":"A related resource in which the described resource is included.","properties":{"title":{"type":"string","example":"Norge på langs med Ola og Kari"},"type":{"type":"string","example":"IsPartOf","minLength":1},"id":{"type":"string","example":987654321},"uri":{"type":"string","description":"URI for the related resource.","example":"https://www.nb.no/items/eb57e3c314894b0120cf631104065e74?page"},"lang":{"type":"string","description":"Language code (ISO 639-3).","example":"nor","pattern":"^[a-z]{3}$"}},"required":["type"]},"Source":{"type":"object","description":"A source resource from which the described resource is derived.","properties":{"description":{"type":"string","description":"Description of the source resource.","example":"Hjelp vi flyr, U-matic HB videobånd"},"identifier":{"type":"array","description":"One or more identifiers for the source resource.","items":{"$ref":"#/components/schemas/Identifier"},"minItems":1},"uri":{"type":"string","description":"URI for the source resource.","example":"https://collections.nb.no/collections/link/xplus/audiovisualcatalogue/50979618"}},"required":["identifier"]},"Spatial":{"type":"object","description":"Represents a spatial location, including its name, authority, coordinates, and type.","properties":{"name":{"type":"string","description":"The name of the spatial location. Use ISO 3166-2 for specifying countries. Country codes should be placed in parentheses after the country name (e.g., Norway (NO)).","example":"Norge (NO);Innlandet;Stor-Elvdal;Rondane gjestegård","minLength":1},"type":{"type":"string","description":"Type of the spatial location.","example":"Avbildet sted"},"authority":{"$ref":"#/components/schemas/Authority","description":"Authority providing information about the spatial location. This now uses the AuthorityReference structure."},"coordinateReferenceSystem":{"type":"string","description":"The coordinate reference system used for latitude and longitude. Defaults to EPSG:4326 if not specified.","example":"EPSG:4326"},"latitude":{"type":"number","format":"double","description":"Latitude of the spatial location.","example":61.788453,"maximum":90.0,"minimum":-90.0},"longitude":{"type":"number","format":"double","description":"Longitude of the spatial location.","example":10.224725,"maximum":180.0,"minimum":-180.0}},"required":["name"]},"Subject":{"type":"object","description":"Representerer et emneord.","properties":{"value":{"type":"string","description":"Emneordet.","example":"rondane","minLength":1},"authority":{"$ref":"#/components/schemas/Authority","description":"Authority"}},"required":["value"]},"Title":{"type":"object","description":"Represents a localized value with a language code and optional type.","properties":{"value":{"type":"string","description":"The value.","example":"Ola og Kari på fisketur i Rondane","minLength":1},"lang":{"type":"string","description":"Language code (ISO 639-3).","example":"nor","pattern":"^[a-z]{3}$"}},"required":["value"]},"FileResponse":{"type":"object","properties":{"fileId":{"type":"string","description":"Unique identifier for the file in Base62 format - 22 characters. The ID is case-sensitive.","example":"1M0x4T9rN8Xc7B2Yq5L3zK","pattern":"^[0-9a-zA-Z]{22}$"},"filePath":{"type":"string","description":"Relative path of the file within the submission. The path must be unique within the submission.","example":"path/to/file.txt"},"s3ObjectKey":{"type":"string","description":"S3 object key for the file","example":"bucket/clientId/contract/submissionId/path/to/file.txt"},"checksum":{"type":"string","description":"Checksum for the file in MD5 format","pattern":"^[0-9a-f]{32}$"},"isPackaged":{"type":"boolean","description":"Indicates whether files are packaged temporarily for transmission purposes only. These files are packed to facilitate transfer and will be unpacked by the preservation flow.","example":false},"uploadUrl":{"type":"string","description":"URL for direct upload to S3"}},"required":["checksum","fileId","filePath","isPackaged","s3ObjectKey","uploadUrl"]},"SubmissionResponse":{"type":"object","properties":{"contractId":{"type":"string","readOnly":true},"submissionId":{"type":"string","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","example":"8Z7x1T9rN0Xc2B5Yq4L3zP","pattern":"^[0-9a-zA-Z]{22}$"},"objectId":{"type":"string","description":"Object identificator for the submission"},"clientId":{"type":"string","description":"Client ID from JWT authentication token"},"archiveId":{"type":"string","description":"Archive ID for the submission","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"status":{"type":"string","description":"Status of the submission","enum":["REGISTERED","UPLOAD_COMPLETED","PROCESSING","PRESERVED","REJECTED"]},"priority":{"type":"integer","format":"int32","description":"Priority of the submission","example":50},"sumSizeInBytes":{"type":"integer","format":"int64","description":"Total size of all files in the submission in bytes","example":123456},"message":{"type":"string","description":"Optional message (JSON or plain text)","example":{"key":"value"}},"files":{"type":"array","description":"List of files associated with the submission","items":{"$ref":"#/components/schemas/FileResponse"}}},"required":["objectId","status","submissionId"]},"UpdateSubmissionStatusRequest":{"type":"object","properties":{"message":{"type":"string","description":"Optional message (JSON or plain text)","example":"Validation failed: missing checksum"}}},"RegisterFileRequest":{"type":"object","description":"Request body for registering a new file","properties":{"filePath":{"type":"string","description":"Relative path of the file within the submission. The path must be unique within the submission. Max length: 900 characters. Must only contain -_.()/a-zA-Z0-9 and cannot start with '/' or '.'","example":"path/to/file.txt","maxLength":900,"minLength":0,"pattern":"^(?![/.])[a-zA-Z0-9æøåÆØÅ\\-_.()/]+$"},"checksum":{"type":"string","description":"Checksum for the file in MD5 format","pattern":"^[0-9a-f]{32}$"},"isPackaged":{"type":"boolean","default":false,"description":"Indicates whether files are packaged temporarily for transmission purposes only. These files are packed to facilitate transfer and will be unpacked by the preservation flow.","example":false}},"required":["checksum","filePath"]},"SubmitAgentDto":{"type":"object","description":"PREMIS Agent for submission requests - represents the entity that performed the event","properties":{"agentName":{"type":"string","description":"Name of the agent","example":"Audioinspector"},"agentNote":{"type":"string","description":"Additional notes about the agent","example":"Programvare for automatisk analyse, kvalitetskontroll, og metadatahåndtering av lydfiler."},"agentType":{"type":"string","description":"Type of agent (person, organization, software, hardware)","example":"software","minLength":1,"pattern":"^(person|organization|software|hardware)$"},"agentVersion":{"type":"string","description":"Version of the agent","example":5.5}},"required":["agentName","agentType"]},"SubmitEventDto":{"type":"object","description":"PREMIS Event and Agent data to submit","properties":{"agent":{"$ref":"#/components/schemas/SubmitAgentDto","description":"The PREMIS Agent associated with this event"},"eventDateTime":{"type":"string","format":"date-time","description":"Date and time when the event occurred","example":"2026-02-19T11:45:32.123+01:00"},"eventDetail":{"type":"string","description":"Additional information about the Event. eventDetail is not necessarily intended to be processed by machine. It may record any information about an Event and/or point to information stored elsewhere","example":"Wav-filer ble analysert for kvalitetskontroll og dokumentasjon."},"eventType":{"type":"string","description":"A categorization of the nature of the Event accepted for submission. Vocabulary from Library of Congress is used: http://id.loc.gov/vocabulary/preservation/eventType","enum":["capture","compression","creation","filename change","fixity check","information package creation","imaging","message digest calculation","metadata extraction","migration","transfer","validation","virus check"],"example":"metadata extraction"},"fileRef":{"$ref":"#/components/schemas/SubmitFileRefDto","description":"Reference to a specific file this event is associated with"},"outcome":{"type":"string","description":"Outcome of the event","example":"success","minLength":1,"pattern":"^(fail|success|warning)$"},"outcomeDetail":{"type":"string","description":"A detailed description of the result or product of the Event. This may be used to record all error and warning messages issued by a program involved in the Event or to record a pointer to an error log. If the Event was a validity check (e.g., profile conformance) any anomalies or quirks discovered would be recorded here.","example":"Utledet en XML-metadatafil som inneholder detaljert analyse: representations/primary20250325/metadata/technical/audioinspector/metadata.xml"},"isUserInitiated":{"type":"boolean","description":"Indicates whether the event was initiated by a user (true) or by an automated process/system (false). This field is automatically set to true for events submitted through the API.","example":true,"readOnly":true}},"required":["agent","eventDateTime","eventType","outcome"]},"SubmitFileRefDto":{"type":"object","description":"Reference to a file within the archive/object for submission requests","properties":{"relativePath":{"type":"string","description":"Relative path to the file within the archive","example":"representations/primary_20250325/data/iPRES2021_paper_38.pdf","minLength":1}},"required":["relativePath"]},"PageMetadata":{"type":"object","properties":{"size":{"type":"integer","format":"int64"},"number":{"type":"integer","format":"int64"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int64"}}},"PagedModelSubmissionResponse":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/SubmissionResponse"}},"page":{"$ref":"#/components/schemas/PageMetadata"}}},"PagedModelDisseminationResponse":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/DisseminationResponse"}},"page":{"$ref":"#/components/schemas/PageMetadata"}}},"AgentDto":{"type":"object","description":"PREMIS Agent - represents an entity associated with rights management and preservation events","properties":{"agentId":{"type":"string","description":"Unique identifier for the agent","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"agentName":{"type":"string","description":"Name of the agent","example":"Configurable Ingest Plugin"},"agentNote":{"type":"string","description":"Additional notes about the agent","example":"Performs all the tasks needed to ingest a SIP into the repository"},"agentType":{"type":"string","description":"Type of agent (person, organization, software, hardware)","example":"software","minLength":1,"pattern":"^(person|organization|software|hardware)$"},"agentVersion":{"type":"string","description":"Version of the agent","example":"1.0.0"}},"required":["agentName","agentType"]},"EventDto":{"type":"object","description":"PREMIS Event - represents a preservation event associated with digital objects","properties":{"eventId":{"type":"string","description":"Unique identifier for the event","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"eventDateTime":{"type":"string","format":"date-time","description":"Date and time when the event occurred","example":"2025-07-31T10:04:20.772Z"},"eventDetail":{"type":"string","description":"Additional information about the Event. eventDetail is not necessarily intended to be processed by machine. It may record any information about an Event and/or point to information stored elsewhere","example":"Checksum generated from tape copy in SAM-FS during migration to DPS"},"eventType":{"type":"string","description":"A categorization of the nature of the Event. Vocabulary from Library of Congress is used: http://id.loc.gov/vocabulary/preservation/eventType","enum":["accession","appraisal","capture","compiling","compression","creation","deaccession","decompression","decryption","deletion","digital signature generation","digital signature validation","displaying","dissemination","encryption","execution","exporting","extraction","filename change","fixity check","forensic feature analysis","format identification","imaging","information package creation","information package merging","information package splitting","ingestion","ingestion end","ingestion start","interpreting","message digest calculation","metadata extraction","metadata modification","migration","modification","normalization","packing","policy assignment","printing","quarantine","recovery","redaction","refreshment","rendering","replication","transfer","unpacking","unquarantine","validation","virus check"],"example":"message digest calculation"},"fileRef":{"$ref":"#/components/schemas/FileRefDto","description":"Reference to a specific file this event is associated with"},"outcome":{"type":"string","description":"Outcome of the event","example":"success","minLength":1,"pattern":"^(fail|success|warning)$"},"outcomeDetail":{"type":"string","description":"A detailed description of the result or product of the Event. This may be used to record all error and warning messages issued by a program involved in the Event or to record a pointer to an error log. If the Event was a validity check (e.g., profile conformance) any anomalies or quirks discovered would be recorded here.","example":"Filename changed from xxxxxx.mp4 to yyyyyy.mp4 due to invalid characters"},"isUserInitiated":{"type":"boolean","description":"Indicates whether the event was initiated by a user (true) or by an automated process/system (false). This field is automatically set to true for events submitted through the API.","example":true,"readOnly":true},"agent":{"$ref":"#/components/schemas/AgentDto","description":"The PREMIS Agent associated with this event. Populated when the metadata service embeds the full agent."}},"required":["eventDateTime","eventType","outcome"]},"FileRefDto":{"type":"object","description":"Reference to a file within the archive/object","properties":{"fileId":{"type":"string","description":"Unique identifier for the file","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"relativePath":{"type":"string","description":"Relative path to the file within the archive","example":"representations/primary_20250325/data/iPRES2021_paper_38.pdf"}}},"SubmissionDetailResponse":{"type":"object","description":"Detailed submission response with optional enrichment data","properties":{"contractId":{"type":"string","readOnly":true},"submissionId":{"type":"string","description":"Unique identifier for the submission in Base62 format - 22 characters. The ID is case-sensitive.","example":"8Z7x1T9rN0Xc2B5Yq4L3zP","pattern":"^[0-9a-zA-Z]{22}$"},"objectId":{"type":"string","description":"Object identificator for the submission"},"clientId":{"type":"string","description":"Client ID from JWT authentication token"},"archiveId":{"type":"string","description":"Archive ID for the submission","example":"019c7114-86fd-721c-b094-c0cfa4b39a43"},"status":{"type":"string","description":"Status of the submission","enum":["REGISTERED","UPLOAD_COMPLETED","PROCESSING","PRESERVED","REJECTED"]},"priority":{"type":"integer","format":"int32","description":"Priority of the submission","example":50},"sumSizeInBytes":{"type":"integer","format":"int64","description":"Total size of all files in the submission in bytes","example":123456},"files":{"type":"array","description":"List of files associated with the submission. Included when requested via ?include=FILES","items":{"$ref":"#/components/schemas/FileResponse"}},"metadata":{"$ref":"#/components/schemas/Metadata","description":"Descriptive metadata (Dublin Core) for the submission. Included when requested via ?include=DESCRIPTIVE_METADATA"},"events":{"type":"array","description":"PREMIS preservation events for the submission. Included when requested via ?include=EVENTS","items":{"$ref":"#/components/schemas/EventDto"}}},"required":["objectId","status","submissionId"]}},"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth2 Client Credentials Flow","flows":{"clientCredentials":{"tokenUrl":"https://www.nb.no/authn/realms/dps/protocol/openid-connect/token","scopes":{}}}}}}}