---
title: "Sort Lines"
method: POST
path: "/api/v1/tools/sort-lines"
tags: ["tools"]
---

# Sort Lines

`POST /api/v1/tools/sort-lines`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/sort-lines`
- Auth: HTTP bearer

Sort the lines of a text A to Z, Z to A, by length, in natural numeric order, or shuffle them with a seed. Can drop duplicates and ignore case. Returns the sorted text and line count.

## Request body

- object
  - `text` string
  - `mode` string
  - `caseInsensitive` boolean
  - `removeDuplicates` boolean
  - `reverse` boolean
  - `seed` integer

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `result` string
    - `mode` string
    - `lines` integer
    - `removedDuplicates` integer

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

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