# Run a Hair Color task.

This endpoint initiates the hair color change process. You must provide a source file (via URL or File ID) and specify the color settings (preset, pattern, or palettes). The task will be processed asynchronously, and you can check its status using the task_id returned in this response.

Endpoint: POST /s2s/v2.0/task/hair-color
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Request fields (application/json):

  - `preset` (string)
    (optional; required if neither "pattern" nor "palettes" is provided)
Default hair color preset. Available for full mode: ['Jet Black',
'Chocolate Brown', 'Honey Blonde', 'Platinum Blonde', 'Ash Gray',
'Rose Gold', 'Burgundy', 'Copper Red', 'Lavender', 'Teal Blue']
Available for ombre mode: ['Dark Brown/Caramel Blonde', 'Jet
Black/Silver Gray', 'Ash Brown/Lavender', 'Rose Gold/Peach Blonde',
'Burgundy/Magenta Pink', 'Deep Blue/Teal Green', 'Plum Purple/Pastel
Lilac', 'Copper Red/Golden Blonde', 'Dark Gray/Ice Blonde',
'Midnight Blue/Denim Blue']
    Enum: "Jet Black", "Chocolate Brown", "Honey Blonde", "Platinum Blonde", "Ash Gray", "Rose Gold", "Burgundy", "Copper Red", "Lavender", "Teal Blue", "Dark Brown/Caramel Blonde", "Jet Black/Silver Gray", "Ash Brown/Lavender", "Rose Gold/Peach Blonde", "Burgundy/Magenta Pink", "Deep Blue/Teal Green", "Plum Purple/Pastel Lilac", "Copper Red/Golden Blonde", "Dark Gray/Ice Blonde", "Midnight Blue/Denim Blue"

  - `pattern` (object)
    (optional; required if "preset" is not provided)

  - `pattern.name` (string, required)
    Pattern type (required)
    Enum: "ombre", "full"

  - `pattern.blend_strength` (integer)
    (optional; required for ombre) Blend strength (0–100)

  - `pattern.line_offset` (number)
    (optional; required for ombre) Vertical offset (–0.99 to 0.99).
0.99: top color covers 99% of bottom half;   –0.99: bottom color
covers 99% of top half

  - `pattern.coloring_section` (string)
    (optional; required for ombre) Section to color
    Enum: "top"

  - `palettes` (array)
    (optional; required if "preset" is not provided)   Array length 1
for full mode, 2 for ombre mode

  - `palettes.color` (string, required)
    Hex color code

  - `palettes.color_intensity` (integer)
    Color intensity (0–100)

  - `palettes.shine_intensity` (integer)
    Shine intensity (0–100)

  - `src_file_url` (string, required)
    Url of the file to run task. The url should be publicly accessible.
    Example: https://example.com/selfie.jpg

  - `src_file_id` (string, required)
    ID of file to run task. File ID from upload file API.
    Example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=

## Response 200:

  - `200` (unknown)
    Successful execution of the Hair Color task

## Response 200 fields (application/json):

  - `status` (integer)
    Response status
    Example: 200

  - `data` (object)

  - `data.task_id` (string)
    ID of this task. Task result is valid to query by this ID for 30 days.
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400:

  - `400` (unknown)
    Failed execution of task

## Response 400 fields (application/json):

  - `status` (integer)
    Response status
    Example: 400

  - `error` (string)
    Error message
    Example: The operation could not be completed

  - `error_code` (string)
    Enum: "CreditInsufficiency", "InvalidStyleGroup", "InvalidStyle", "BadRequest", "InvalidParameters"

## Response 401:

  - `401` (unknown)
    Invalid API Key or Inactive API Key or Expired API Key

## Response 401 fields (application/json):

  - `status` (integer)
    Response status
    Example: 401

  - `error_code` (string)
    Enum: "InvalidApiKey", "InactiveApiKey", "ExpiredApiKey"

## Response 429:

  - `429` (unknown)
    Too many requests within a given amount of time

