Skip to main content

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
MethodPATCH
URL or Endpoint/api/projects/projectId/settings
HeadersAuthorization
ParametersprojectId
BodyenforceUploadOwnership, encodeUploadedFilesOnly, uploadRequiresAuthor

The description of the URL parameter is as follows:

projectId URL Parameter
URL Parameter NameprojectId
MandatoryYes
Typestring
DescriptionUnique Id of the project.
Who can call it

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 NameMandatoryTypeDescription
enforceUploadOwnershipNobooleanWhen 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.
encodeUploadedFilesOnlyNobooleanWhen 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.
uploadRequiresAuthorNobooleanWhen 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.
note

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 NameTypeDescription
successboolIf the response is successful, it will return true. Otherwise, it will return false.
errorsarray[string]Indicates if there was an error.
messagesarray[string]Returns the response message from the back-end.
resultobjectThe current value of the three settings.
enforceUploadOwnershipboolCurrent value of the upload ownership check on encode.
encodeUploadedFilesOnlyboolCurrent value of the uploaded-files-only rule on encode.
uploadRequiresAuthorboolCurrent value of the author requirement on uploads.
resultInfostringReturns extra information about the result.
errorCodestringFixed, machine-readable code of a rejection, or null.
statusCodeinteger($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.execute permission 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 enforceUploadOwnership could not be refreshed. Send the same request again.

  • HTTP Status Code 503: Backend Fetch Failed