---
title: "Detect an image's focal region"
method: POST
path: "/v1/media/{id}/focal-region"
tags: ["media"]
---

# Detect an image's focal region

`POST /v1/media/{id}/focal-region`

## Request

- Base URL: `https://api.brixsignage.com`
- URL: `https://api.brixsignage.com/v1/media/{id}/focal-region`
- Auth: HTTP bearer

Detect the main subject of an image and cache its position as a normalized x, y, width, and height. This lets the image be cropped around its subject when shown in a differently shaped area, instead of being cropped from the center.

## Path parameters

- `id` string, required

## Response `200`

Success.

- object
  - `data` object, required
    - `region` object, nullable, required: Fractions (0–1) of the image. Null when nothing stood out; the stored region is then unchanged.
      - `x` number, required
      - `y` number, required
      - `w` number, required
      - `h` number, required

## Other responses

- `400`: `wrong_kind`: not an image.
- `401`: Missing, expired or revoked bearer token.
- `403`: The token lacks the permission this operation needs (see `x-brix-permission`).
- `404`: No media with this id, or no bytes.
- `413`: Over 32 MB.
- `5XX`: Server error. The body carries a `requestId` to quote to support.

---

[API](https://skmtc.dev/brixsignage/apis/brix-api.md) · [All operations](https://skmtc.dev/brixsignage/apis/brix-api/llms.txt) · [OpenAPI document](https://skmtc.dev/brixsignage/apis/brix-api/revisions/02fd3665dc7d?raw)
