# Partition

A partition: a knowledge base. Files uploaded to it are read, split into passages and indexed, so agents can search them. A temporary partition holds short-lived files (such as web downloads) instead, which are never indexed.

**Kind:** an object, used in responses.

## Fields

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `name` | `string` | The partition's name. |
| `isTemporary` | `boolean` | True for a partition of short-lived files (web downloads, scratch files): its files are never indexed or searchable, raise no webhooks, and are removed once they are `fileLifetimeHours` old. Chosen when the partition is created, and never changed afterwards. |
| `fileLifetimeHours` | `integer \| null` | How long a temporary partition keeps a file, in hours. Null means 24. |
| `embeddingCredentials` | [`PartitionEmbeddingCredential`](https://docs.maitento.com/reference/types/partition-embedding-credential.md)`[]` | Your own provider keys that this partition's embeddings authenticate with, tried in `priority` order and failed over when one fails authentication or runs out of quota. Empty: embeddings use Maitento's own key. The keys themselves are never returned. |
| `allowMaitentoEmbeddingFallback` | `boolean \| null` | True lets an embedding that has exhausted this partition's own keys fall back to Maitento's key. False or null: exhausting the keys fails the embedding instead. A partition with no keys of its own always uses Maitento's key. |
| `embeddingCredentialStackId` | `uuid \| null` | The credential stack this partition embeds with, in place of the tenant's model keys and default stack. Its own embedding keys above are still tried first, and Maitento's key is never used while a stack is set, whatever `Partition.AllowMaitentoEmbeddingFallback` says. Null: the tenant's default stack, or its model keys. Set it with `PUT /partitions/by-id/{id}/embedding-credential-stack`. |
| `embeddingCredentialFailures` | [`PartitionEmbeddingCredentialFailure`](https://docs.maitento.com/reference/types/partition-embedding-credential-failure.md)`[]` | Failures recorded against the keys above. A key with an `Auth` failure is skipped until the credentials are set again, which clears this list (as clearing them does). |
| `embeddingCredentialFailureUtc` | `datetime \| null` | When the most recent embedding-credential failure was recorded (UTC). Null when there is none, and once the credentials are set or cleared. |
| `embeddingProfile` | [`PartitionEmbeddingProfile`](https://docs.maitento.com/reference/types/partition-embedding-profile.md)`\| null` | The embedding model, width and chunking this partition is indexed with. Null: Maitento's default embedding model, with its default chunking. Change it with `PUT /partitions/by-id/{id}/embedding-profile`, which re-indexes the partition. |
| `embeddingIndex` | [`PartitionEmbeddingIndexState`](https://docs.maitento.com/reference/types/partition-embedding-index-state.md)`\| null` | The state of the partition's re-index. Null: it has never been re-indexed, which counts as `Ready`. While a re-index is running or has failed, search on the partition is refused and its profile cannot be changed (except to restart a failed re-index). |
| `userCreatedById` | `uuid` | The id of the user who created it. A call made with an API key is recorded as the key's user. |
| `tenantId` | `uuid` | The id of the tenant it belongs to. |
| `id` | `uuid` | The unique id. Use it in `by-id` routes and wherever another object refers to this one. |
| `dateCreated` | `datetime` | When it was created, in UTC. |
| `dateUpdated` | `datetime` | When it was last changed, in UTC. |

## Example

```json
{
  "name": "...",
  "isTemporary": false,
  "fileLifetimeHours": 0,
  "embeddingCredentials": [
    {
      "provider": "OpenAi",
      "baseUrl": "...",
      "modelIdentifier": "...",
      "credentialId": "...",
      "priority": 0
    }
  ],
  "allowMaitentoEmbeddingFallback": false,
  "embeddingCredentialStackId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "embeddingCredentialFailures": [
    {
      "credentialId": "...",
      "failureReason": "...",
      "detail": "...",
      "dateUtc": "2026-10-26T12:00:00.0000000Z",
      "reported": false
    }
  ],
  "embeddingCredentialFailureUtc": "2026-10-26T12:00:00.0000000Z",
  "embeddingProfile": {
    "provider": "OpenAi",
    "model": "...",
    "dimensions": 0,
    "chunkSizeTokens": 0,
    "chunkOverlapTokens": 0,
    "custom": false
  },
  "embeddingIndex": {
    "status": "Ready",
    "startedUtc": "2026-10-26T12:00:00.0000000Z",
    "preparedUtc": "2026-10-26T12:00:00.0000000Z",
    "completedUtc": "2026-10-26T12:00:00.0000000Z",
    "lastProgressUtc": "2026-10-26T12:00:00.0000000Z",
    "totalFiles": 0,
    "completedFiles": 0,
    "unindexedFiles": 0,
    "failureReason": "...",
    "previousProfile": {
      "provider": "OpenAi",
      "model": "...",
      "dimensions": 0,
      "chunkSizeTokens": 0,
      "chunkOverlapTokens": 0,
      "custom": false
    }
  },
  "userCreatedById": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "tenantId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "dateCreated": "2026-10-26T12:00:00.0000000Z",
  "dateUpdated": "2026-10-26T12:00:00.0000000Z"
}
```

## Where it's used

- [`partitions.changeEmbeddingProfile`](https://docs.maitento.com/reference/api/partitions.md) (`PUT /partitions/by-id/{id}/embedding-profile`)
- [`partitions.create`](https://docs.maitento.com/reference/api/partitions.md) (`PUT /partitions`)
- [`partitions.get`](https://docs.maitento.com/reference/api/partitions.md) (`GET /partitions/by-id/{id}`)
- [`partitions.listEmbeddingCredentialFailures`](https://docs.maitento.com/reference/api/partitions.md) (`GET /partitions/embedding-credential-failures`)
- [`partitions.list`](https://docs.maitento.com/reference/api/partitions.md) (`GET /partitions`)
- [`partitions.setEmbeddingCredentialStack`](https://docs.maitento.com/reference/api/partitions.md) (`PUT /partitions/by-id/{id}/embedding-credential-stack`)
- [`partitions.setEmbeddingCredentials`](https://docs.maitento.com/reference/api/partitions.md) (`PUT /partitions/by-id/{id}/embedding-credentials`)
