Saltar al contenido principal

Update Preset

This endpoint allows you to update an existing preset's details. Only the fields you provide will be modified, while others remain unchanged.

🔹 Endpoint Details

PUT /api/v1/presets/{presetId}

🔒 Authentication

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesFormat: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature

📝 Path Parameters

ParameterTypeRequiredDescription
presetIdstringYesID of the preset to update

📝 Updatable Fields

FieldTypeDescriptionExample
titlestringTitle of the preset"Updated Streaming Preset"
descriptionstringDetailed description"Enhanced preset for video streaming"
logostringURL to preset logo"https://example.com/new-logo.png"
imagestringURL to preset cover image"https://example.com/new-cover.png"
assetIdsarray of stringsIDs of existing assets["123e4567-e89b-12d3-a456-426614174003"]
assetsarray of objectsNew assets to createSee example
productsarray of stringsProduct identifiers["product1", "product2"]
effectIdstringID of effect"effect123"

🧩 Request Example

curl -X PUT "https://openapi.onlive.site/api/v1/presets/123e4567-e89b-12d3-a456-426614174001" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"title": "Updated Streaming Preset",
"description": "Enhanced preset for video streaming",
"logo": "https://example.com/new-logo.png",
"image": "https://example.com/new-cover.png",
"assetIds": [
"123e4567-e89b-12d3-a456-426614174003"
],
"assets": [
{
"name": "New Asset",
"app": {
"source": {
"url": "https://example.com/app-source",
"security": "token"
},
"resource": "resource-id",
"args": "app-arguments"
},
"url": "string",
"format": "string",
"description": "string",
"size": 0,
"duration": 0,
"status": "string",
"environment": {},
"coverVideo": {
"id": "string",
"url": "string",
"size": 0,
"format": "string",
"duration": 0
},
"options": {
"usePixelStreaming": true,
"timeout": 0,
"showBooking": true,
"showRegister": true
}
}
],
"products": [
"product1",
"product2"
],
"effectId": "effect123"
}'

📥 Response

Success Response (200 OK)

FieldTypeDescription
idstringUnique identifier for the preset
organizationIdstringOrganization ID that owns this preset
titlestringThe title of the preset
descriptionstringA detailed description of the preset
logostringURL to the preset logo
imagestringURL to the preset cover image
assetsarray of stringsIDs of multimedia assets associated with this preset
productsarray of stringsProduct identifiers associated with this preset
effectIdstringID of the effect applied to this preset
createdAtstring (ISO 8601)Creation timestamp
updatedAtstring (ISO 8601)Last update timestamp

Response Example

{
"id": "123e4567-e89b-12d3-a456-426614174001",
"organizationId": "123e4567-e89b-12d3-a456-426614174002",
"title": "Updated Streaming Preset",
"description": "Enhanced preset for video streaming",
"logo": "https://example.com/new-logo.png",
"image": "https://example.com/new-cover.png",
"assets": [
"123e4567-e89b-12d3-a456-426614174003",
"123e4567-e89b-12d3-a456-426614174007"
],
"products": ["product1", "product2"],
"effectId": "effect123",
"createdAt": "2025-05-28T10:15:30Z",
"updatedAt": "2025-05-28T11:22:45Z"
}

❌ Error Responses

400 Bad Request

{
"statusCode": 400,
"message": "Invalid input",
"errors": [
{
"field": "title",
"message": "title must not be empty"
}
]
}

401 Unauthorized

{
"statusCode": 401,
"message": "Unauthorized access",
"error": "Unauthorized"
}

403 Forbidden

{
"statusCode": 403,
"message": "Insufficient permissions to update this preset"
}

404 Not Found

{
"statusCode": 404,
"message": "Preset not found",
"error": "Not Found"
}

409 Conflict

{
"statusCode": 409,
"message": "A preset with the title 'Updated Streaming Preset' already exists",
"error": "Conflict"
}

🔍 Validation Rules

  1. Title Validation

    • Title must not be empty if provided
    • Title must be unique within your organization
    • Maximum length is 255 characters
  2. Asset Updates

    • New asset references must be valid UUIDs
    • Assets must be accessible by your organization
    • New assets must comply with multimedia format requirements
  3. Product Updates

    • Product references must be valid
    • Products must be accessible by your organization
  4. Effect Updates

    • Effect ID must reference a valid effect
    • Effect must be compatible with the associated assets

✅ Common Use Cases

  • 🔄 Configuration Updates: Modify preset settings as requirements change
  • 🎮 Effect Changes: Apply different visual effects to preset assets
  • 🔗 Product Association: Update linked products for marketing or distribution
  • 📝 Metadata Updates: Keep preset descriptions and titles current
  • 🖼️ Visual Refresh: Update logos and cover images

💡 Best Practices

  1. Update Strategy

    • Only include fields that need to be updated
    • Test updated presets before deploying to production
  2. Asset Management

    • Maintain asset relationships when updating presets
    • Consider impact on dependent systems when changing assets
  3. Documentation

    • Document the reason for significant updates
    • Keep track of major version changes
    • Notify dependent systems about breaking changes

📘 Notes

  • Only the fields included in the request will be updated
  • Omitted fields retain their current values
  • The updatedAt timestamp is automatically updated
  • When updating assets, you can add new assets or reference existing ones
  • To remove assets, don't include them in the assetIds array
  • You must have the appropriate permissions to update the preset
  • The unique constraint for preset titles is scoped to your organization