# Freepik

> Freepik’s current Magnific API: icons, image jobs and flows.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/freepik

## Actions

### Create image prompt

Start this image task and return its ID. Use the matching status action to retrieve its result.

**Inputs**

- Image (`image`, text, required): Input image for prompt generation. Can be base64-encoded string or URL.
- Webhook url (`webhook_url`, text): Webhook URL to notify the user when the task is completed

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Download icon

Download icon.

**Inputs**

- Id (`id`, number, required): Icon resource ID
- Format (`format`, text): These are the formats available for download - Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types. One of: `svg`, `png`, `gif`, `mp4`, `aep`, `json`, `psd`, `eps`.
- Png size (`png_size`, number): These are the sizes available for png_url formats. - Note: Only apply to format png. One of: `512`, `256`, `128`, `64`, `32`, `24`, `16`.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "filename": "example",
      "url": "example"
    }
  }
}
```

### Generate flux dev image

Start this image task and return its ID. Use the matching status action to retrieve its result.

**Inputs**

- Prompt (`prompt`, text): The prompt is a short text that describes the image you want to generate. It can range from simple descriptions, like `"a cat"`, to detailed scenarios, such as `"a cat with wings, playing the guitar, and wearing a hat"`. If no prompt is provided, the AI will generate a random image.
- Webhook url (`webhook_url`, text): Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.
- Aspect ratio (`aspect_ratio`, text): Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`. One of: `square_1_1` (Square 1 1), `classic_4_3` (Classic 4 3), `traditional_3_4` (Traditional 3 4), `widescreen_16_9` (Widescreen 16 9), `social_story_9_16` (Social story 9 16), `standard_3_2` (Standard 3 2), `portrait_2_3` (Portrait 2 3), `horizontal_2_1` (Horizontal 2 1), `vertical_1_2` (Vertical 1 2), `social_post_4_5` (Social post 4 5).
- Styling (`styling`, object): Styling options for the image
- Seed (`seed`, number): Seed for the image generation. If not provided, a random seed will be used. From 1 to 4294967295.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Generate flux pro v1 1 image

Start this image task and return its ID. Use the matching status action to retrieve its result.

**Inputs**

- Prompt (`prompt`, text, required): The prompt to use for image generation.
- Prompt upsampling (`prompt_upsampling`, true/false): Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.
- Seed (`seed`, number): Optional seed for reproducibility. If not provided, a random seed will be used.
- Aspect ratio (`aspect_ratio`, text): Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`. One of: `square_1_1` (Square 1 1), `classic_4_3` (Classic 4 3), `traditional_3_4` (Traditional 3 4), `widescreen_16_9` (Widescreen 16 9), `social_story_9_16` (Social story 9 16), `standard_3_2` (Standard 3 2), `portrait_2_3` (Portrait 2 3), `horizontal_2_1` (Horizontal 2 1), `vertical_1_2` (Vertical 1 2), `social_post_4_5` (Social post 4 5).
- Safety tolerance (`safety_tolerance`, number): Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict. From 0 to 6.
- Output format (`output_format`, text): Format of the output image. One of: `jpeg`, `png`.
- Webhook url (`webhook_url`, text): Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Get flow

Get flow.

**Inputs**

- Flow id (`flow_id`, text, required): Short unique identifier (sqid) of the flow. Discover flow identifiers via GET /v1/ai/flows.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "inputs": [],
      "name": "example",
      "sqid": "example",
      "tool_metadata": {
        "category": "example",
        "description_key": "example",
        "icon": "example",
        "sort_order": 1,
        "total_cost": 1,
        "translation_key": "example"
      }
    }
  }
}
```

### Get flow run

Get flow run.

**Inputs**

- Run id (`run_id`, text, required): Unique identifier (SQID) of the flow run. This is the `workflow_run_identifier` value returned by the `POST /v1/ai/flows/{flow-id}/run` endpoint.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "app_id": "example",
      "completed_at": "example",
      "error_message": "example",
      "result": {
        "audios": [],
        "images": [],
        "videos": []
      },
      "run_id": "example",
      "started_at": "example",
      "status": "pending"
    }
  }
}
```

### Get flux dev task

Get flux dev task.

**Inputs**

- Task id (`task_id`, text, required): ID of the task

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Get flux pro task

Get flux pro task.

**Inputs**

- Task id (`task_id`, text, required): ID of the task

**Outputs**

- `data` (object): Api response.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Get icon

Get icon.

**Inputs**

- Id (`id`, number, required): Icon resource ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "author": {
        "assets": 1,
        "avatar": "example",
        "id": 1,
        "name": "example",
        "slug": "example"
      },
      "created": "example",
      "family": {
        "id": 1,
        "name": "example",
        "total": 1
      },
      "free_svg": false,
      "id": 1,
      "name": "example",
      "related": {
        "style": [],
        "variants": [],
        "visual_concept": []
      },
      "slug": "example",
      "style": {
        "id": 1,
        "name": "example"
      },
      "tags": [],
      "thumbnails": []
    }
  }
}
```

### Get image prompt task

Get image prompt task.

**Inputs**

- Task id (`task_id`, text, required): ID of the task

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    },
    "examples": {}
  }
}
```

### Get relight task

Get relight task.

**Inputs**

- Task id (`task_id`, text, required): ID of the task

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### List flux dev tasks

List flux dev tasks.

**Inputs**: None.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List flux pro v1 1 tasks

List flux pro v1 1 tasks.

**Inputs**: None.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List image prompt tasks

List image prompt tasks.

**Inputs**: None.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List my flows

List my flows.

**Inputs**: None.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### List recent creations

List recent creations.

**Inputs**

- Per page (`per_page`, number): Results per page. It must be greater than 0.
- Page (`page`, number): Page number. It must be greater than 0.
- Tool name (`tool_name`, text): Filter the creations by the tool that produced them.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1,
        "total": 1
      }
    }
  }
}
```

### List relight tasks

List relight tasks.

**Inputs**: None.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": []
  }
}
```

### Relight image

Start this image task and return its ID. Use the matching status action to retrieve its result.

**Inputs**

- Webhook url (`webhook_url`, text): Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.
- Image (`image`, text, required): Base64 or URL of the image to do the relight
- Prompt (`prompt`, text): You can guide the generation process and influence the light transfer with a descriptive prompt. For example, if the reference image is a brightly lit scene, adding something like "A sunlit forest clearing at golden hour" will be helpful. You can also use your imagination to alter lighting conditions in images: transforming a daytime scene into a moonlit night, enhancing the warmth of a sunset, or even dramatic changes like casting shadows of towering structures across a cityscape. IMPORTANT: You can emphasize specific aspects of the light in your prompt by using a number in parentheses, ranging from 1 to 1.4, like "(dark scene:1.3)".
- Transfer light from reference image (`transfer_light_from_reference_image`, text): Base64 or URL of the reference image for light transfer. Incompatible with 'transfer_light_from_lightmap'
- Transfer light from lightmap (`transfer_light_from_lightmap`, text): Base64 or URL of the lightmap for light transfer. Icompatible with 'transfer_light_from_reference_image'
- Light transfer strength (`light_transfer_strength`, number): It allows you to specify the level of light transfer, meaning the intensity that your prompt, reference image, or lightmap will have. A value of 0% will keep your image closest to the original, while 100% represents the maximum possible light transfer. If you enable "Interpolate from original", lower values on this slider will make the result even more similar to your original image. Valid values range `[0, 100]`, default `100`. From 0 to 100.
- Interpolate from original (`interpolate_from_original`, true/false): When enabled, this feature will make your final image interpolate from the original using the "Light transfer strength" slider, at the cost of sometimes restricting the generation's freedom. If disabled, the generation will be freer and will generally produce better results. However, for example, if you want to generate all the frames of a video where a room transitions from having the lights off and very dim lighting to gradually becoming fully illuminated as a new day begins, activating this option might be useful (together with gradually ingreasing the "Light transfer strength" slider).
- Change background (`change_background`, true/false): When enabled, it will change the background based on your prompt and/or reference image. This is super useful for product placement and portraits. However, don't forget to disable it if your scene is something like a landscape or an interior.
- Style (`style`, text): Style. One of: `standard`, `darker_but_realistic` (Darker but realistic), `clean`, `smooth`, `brighter`, `contrasted_n_hdr` (Contrasted n hdr), `just_composition` (Just composition).
- Preserve details (`preserve_details`, true/false): It will try to maintain the texture and small details of the original image. Especially good for product photography, texts, etc. Disable it if you prefer a smoother result.
- Advanced settings (`advanced_settings`, object): Advanced settings.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}
```

### Run flow

Start a flow with its input values. Use Get flow run to retrieve the final status and outputs.

**Inputs**

- Flow id (`flow_id`, text, required): Short unique identifier (sqid) of the flow to execute. Discover flow identifiers via GET /v1/ai/flows.
- Inputs (`inputs`, object, required): Map of input identifier to value. Use each input's `api_key` (recommended) or its `id` (UUID, legacy) as the key , both are accepted. Value types by input type: - `creation` (image/media): URL string, base64-encoded string, or existing creation sqid - `text`: Plain text string - `number`: Numeric value - `select`: Value from allowed options
- Webhook (`webhook`, text): Optional callback URL that receives status notifications during execution. The webhook receives POST requests with the event payload (see webhook event schema). Events are sent when the run starts (`initialized`) and when it finishes (`finished` or `failed`).

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "status": "running",
    "workflow_run_identifier": "example"
  }
}
```

### Search icons

Search icons.

**Inputs**

- Term (`term`, text): Search term. If only term comes, it is searched for term, if only slug comes, it is searched for slug and if both come, it is searched for slug
- Slug (`slug`, text): Search by slug
- Page (`page`, number): Page number. It must be greater than 0.
- Per page (`per_page`, number): Results per page. It must be greater than 0.
- Family id (`family_id`, number): Icon family id. At least 1.
- Order (`order`, text): Define order of results. - Note: If the term or slug parameter is used, the order will be the similarity of the search. One of: `relevance`, `recent`.
- Thumbnail size (`thumbnail_size`, text): Size of the thumbnail. If the size is not specified, the API will return 128 as a default size.
- Filters (`filters`, object): Filter parameters for icons

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1,
        "total": 1
      }
    }
  }
}
```
