---
title: "Create Segmentation"
method: POST
path: "/v1/segmentations"
---

# Create Segmentation

`POST /v1/segmentations`

## Request

- Base URL: `https://api.segly.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.segly.io/v1/segmentations`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string, nullable

## Request body

- SegmentationCreateRequest
  - `upload_id` string, required
  - `workflow` 'character-simple' | 'character-complex' | 'general-simple' | 'general-complex' | 'background' | 'spine-psd' | 'live2d-psd', required
  - `layers` string[], required
  - `max_credits` 5, required

## Response `202`

Successful Response

- SegmentationResource
  - `id` string, required
  - `status` 'accepting' | 'queued' | 'processing' | 'succeeded' | 'failed' | 'cancelled', required
  - `workflow` string, required
  - `layers` string[], required
  - `credit` CreditReservation, required
    - `cost` 5
    - `state` 'reserved' | 'spent' | 'refunded', required
  - `message` string, nullable
  - `created_at` string, date-time, required
  - `completed_at` string, date-time, nullable
  - `result` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/segly/apis/segly-io-api.md) · [All operations](https://skmtc.dev/segly/apis/segly-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/segly/apis/segly-io-api/revisions/f831b05317d0?raw)
