Create Preset
This endpoint allows you to create a new preset configuration in the system. The preset can include various settings, multimedia assets, and can be associated with products.
πΉ Endpoint Detailsβ
POST /api/v1/presets
π Authenticationβ
Header | Required | Description |
---|---|---|
Content-Type | Yes | Must be application/json |
Authorization | Yes | Format: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature |
π Request Bodyβ
Field | Type | Required | Description |
---|---|---|---|
title | string | Yes | The title of the preset |
description | string | No | A detailed description of the preset |
logo | string | No | URL or path to the preset logo |
image | string | No | URL or path to the preset cover image |
assetIds | array of strings | No | Array of existing multimedia asset IDs to associate with this preset |
assets | array of objects | No | Array of new multimedia assets to create along with this preset |
products | array of strings | No | Array of product identifiers to associate with this preset |
effectId | string | No | ID of the effect to be applied to this preset |
π€ Request Exampleβ
curl -X POST "https://openapi.onlive.site/api/v1/presets" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"title": "My Custom Preset",
"description": "This preset contains settings for video streaming",
"logo": "https://example.com/logo.png",
"image": "https://example.com/cover.png",
"assetIds": [
"123e4567-e89b-12d3-a456-426614174000"
],
"assets": [
{
"name": "string",
"app": {
"source": {
"url": "string",
"security": "string"
},
"resource": "string",
"args": "string"
},
"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 (201 Created)β
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the newly created preset |
organizationId | string | Organization ID that owns this preset |
title | string | The title of the preset |
description | string | A detailed description of the preset |
logo | string | URL to the preset logo |
image | string | URL to the preset cover image |
assets | array of strings | IDs of multimedia assets associated with this preset |
products | array of strings | Product identifiers associated with this preset |
effectId | string | ID of the effect applied to this preset |
createdAt | string (ISO 8601) | Creation timestamp |
updatedAt | string (ISO 8601) | Last update timestamp |
Response Exampleβ
{
"id": "123e4567-e89b-12d3-a456-426614174001",
"organizationId": "123e4567-e89b-12d3-a456-426614174002",
"title": "My Custom Preset",
"description": "This preset contains settings for video streaming",
"logo": "https://example.com/logo.png",
"image": "https://example.com/cover.png",
"assets": [
"123e4567-e89b-12d3-a456-426614174003",
"123e4567-e89b-12d3-a456-426614174004"
],
"products": ["product1", "product2"],
"effectId": "effect123",
"createdAt": "2025-05-28T10:15:30Z",
"updatedAt": "2025-05-28T10:15:30Z"
}
β 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 create presets"
}
409 Conflictβ
{
"statusCode": 409,
"message": "A preset with the title 'My Custom Preset' already exists",
"error": "Conflict"
}
π Validation Rulesβ
-
Title Validation
- Title must not be empty
- Title must be unique within your organization
- Maximum length is 255 characters
-
Asset Validation
- Asset references must be valid UUIDs
- Assets must be accessible by your organization
- New assets must comply with multimedia format requirements
-
Product Validation
- Product references must be valid
- Products must be accessible by your organization
- Maximum 50 products per preset
-
Effect Validation
- Effect ID must reference a valid effect
- Effect must be compatible with the associated assets
π‘ Best Practicesβ
-
Resource Management
- Use descriptive titles for easier identification
- Group related assets within a single preset
- Add detailed descriptions for better organization
-
Asset Handling
- Reference existing assets when possible instead of creating duplicates
- Optimize multimedia assets before association
- Consider asset compatibility with target platforms
-
Organization
- Use consistent naming conventions
- Associate presets with appropriate products
- Document preset purpose and usage scenarios
π Notesβ
- The
organizationId
is automatically set from your authentication credentials - Asset references can be provided either via
assetIds
or by creating new assets inline - All multimedia assets created with a preset will be automatically associated with it
- You must have the appropriate permissions to create presets in your organization
- The unique constraint for preset titles is scoped to your organization
β Common Use Casesβ
- π¨ Media Configuration: Setting up preset configurations for multimedia assets
- π Product Association: Linking presets with specific products
- π¬ Effect Application: Adding visual effects to multimedia content
- π§© Template Creation: Creating reusable templates for content creation
- π Resource Organization: Organizing related multimedia assets