# Pictory Integration via LowCodeAPI

## Overview

Pictory is an AI-powered video generation platform that enables users to create videos from text, images, and scripts. The Pictory API provides comprehensive capabilities for:

- **Video Generation** - Create videos from scripts with AI-powered scene generation
- **Video Summary** - Generate concise summaries of long-form video content
- **Transcription** - Convert video audio to text with automatic transcription
- **Template Management** - Create reusable video templates for bulk generation
- **Voiceover Management** - Manage text-to-speech voiceover tracks
- **Brand Management** - Create and manage brand kits for consistent video styling

## Base Endpoint

```
https://api.lowcodeapi.com/pictory/
```

## Authentication

LowCodeAPI handles authentication automatically using API Key authentication. You only need to:

1. **Sign up** at [Pictory](https://pictory.ai) to get your API Key
2. **Connect your account** in the LowCodeAPI dashboard
3. **Use your `api_token`** in all requests

The `api_token` is your LowCodeAPI authentication token. LowCodeAPI will automatically:
- Fetch your Pictory API key
- Apply it to each request

**Auth Type**: API Key (Bearer Token)

## API Categories

- **Video Generation AI** - AI-powered video creation and editing

## Common Endpoints

### Category: Video Generation API

#### Storyboard

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/video/storyboard`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/storyboard?api_token={api_token}
```

**Description**: Create a video preview from text, audio, or video. This is the first step in the video generation workflow.

**Request Body**:
```json
{
  "videoName": "My Video",
  "videoDescription": "A sample video",
  "language": "en-US",
  "scenes": [
    {
      "sceneText": "Welcome to our video",
      "sceneDuration": 5,
      "imageKeywords": "business, office"
    }
  ],
  "audio": {
    "backgroundMusic": true,
    "volume": 0.5
  },
  "brandLogo": {
    "logoUrl": "https://example.com/logo.png",
    "position": "top-right"
  },
  "webhook": "https://example.com/webhook"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `videoName` | string | No | Name of the output video file (valid text string) |
| `videoDescription` | string | No | Description of the video |
| `language` | string | No | Pictory API supports 8 languages |
| `scenes` | array | No | Array of scene objects for the video |
| `audio` | object | No | Audio settings for the video |
| `brandLogo` | object | No | Brand logo configuration |
| `videoWidth` | string | No | Width of video resolution |
| `videoHeight` | string | No | Height of video resolution |
| `autoHighlightKeywords` | boolean | No | Highlight keywords in subtitle text |
| `webhook` | string | No | Callback URL for storyboard job completion |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/storyboard?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoName": "Product Demo",
    "scenes": [{
      "sceneText": "Introducing our new product",
      "sceneDuration": 5
    }]
  }'
```

**Official Documentation**: [Storyboard API](https://docs.pictory.ai/reference/storyboard-api)

---

#### Render Video

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/video/render`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/render?api_token={api_token}
```

**Description**: Generate a downloadable video link. This is an asynchronous REST API.

**Request Body**:
```json
{
  "audio": {
    "backgroundMusic": true,
    "volume": 0.5
  },
  "output": {
    "format": "mp4",
    "quality": "1080p"
  },
  "scenes": [
    {
      "sceneId": "scene_001",
      "renderSettings": {
        "transition": "fade",
        "duration": 2
      }
    }
  ],
  "webhook": "https://example.com/webhook",
  "containsTextToImage": false,
  "next_generation_video": false
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `audio` | object | No | The audio settings to be used |
| `output` | object | No | The output settings of the video |
| `scenes` | array | No | Rendering parameters for each scene |
| `webhook` | string | No | Callback URL where render completion response is sent |
| `containsTextToImage` | boolean | No | Whether video contains text-to-image generated content |
| `next_generation_video` | boolean | No | Enable next generation video features |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/render?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": {"backgroundMusic": true},
    "output": {"format": "mp4"},
    "webhook": "https://example.com/webhook"
  }'
```

**Official Documentation**: [Video Rendering API](https://docs.pictory.ai/reference/video-rendering-api)

---

#### Render Video (PUT)

**Method**: `PUT` | **LowCodeAPI Path**: `/pictoryapis/v1/video/render/job_id`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/render/job_id?job_id={job_id}&api_token={api_token}
```

**Description**: Request video generation using a job ID from storyboard API.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `job_id` | string | Yes | Job ID obtained from Storyboard API to generate the video |

**Request Body**:
```json
{
  "webhook": "https://example.com/webhook"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `webhook` | string | No | The callback URL where render job completion response is sent |

**Example Request**:
```bash
curl -X PUT "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/render/job_id?job_id=abc123&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"webhook": "https://example.com/webhook"}'
```

**Official Documentation**: [Render Video](https://docs.pictory.ai/reference/render-video)

---

### Category: Video Summary and Transcription API

#### Transcription API

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v2/transcription`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription?api_token={api_token}
```

**Description**: Transcribe audio from a video file.

**Request Body**:
```json
{
  "fileUrl": "https://example.com/video.mp4",
  "language": "en-US",
  "webhook": "https://example.com/webhook",
  "mediaType": "video",
  "highlight": [
    {
      "start": 0,
      "end": 30,
      "text": "Introduction"
    }
  ],
  "transcript": []
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fileUrl` | string | No | Public URL of the video file (must be accessible) |
| `webhook` | string | No | Webhook URL where transcription API response is sent |
| `language` | string | No | Audio language used in video file |
| `highlight` | array | No | Array of highlight objects |
| `mediaType` | string | No | Value should be "video" |
| `transcript` | array | No | Transcript array |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fileUrl": "https://example.com/video.mp4",
    "language": "en-US"
  }'
```

**Official Documentation**: [Transcription API](https://docs.pictory.ai/reference/transcription-api)

---

#### Video-Summary

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v2/transcription/highlights`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription/highlights?api_token={api_token}
```

**Description**: Generate a concise summary of video content.

**Request Body**:
```json
{
  "webhook": "https://example.com/webhook",
  "transcript": [
    {
      "text": "Video transcript text here",
      "start": 0,
      "end": 5
    }
  ],
  "highlight_duration": 60
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `webhook` | string | No | Webhook URL where text-summary object needs to be posted |
| `transcript` | array | No | Array of transcript objects |
| `highlight_duration` | number | No | Duration of video summary required (in seconds) |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription/highlights?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript": [{"text": "Sample transcript", "start": 0, "end": 5}],
    "highlight_duration": 30
  }'
```

**Official Documentation**: [Video Summary](https://docs.pictory.ai/reference/text-summary-of-video)

---

### Category: Bulk Video Generation

#### Create Template API

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/templates`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token={api_token}
```

**Description**: Create a reusable video template from a .pictai file.

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `pictoryprojectfile` | file | Yes | .pictai file downloaded from the Pictory web app |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token=YOUR_API_TOKEN" \
  -F "[email protected]"
```

**Official Documentation**: [Create Template](https://docs.pictory.ai/reference/create-template-api)

---

#### Template Video-Preview API

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/video/from-template`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/from-template?api_token={api_token}
```

**Description**: Generate a video preview from a template with custom variables.

**Request Body**:
```json
{
  "Authorization": "your-access-token",
  "X-Pictory-User-Id": "user-identifier"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `Authorization` | string | No | Access token obtained from authentication |
| `X-Pictory-User-Id` | string | No | End user identification in your system |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/from-template?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "Authorization": "your-token",
    "X-Pictory-User-Id": "customer-123"
  }'
```

**Official Documentation**: [Template Preview](https://docs.pictory.ai/reference/update-variable-api)

---

#### Get All Template API

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/templates`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token={api_token}
```

**Description**: Get all created templates associated with your account.

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get Templates](https://docs.pictory.ai/reference/get-template-api)

---

#### Get Template by Id

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/templates/templateid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid={templateid}&api_token={api_token}
```

**Description**: Retrieve a specific template by ID.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `templateid` | string | Yes | The ID of the template to retrieve |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid=tmpl_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get Template by ID](https://docs.pictory.ai/reference/get-template-by-id)

---

#### Update Template API

**Method**: `PUT` | **LowCodeAPI Path**: `/pictoryapis/v1/templates/templateid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid={templateid}&api_token={api_token}
```

**Description**: Update the template scene object.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `templateid` | string | Yes | Template ID for which scene object needs to be updated |

**Request Body**:
```json
{
  "scenes": [
    {
      "sceneText": "Updated text",
      "sceneDuration": 5
    }
  ]
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `scenes` | array | No | Array of scene objects to update |

**Example Request**:
```bash
curl -X PUT "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid=tmpl_123&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scenes": [{"sceneText": "New text"}]}'
```

**Official Documentation**: [Update Template](https://docs.pictory.ai/reference/update-template-api-1)

---

#### Delete Template by Id

**Method**: `DELETE` | **LowCodeAPI Path**: `/pictoryapis/v1/templates/templateid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid={templateid}&api_token={api_token}
```

**Description**: Delete a template by ID.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `templateid` | string | Yes | The ID of the template to delete |

**Example Request**:
```bash
curl -X DELETE "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates/templateid?templateid=tmpl_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Delete Template](https://docs.pictory.ai/reference/delete-template-by-id)

---

### Category: VoiceOvers API

#### Get voiceover tracks

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/voiceovers/tracks`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/voiceovers/tracks?api_token={api_token}
```

**Description**: Retrieve a list of voiceover tracks with their metadata.

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/voiceovers/tracks?api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get Voiceover Tracks](https://docs.pictory.ai/reference/getvoiceovertracks)

---

#### Add a new voiceover track

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/voiceovers/tracks`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/voiceovers/tracks?api_token={api_token}
```

**Description**: Add a new text-to-speech voiceover track.

**Request Body**:
```json
{
  "name": "Professional Voice",
  "age": "adult",
  "gender": "female",
  "language": "en-US",
  "accent": "american",
  "service": "elevenlabs",
  "engine": "elevenlabs",
  "voiceId": "your-voice-id",
  "sample": "https://example.com/sample.mp3",
  "description": "Professional narration voice",
  "publicUserId": "user-public-id"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Name of the voiceover track |
| `age` | string | Yes | Age of the voiceover artist |
| `accent` | string | Yes | Accent of the voiceover |
| `engine` | string | Yes | Engine used for the voiceover |
| `gender` | string | Yes | Gender of the voiceover artist |
| `service` | string | Yes | Service providing the voiceover |
| `voiceId` | string | Yes | ElevenLabs voice ID to use |
| `language` | string | Yes | Language code of the voiceover |
| `sample` | string | No | URL to the sample voiceover |
| `description` | string | No | Description of the voiceover track |
| `publicUserId` | string | No | Public user ID for sharing voice from ElevenLabs |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/voiceovers/tracks?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Narrator Voice",
    "age": "adult",
    "gender": "male",
    "language": "en-US",
    "accent": "american",
    "service": "elevenlabs",
    "engine": "elevenlabs",
    "voiceId": "voice-123"
  }'
```

**Official Documentation**: [Add Voiceover Track](https://docs.pictory.ai/reference/addvoiceovertrack)

---

### Category: Private AWS Connections API

#### Create a new AWS connection

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/awsconnections`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections?api_token={api_token}
```

**Description**: Create a new AWS connection to access private S3 assets.

**Request Body**:
```json
{
  "name": "My AWS Connection",
  "enabled": true,
  "awsRegion": "us-east-1",
  "awsAccountId": "123456789012",
  "description": "Connection for private assets"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | The name of the AWS connection |
| `enabled` | boolean | Yes | Whether the connection is enabled |
| `awsRegion` | string | Yes | The AWS region (e.g., us-east-1) |
| `awsAccountId` | string | Yes | The AWS account ID (12-digit numeric string) |
| `description` | string | No | The description of the AWS connection |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production AWS",
    "enabled": true,
    "awsRegion": "us-west-2",
    "awsAccountId": "123456789012"
  }'
```

**Official Documentation**: [Create AWS Connection](https://docs.pictory.ai/reference/createawsprivateconnection)

---

#### Get all AWS connections

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/awsconnections`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections?api_token={api_token}
```

**Description**: Get all AWS connections.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pageKey` | string | No | Page identifier for the next set of results |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections?api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get AWS Connections](https://docs.pictory.ai/reference/getawsprivateconnections)

---

#### Get details of a specific AWS connection

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/awsconnections/connectionid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid={connectionid}&api_token={api_token}
```

**Description**: Get details of a specific AWS connection.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `connectionid` | string | Yes | The ID of the AWS connection |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid=conn_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get AWS Connection](https://docs.pictory.ai/reference/getawsprivateconnection)

---

#### Update an existing AWS connection

**Method**: `PUT` | **LowCodeAPI Path**: `/pictoryapis/v1/awsconnections/connectionid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid={connectionid}&api_token={api_token}
```

**Description**: Update an existing AWS connection.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `connectionid` | string | Yes | The ID of the AWS connection |

**Request Body**:
```json
{
  "name": "Updated AWS Connection",
  "enabled": true,
  "version": 1,
  "awsRegion": "us-east-1",
  "awsAccountId": "123456789012",
  "description": "Updated description"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | No | The name of the AWS connection |
| `enabled` | boolean | No | Whether the connection is enabled |
| `version` | number | Yes | The version of the AWS connection |
| `awsRegion` | string | No | The AWS region |
| `awsAccountId` | string | No | The AWS account ID |
| `description` | string | No | The description of the AWS connection |

**Example Request**:
```bash
curl -X PUT "https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid=conn_123&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "version": 1,
    "enabled": true
  }'
```

**Official Documentation**: [Update AWS Connection](https://docs.pictory.ai/reference/updateawsprivateconnection)

---

#### Delete an AWS connection

**Method**: `DELETE` | **LowCodeAPI Path**: `/pictoryapis/v1/awsconnections/connectionid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid={connectionid}&api_token={api_token}
```

**Description**: Delete an AWS connection.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `connectionid` | string | Yes | The ID of the AWS connection |

**Example Request**:
```bash
curl -X DELETE "https://api.lowcodeapi.com/pictory/pictoryapis/v1/awsconnections/connectionid?connectionid=conn_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Delete AWS Connection](https://docs.pictory.ai/reference/deleteawsprivateconnection)

---

### Category: Brand Kit APIs

#### Create Brand API

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/brands/editvideo`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo?api_token={api_token}
```

**Description**: Create a brand for video summary whitelabel page.

**Request Body**:
```json
{
  "name": "My Brand",
  "description": "Company brand kit",
  "color": {
    "primary": "#FF5733",
    "secondary": "#33FF57"
  },
  "fonts": {
    "title": "Arial",
    "body": "Helvetica"
  }
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | No | Name of the Brand |
| `description` | string | No | Description of Brand |
| `color` | object | No | Brand color configuration |
| `fonts` | object | No | Brand font configuration |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Company Brand",
    "color": {"primary": "#000000"},
    "fonts": {"title": "Roboto"}
  }'
```

**Official Documentation**: [Create Brand](https://docs.pictory.ai/reference/create-brand-for-edit-video-page)

---

#### Get Brand API

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/brands/editvideo`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo?api_token={api_token}
```

**Description**: Get all brands for video summary whitelabel page.

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo?api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get Brands](https://docs.pictory.ai/reference/get-brand-api)

---

#### Get Brand by Id

**Method**: `GET` | **LowCodeAPI Path**: `/pictoryapis/v1/brands/editvideo/brandid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid={brandid}&api_token={api_token}
```

**Description**: Get a specific brand by ID.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `brandid` | string | Yes | The ID of the brand to retrieve |

**Example Request**:
```bash
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid=brand_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Get Brand by ID](https://docs.pictory.ai/reference/get-brand-by-id)

---

#### Update Brand

**Method**: `PUT` | **LowCodeAPI Path**: `/pictoryapis/v1/brands/editvideo/brandid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid={brandid}&api_token={api_token}
```

**Description**: Update brand settings.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `brandid` | string | Yes | The ID of the brand to update |

**Request Body**:
```json
{
  "font": {
    "title": "Roboto",
    "body": "Open Sans"
  },
  "color": {
    "primary": "#FF5733",
    "secondary": "#33FF57"
  }
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `font` | object | No | Font configuration for the brand |
| `color` | object | No | Color configuration for the brand |

**Example Request**:
```bash
curl -X PUT "https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid=brand_123&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "color": {"primary": "#123456"},
    "font": {"title": "Arial"}
  }'
```

**Official Documentation**: [Update Brand](https://docs.pictory.ai/reference/update-brand)

---

#### Delete Brand By Id

**Method**: `DELETE` | **LowCodeAPI Path**: `/pictoryapis/v1/brands/editvideo/brandid`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid={brandid}&api_token={api_token}
```

**Description**: Delete a brand by ID.

**Query Parameters**:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `brandid` | string | Yes | The ID of the brand to delete |

**Example Request**:
```bash
curl -X DELETE "https://api.lowcodeapi.com/pictory/pictoryapis/v1/brands/editvideo/brandid?brandid=brand_123&api_token=YOUR_API_TOKEN"
```

**Official Documentation**: [Delete Brand](https://docs.pictory.ai/reference/delete-brand)

---

### Category: Upload Media Files to Blob Storage

#### Generate a signed URL for file upload

**Method**: `POST` | **LowCodeAPI Path**: `/pictoryapis/v1/media/generateurl`

**Full URL**:
```
https://api.lowcodeapi.com/pictory/pictoryapis/v1/media/generateurl?api_token={api_token}
```

**Description**: Generate a signed URL for uploading files to blob storage.

**Request Body**:
```json
{
  "fileName": "video.mp4",
  "contentType": "video/mp4"
}
```

**Request Body Fields**:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fileName` | string | Yes | Name of the file to be uploaded |
| `contentType` | string | Yes | MIME type of the file |

**Example Request**:
```bash
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/media/generateurl?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fileName": "my-video.mp4",
    "contentType": "video/mp4"
  }'
```

**Official Documentation**: [Generate URL](https://docs.pictory.ai/reference/generateurl)

---

## Usage Examples

### Example 1: Create a Video from Script

Generate a complete video from a text script:

```bash
# Step 1: Create a storyboard from your script
# No ID needed - creates new storyboard job
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/storyboard?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoName": "Product Introduction",
    "language": "en-US",
    "scenes": [{
      "sceneText": "Welcome to our amazing product",
      "sceneDuration": 5
    }]
  }'

# Step 2: Render the video using the job ID from storyboard response
# Replace JOB_ID with the actual job ID returned from Step 1
curl -X PUT "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/render/job_id?job_id=JOB_ID&api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"webhook": "https://example.com/webhook"}'
```

### Example 2: Transcribe and Summarize Video

Process a video to get transcription and summary:

```bash
# Step 1: Transcribe video audio
# No ID needed - processes video from URL
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fileUrl": "https://example.com/video.mp4",
    "language": "en-US",
    "mediaType": "video"
  }'

# Step 2: Generate summary from transcript
# Use the transcript returned from Step 1
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v2/transcription/highlights?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript": [{"text": "Video content here", "start": 0, "end": 5}],
    "highlight_duration": 60
  }'
```

### Example 3: Bulk Video Generation with Templates

Create multiple videos from a template:

```bash
# Step 1: Upload a .pictai template file
# No ID needed - creates new template
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token=YOUR_API_TOKEN" \
  -F "[email protected]"

# Step 2: Generate video from template
# No ID needed - generates preview from template
curl -X POST "https://api.lowcodeapi.com/pictory/pictoryapis/v1/video/from-template?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "Authorization": "your-access-token",
    "X-Pictory-User-Id": "customer-123"
  }'

# Step 3: List all templates
# No ID needed - lists all templates
curl -X GET "https://api.lowcodeapi.com/pictory/pictoryapis/v1/templates?api_token=YOUR_API_TOKEN"
```

## Complete Endpoint Reference

For a complete list of all 24 endpoints and their parameters, refer to:

- **OpenAPI Definition**: https://backend.lowcodeapi.com/pictory/definition
- **Official Pictory Documentation**: https://docs.pictory.ai/

## Rate Limits & Best Practices

- **Rate Limit**: Refer to your account plan for specific limits
- **Best Practices**:
  - Use webhooks for long-running operations (storyboard, render, transcription)
  - Store job IDs for tracking video generation progress
  - Upload media files to accessible URLs before processing
  - Configure brand kits once for consistent video styling
  - Use templates for bulk video generation
  - Test voiceover settings before using in production videos

## Error Handling

All Pictory API responses are wrapped in a `data` key:
```json
{
  "data": {
    // Actual response from Pictory
  }
}
```

Common error responses:
- **400 Bad Request**: Invalid parameters or request body
- **401 Unauthorized**: Invalid API token
- **404 Not Found**: Resource not found
- **422 Unprocessable Entity**: Invalid request format
- **500 Server Error**: Pictory server error