# Open a set of books

Source: https://amanucci.com/nl/docs/developers/api/settings/createEntity

## POST /v1/organisations/{organisationId}/entities

Open a set of books

Bring a set of books into existence — the entity, its personalized chart (one `account` per pack chart entry) and the `account_mapping` rows that let the door resolve a semantic name to a shelf, in ONE transaction. An entity without its mappings is a set of books whose own rules cannot reach its accounts, so the three are one fact. The body carries a client-minted uuid v7: a retry returns the existing entity unchanged rather than creating a second one (rule 3b).

Operation ID: `createEntity`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "organisationId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateEntity"
      }
    }
  }
}
```

### Responses

#### 200 Duplicate-ok: this id already named an entity here.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateEntityResult"
    }
  }
}
```

#### 201 The entity and the chart it was born with.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateEntityResult"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
