# Upload a document to a control. Uploads a file to the user's storage provider from S3 after the user has uploaded the file to S3 using the presigned URL from GET /controls/{id}/upload-url/{period}. The file will be associated with the specified control and period. Endpoint: POST /api/v1/controls/{id}/documents Version: 1.0.0 Security: x-api-key ## Path parameters: - `id` (string, required) The internal unique identifier for the control Example: "61d325c84a9f97631731a690" ## Request fields (application/json): - `fileName` (string, required) Name of the file to be uploaded Example: "uploaded-using-api-prod.xlsx" - `fileKey` (string, required) S3 key of the uploaded file. This is returned from the GET /controls/{id}/upload-url/{period} endpoint Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `period` (object, required) - `period.month` (string) Enum: "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" - `period.year` (string) four-digit year Example: "2020" ## Response 400 fields (application/json): - `message` (string) Reason for the errors related to incorrect query keys or values that are out of bound Example: "filter[month] is required" - `name` (string) BadRequest Example: "BadRequest" - `status` (integer) The HTTP status code. Example: 400 ## Response 401 fields (application/json): - `message` (string) Reason for the unauthorized error. Example: "Token is invalid." - `name` (string) Unauthorized Example: "Unauthorized" - `status` (integer) The HTTP status code. Example: 401 ## Response 403 fields (application/json): - `message` (string) Reason for the forbidden error. Example: "User does not have permission to access requested project." - `name` (string) Forbidden Example: "Forbidden" - `status` (integer) The HTTP status code. Example: 403 ## Response 404 fields (application/json): - `message` (string) Description of the missing resource or reason for the 404 error. Example: "Resource not found." - `name` (string) NotFound Example: "NotFound" - `status` (integer) The HTTP status code. Example: 404 ## Response 413 fields (application/json): - `message` (string) Response size is greater than 1MB Example: "Payload too large." - `name` (string) PayloadTooLarge Example: "PayloadTooLarge" - `status` (integer) The HTTP status code. Example: 413 ## Response 500 fields (application/json): - `message` (string) Reason for the internal server error. Example: "An unexpected error occurred." - `name` (string) InternalServerError Example: "InternalServerError" - `status` (integer) The HTTP status code. Example: 500