Cocktail Studio API Reference
Cocktail Studio is an API-based service that empowers you to effortlessly generate images and videos programmatically. Here's how it works:

  1. We integrate custom templates into your Cocktail Studio account.
  2. We transform your templates into a powerful API.
  3. You harness the potential of this API to create stunning images and videos effortlessly.

BASE URL: 
https://create.cocktailstudio.io/api


Authentication
Cocktail Studio is an API-based service that empowers you to effortlessly generate images and videos programmatically. Here's how it works:

  1. We integrate custom templates into your Cocktail Studio account.
  2. We transform your templates into a powerful API.
  3. You harness the potential of this API to create stunning images and videos effortlessly.

ENDPOINT: 
GET "https://create.cocktailstudio.io/api/auth"

REQUEST:
{
  "email": "youremail@meail.com"
}

RESPONSE:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
}

Account
Cocktail Studio is an API-based service that empowers you to effortlessly generate images and videos programmatically. Here's how it works:

  1. We integrate custom templates into your Cocktail Studio account.
  2. We transform your templates into a powerful API.
  3. You harness the potential of this API to create stunning images and videos effortlessly.

ENDPOINT: 
GET "https://create.cocktailstudio.io/api/userinfo"

RESPONSE:
{
  "creditPackage": 1000,
  "email": "youremail@email.com",
  "creditUsage": 376,
  "type": "Standart Plan"
}

Image
Cocktail Studio is an API-based service that empowers you to effortlessly generate images and videos programmatically. Here's how it works:

  1. We integrate custom templates into your Cocktail Studio account.
  2. We transform your templates into a powerful API.
  3. You harness the potential of this API to create stunning images and videos effortlessly.

ENDPOINT: 
POST "https://create.cocktailstudio.io/api/job/image"

REQUEST:
{
    "templateId" : 1111,
    "assets" : [
        { "layerName": "title", "value": "pink sweater" },
        { "layerName": "price", "value": "$19.90" },
        { "layerName": "image", "value": "https://img.freepik.com/pretty-modern-woman.png" },
        { "layerName": "color", "value": "#21243b" },
    ]
}

RESPONSE:
{
    "message": "Success! The POST request was processed successfully.",
    "jobId": "a7dd599d-c245-4ec7-ad89-529fb051b8a7"
}

Video
Cocktail Studio is an API-based service that empowers you to effortlessly generate images and videos programmatically. Here's how it works:

  1. We integrate custom templates into your Cocktail Studio account.
  2. We transform your templates into a powerful API.
  3. You harness the potential of this API to create stunning images and videos effortlessly.

ENDPOINT: 
POST "https://create.cocktailstudio.io/api/job/video"

REQUEST:
{
    "templateId" : 1111,
    "assets" : [
        { "layerName": "title", "value": "pink sweater" },
        { "layerName": "price", "value": "$19.90" },
        { "layerName": "image", "value": "https://img.freepik.com/pretty-modern-woman.png" },
        { "layerName": "color", "value": "#21243b" },
    ]
}

RESPONSE:
{
    "message": "Success! The POST request was processed successfully.",
    "jobId": "a7dd599d-c245-4ec7-ad89-529fb051b8a7"
}

Sample request
To create dynamic content, you need to send a well-structured request. Here's what you need to know:
Request Method: POST
Required Parameters:
  • templateId: This unique identifier specifies the template you want to use for content generation.
  • assets: A JSON array containing key-value pairs representing the assets required for the template.
Additional Requirement:
  • token: To ensure secure access, include an authentication token in your request headers.
Important Notes:
  • Ensure that both templateId and assets are provided in your request. Omitting either of these will result in a failed API request.
  • You can find the templateId and sample JSON structure for assets in your dashboard. Simply select the desired template in the API console to access these details.

const data = {
    "templateId" : 1111,
    "assets" : [
        { "layerName": "title", "value": "pink sweater" },
        { "layerName": "price", "value": "$19.90" },
        { "layerName": "image", "value": "https://img.freepik.com/pretty-modern-woman.png" },
        { "layerName": "color", "value": "#21243b" },
    ]
}


fetch('https://create.cocktailstudio.io/api/job/image', {
  method: 'POST',
  body: JSON.stringify(data),
  headers: {
    'Content-Type' : 'application/json',
    'Authorization' : `Bearer ${token}`
  }
})


JOBS
To create dynamic content, you need to send a well-structured request. Here's what you need to know:
Request Method: POST
Required Parameters:
  • templateId: This unique identifier specifies the template you want to use for content generation.
  • assets: A JSON array containing key-value pairs representing the assets required for the template.
Additional Requirement:
  • token: To ensure secure access, include an authentication token in your request headers.
Important Notes:
  • Ensure that both templateId and assets are provided in your request. Omitting either of these will result in a failed API request.
  • You can find the templateId and sample JSON structure for assets in your dashboard. Simply select the desired template in the API console to access these details.

const data = {
    "templateId" : 1111,
    "assets" : [
        { "layerName": "title", "value": "pink sweater" },
        { "layerName": "price", "value": "$19.90" },
        { "layerName": "image", "value": "https://img.freepik.com/pretty-modern-woman.png" },
        { "layerName": "color", "value": "#21243b" },
    ]
}


fetch('https://create.cocktailstudio.io/api/job/image', {
  method: 'POST',
  body: JSON.stringify(data),
  headers: {
    'Content-Type' : 'application/json',
    'Authorization' : `Bearer ${token}`
  }
})