---
title: Create a resource
description: "Creates a bookable resource (court, studio, property, ...) in the header's workspace."
api_method: POST
api_path: "/v1/resources"
canonical_url: https://wiblo.app/docs/developers/api/resources/create-resource
last_updated: 2026-07-28T18:08:25+02:00
md_url: https://wiblo.app/docs/developers/api/resources/create-resource.md
---

# Create a resource

`POST /v1/resources`

Creates a bookable resource (court, studio, property, ...) in the header's workspace. Owner/admin only. `capacity` >= 1 is the number of concurrent bookings the resource can absorb — availability holds count against it. Per-user rate-limited at 60/60s.

## 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 |
| --- | --- | --- | --- |
| `name` | `string` | Yes | Display name of the resource. |
| `category` | `string \| null` | No | Free-form pool label that category requirements draw from; `null` for an uncategorised resource. |
| `capacity` | `integer` | No | Concurrent bookings this one resource can hold at any instant — capacity `N` lets `N` bookings overlap on the same resource. Defaults to `1`. |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/resources \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "X-Wiblo-Workspace: $WIBLO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Portable lighting kit",
  "category": "equipment",
  "capacity": 2
}'
```

**TypeScript**

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

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

const { data, error } = await createResource({
  client: sdk,
  headers: { "X-Wiblo-Workspace": "..." },
  body: {
    "name": "Portable lighting kit",
    "category": "equipment",
    "capacity": 2
  },
})
```

## Example response

```json
{
  "id": "e2f8b4d6-9c1a-4e7b-8f3d-6a2c9e5b1f7d",
  "workspace_id": "9c1b7e24-6a3f-4d58-b2e9-0f4a8c6d1e37",
  "name": "Portable lighting kit",
  "category": "equipment",
  "capacity": 2,
  "archived_at": null,
  "created_at": "2026-07-28T09:12:00.000Z",
  "updated_at": "2026-07-28T09:12:00.000Z"
}
```

## Responses

**`201`** — Resource created. Returns `ResourceResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Unique id of the resource. |
| `workspace_id` | `string` | Yes | Workspace the resource belongs to. |
| `name` | `string` | Yes | Display name of the resource. |
| `category` | `string \| null` | Yes | Pool label that category requirements draw from; `null` for an uncategorised resource. |
| `capacity` | `integer` | Yes | Concurrent bookings this one resource can hold at any instant — capacity `N` lets `N` bookings overlap on the same resource. |
| `archived_at` | `string \| null` | Yes | When the resource was archived; `null` for active resources. |
| `created_at` | `string` | Yes | Creation timestamp (RFC 3339). |
| `updated_at` | `string` | Yes | Last-update timestamp (RFC 3339). |

**`400`** — Body failed Zod validation, or the `X-Wiblo-Workspace` header was missing (`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 actor has no active membership in the header's workspace (`WORKSPACE_NOT_FOUND`). 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`.
