Segments API

These are the Segments endpoints of the Keila API. For Keila Cloud, the base URL is https://app.keila.io.

All endpoints, unless stated differently, require Bearer authentication.

A segment is a named, reusable filter over your contacts. It selects a subset of contacts based on their attributes and data, allowing you to target a part of your contact list when sending a campaign.

get /api/v1/segments

Index segments

Retrieve all segments from your project.

Responses

200 Segment response

  • data object[]
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • id string

      Contact ID

      Example: "c_12345"

    • inserted_at string

      Example: "2026-11-04T12:44:26.836138Z"

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

    • updated_at string

      Example: "2026-11-04T12:44:26.836150Z"

  • meta object
post /api/v1/segments

Create Segment

Request body

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

Responses

200 Segment response

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • id string

      Contact ID

      Example: "c_12345"

    • inserted_at string

      Example: "2026-11-04T12:44:26.836138Z"

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

    • updated_at string

      Example: "2026-11-04T12:44:26.836150Z"

get /api/v1/segments/{id}

Show Segment

Parameters

Name In Type Required Description
id path string yes Segment ID

Responses

200 Segment response

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • id string

      Contact ID

      Example: "c_12345"

    • inserted_at string

      Example: "2026-11-04T12:44:26.836138Z"

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

    • updated_at string

      Example: "2026-11-04T12:44:26.836150Z"

put /api/v1/segments/{id}

Update Segment

Parameters

Name In Type Required Description
id path string yes Segment ID

Request body

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

Responses

200 Segment response

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • id string

      Contact ID

      Example: "c_12345"

    • inserted_at string

      Example: "2026-11-04T12:44:26.836138Z"

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

    • updated_at string

      Example: "2026-11-04T12:44:26.836150Z"

patch /api/v1/segments/{id}

Update Segment

Parameters

Name In Type Required Description
id path string yes Segment ID

Request body

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

Responses

200 Segment response

  • data object
    • filter object

      Filter JSON

      Example: {"email":{"$like":"%keila.io"}}

    • id string

      Contact ID

      Example: "c_12345"

    • inserted_at string

      Example: "2026-11-04T12:44:26.836138Z"

    • name string

      Segment name

      Example: "Rocket scientists and book enthusiasts"

    • updated_at string

      Example: "2026-11-04T12:44:26.836150Z"

delete /api/v1/segments/{id}

Delete Segment

Parameters

Name In Type Required Description
id path string yes Segment ID

Responses

204 Segment was deleted successfully or didn’t exist.