PATCH Project Settings
Overview
The following table contains important information about the PATCH method in regards to changing the upload and encode settings of a project.
| PATCH Project Settings | |
|---|---|
| Method | PATCH |
| URL or Endpoint | /api/projects/projectId/settings |
| Headers | Authorization |
| Parameters | projectId |
| Body | enforceUploadOwnership, encodeUploadedFilesOnly, uploadRequiresAuthor |
The description of the URL parameter is as follows:
projectId URL Parameter | |
|---|---|
| URL Parameter Name | projectId |
| Mandatory | Yes |
| Type | string |
| Description | Unique Id of the project. |
The caller needs the project.execute permission on the project: project admins and organization owners. An API key whose user has that role can call it as well.
Request Body
{
"enforceUploadOwnership": true,
"encodeUploadedFilesOnly": false,
"uploadRequiresAuthor": false
}
Every property is optional. A property that is omitted is left unchanged; a property that is sent is applied. Send only what you want to change. A body with none of the three properties is rejected with 400 Bad Request.
| Body Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
| enforceUploadOwnership | No | boolean | When true, an encode or re-encode request (video or audio) that references an upload must carry the author stored on that upload; a mismatch, a missing author or an unknown reference is rejected with 403 UPLOAD_AUTHOR_MISMATCH. Duplicate checks on uploads and encodes then match only records with the same author. See POST Video. |
| encodeUploadedFilesOnly | No | boolean | When true, encodes and re-encodes (video or audio) accept only files uploaded through the Upload API. A downloadUrl that is neither a request key nor a VP upload URL is rejected with 400 UPLOAD_REFERENCE_REQUIRED; a reference that does not resolve to one of this project's uploads (for example another project's upload) is rejected as an unknown reference (400 with a descriptive message, or 403 UPLOAD_AUTHOR_MISMATCH when enforceUploadOwnership is on). See POST Video. |
| uploadRequiresAuthor | No | boolean | When true, POST Presigned URL to Upload File and POST Multipart Upload must carry an author; a request without one is rejected with 400 UPLOAD_AUTHOR_REQUIRED. Existing uploads, resume, complete and abort are not affected. |
All three settings are off for every project until they are switched on here. They take effect on the next request, no restart needed. Internal operations of the platform (for example converting a livestream to a video, or cutting a video) are not affected by any of them.
Response
If the action is successful, the service sends back an HTTP 200 response with the current value of all three settings, including the ones that were not sent.
{
"success": true,
"errors": [],
"messages": [],
"result": {
"enforceUploadOwnership": true,
"encodeUploadedFilesOnly": false,
"uploadRequiresAuthor": false
},
"resultInfo": null,
"errorCode": null,
"statusCode": 200
}
| Parameter Name | Type | Description |
|---|---|---|
| success | bool | If the response is successful, it will return true. Otherwise, it will return false. |
| errors | array[string] | Indicates if there was an error. |
| messages | array[string] | Returns the response message from the back-end. |
| result | object | The current value of the three settings. |
| enforceUploadOwnership | bool | Current value of the upload ownership check on encode. |
| encodeUploadedFilesOnly | bool | Current value of the uploaded-files-only rule on encode. |
| uploadRequiresAuthor | bool | Current value of the author requirement on uploads. |
| resultInfo | string | Returns extra information about the result. |
| errorCode | string | Fixed, machine-readable code of a rejection, or null. |
| statusCode | integer($int32) | Returns the HTTP Status Code. |
The same three values are returned read-only on GET Project by ID.
Errors
For information about the errors that are common to all actions, see Common Errors:
HTTP Status Code 400: Bad Request
Returned when none of the three properties is sent:
{
"success": false,
"errors": ["Send at least one setting to change: enforceUploadOwnership, encodeUploadedFilesOnly or uploadRequiresAuthor."],
"messages": [],
"result": null,
"resultInfo": null,
"errorCode": null,
"statusCode": 400
}
HTTP Status Code 401: Unauthorized
HTTP Status Code 403: Forbidden
The caller does not have the
project.executepermission on the project.HTTP Status Code 404: Result Not Found
HTTP Status Code 500: Internal Server Error
The settings were saved but the cache that serves
enforceUploadOwnershipcould not be refreshed. Send the same request again.HTTP Status Code 503: Backend Fetch Failed