---
title: Assign a member as host
description: Assigns a workspace member as a host of the service.
api_method: POST
api_path: "/v1/services/{serviceId}/hosts"
canonical_url: https://wiblo.app/docs/developers/api/hosts/assign-service-host
last_updated: 2026-07-28T17:56:11+02:00
md_url: https://wiblo.app/docs/developers/api/hosts/assign-service-host.md
---

# Assign a member as host

`POST /v1/services/{serviceId}/hosts`

Assigns a workspace member as a host of the service. Owner/admin only. Any HUMAN member qualifies — linked or not, email or not (ADR 0002). A machine member is 422 `HOST_MUST_BE_HUMAN`; a member id from another workspace collapses onto 404 `MEMBER_NOT_FOUND`. Per-user rate-limited at 60/60s.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `serviceId` | `string` | Yes |  |

## Headers

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Wiblo-Workspace` | `string` | Yes | Workspace id the call is scoped to. The actor must hold an active membership in it; a foreign or unknown id collapses onto 404 WORKSPACE_NOT_FOUND. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `member_id` | `string` | Yes |  |
| `role` | `"organizer" \| "host"` | No |  |
| `is_fixed` | `boolean` | No | Defaults to `false`. |
| `priority` | `integer \| null` | No |  |
| `weight` | `integer \| null` | No |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/services/3f8a2b9c-51d4-4e0b-9c6a-7d2e8f1a4b5c/hosts \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "X-Wiblo-Workspace: $WIBLO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "member_id": "8b3e6d2a-4c7f-4e1b-9d5a-2f6c8e3b7a1d",
  "weight": 200
}'
```

**TypeScript**

```ts
import { createSdk, assignServiceHost } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await assignServiceHost({
  client: sdk,
  path: { serviceId: "3f8a2b9c-51d4-4e0b-9c6a-7d2e8f1a4b5c" },
  headers: { "X-Wiblo-Workspace": "..." },
  body: {
    "member_id": "8b3e6d2a-4c7f-4e1b-9d5a-2f6c8e3b7a1d",
    "weight": 200
  },
})
```

## Example response

```json
{
  "id": "c7b2e9f4-6d1a-4f8b-b3c5-9e2d7a4f6c1b",
  "service_id": "3f8a2b9c-51d4-4e0b-9c6a-7d2e8f1a4b5c",
  "member_id": "8b3e6d2a-4c7f-4e1b-9d5a-2f6c8e3b7a1d",
  "role": "host",
  "is_fixed": false,
  "priority": null,
  "weight": 200,
  "created_at": "2026-07-20T11:30:00.000Z",
  "updated_at": "2026-07-20T11:30:00.000Z",
  "member": {
    "id": "8b3e6d2a-4c7f-4e1b-9d5a-2f6c8e3b7a1d",
    "name": "Jonas Weber",
    "email": "jonas@example.com",
    "avatar_url": null
  }
}
```

## Responses

**`201`** — Host assigned. Returns `HostResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes |  |
| `service_id` | `string` | Yes |  |
| `member_id` | `string` | Yes |  |
| `role` | `"organizer" \| "host"` | Yes |  |
| `is_fixed` | `boolean` | Yes |  |
| `priority` | `integer \| null` | Yes |  |
| `weight` | `integer \| null` | Yes |  |
| `created_at` | `string` | Yes |  |
| `updated_at` | `string` | Yes |  |
| `member` | `object` | Yes |  |
| `member.id` | `string` | Yes |  |
| `member.name` | `string` | Yes |  |
| `member.email` | `string \| null` | Yes |  |
| `member.avatar_url` | `string \| null` | Yes |  |

**`400`** — Body failed Zod validation (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`403`** — The actor is a plain member; owner or admin is required (`ADMIN_REQUIRED`). Returns `ApiErrorEnvelope`.

**`404`** — The service (`SERVICE_NOT_FOUND`) or the member (`MEMBER_NOT_FOUND`, including cross-workspace member ids) was not visible to the actor. Returns `ApiErrorEnvelope`.

**`409`** — The member is already a host on this service (`HOST_ALREADY_ASSIGNED`). Returns `ApiErrorEnvelope`.

**`422`** — The member is a machine member — hosts must be human (`HOST_MUST_BE_HUMAN`); or a path param failed UUID validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.
