---
title: "Attribute domains to segments"
method: POST
path: "/v2/segmentation/{segmentation_id}/attribute-domains"
tags: ["Segmentation"]
---

# Attribute domains to segments

`POST /v2/segmentation/{segmentation_id}/attribute-domains`

Assign each input domain to the closest segment in a segmentation, with a 0-1 match score. The segmentation must have completed successfully first.

## Path parameters

- `segmentation_id` integer, required

## Query parameters

- `apiToken` string, nullable

## Headers

- `x-api-token` string, nullable

## Request body

- AttributeSegmentationDomainsRequest
  - `domains` string[], required — Domains to attribute (max 1000).

## Response `200`

Successful Response

- AttributeSegmentationDomainsResponse
  - `results` AttributedDomain[], required — One result per input domain, in the same order.
    - `domain` string, required — The domain that was attributed.
    - `segmentId` integer, nullable, required — ID of the matching segment, or `null` if the domain didn't match any segment closely enough (the unattributed bucket).
    - `score` number, nullable — Match score (0-1). Higher means a stronger match to the assigned segment. `null` when the domain didn't match any segment closely enough or couldn't be evaluated.
  - `totalRequested` integer, required — Total number of domains requested.
  - `totalAttributed` integer, required — Number of domains attributed to a segment. Excludes unmatched domains and domains that couldn't be evaluated.

## Other responses

- `400` — Bad Request
- `402` — Payment Required
- `403` — Forbidden
- `404` — Not Found
- `412` — Precondition Failed
- `422` — Validation Error
- `502` — Bad Gateway

---

[API](https://skmtc.dev/ocean/apis/ocean-io-api-documentation.md) · [All operations](https://skmtc.dev/ocean/apis/ocean-io-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ocean/ocean-io-api-documentation/revisions/505121e48722/schema)
