> ## Documentation index
>
> Fetch the complete documentation index at: https://andesine.app/docs/llms.txt
> Use it to find all pages before you explore further.

# Get current content type metadata

`POST https://api.andesine.app/type-metadata/current`

Read-only bulk metadata for type generation. Returns one consistent database snapshot of accessible collections and their active effective schemas, including inheritance. Optional entry/tree data requires read:entries in addition to read:collections. Explicit unavailable collection selectors fail. Active schema migrations in the selected collections return a conflict. No entry content is loaded. Schema-free collections use general types without warnings.

Required API key permissions: read:collections. Write permissions also grant read access for the same resource.

## Authentication

Use one of:

- `apiKey` (http, bearer, Andesine API key)
- `oauth` (http, bearer, Andesine OAuth access token)

## Parameters

### Header

- `x-workspace-id` (string, optional): Required for OAuth: ID of the workspace to access. API keys use their own workspace.

## Request body

The body is required.

Content type: `application/json`

- `collections` (array of any of, optional): Collection IDs, name paths, or objects with collectionSlugPath. Includes selected subtrees; empty selects all accessible collections. Default: `[]`.
  - Any of: Option 1 (string)
  - Any of: Option 2 (string)
  - Any of: Option 3 (object)
    - `collectionSlugPath` (string, required): Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.
- `includeEntries` (boolean, optional): Include entry IDs, names, paths, and schema associations. Default: `false`.
- `includeTree` (boolean, optional): Include ordered child IDs for each collection. Also includes entry metadata. Default: `false`.

## Responses

### 200

OK

Content type: `application/json`

Type: `TypeMetadata`.

- `formatVersion` (constant, required): Value: `1`.
- `workspaceID` (string, required)
- `source` (any of, required)
  - Any of: Option 1 (object)
    - `kind` (constant, required): Value: `"current"`.
  - Any of: Option 2 (object)
    - `kind` (constant, required): Value: `"published"`.
    - `channel` (`PublishingChannelCode`, required)
    - `snapshotID` (string, required)
    - `expiresAt` (any of, required)
      - Any of: Option 1 (string (date-time))
      - Any of: Option 2 (null)
- `fingerprint` (string, required): Deterministic hash of returned type metadata and source kind. Excludes publication snapshot IDs, expiry, content bodies, and unrequested entry/tree data.
- `collections` (array of `TypeMetadataCollection`, required)
  - `id` (any of, required): Null identifies the virtual root at /.
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
  - `parentID` (any of, required)
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
  - `name` (string, required)
  - `path` (string, required)
  - `slugPath` (string, required)
  - `schemaRevisionIDs` (array of any of, required): Effective schema revisions for this collection. Null represents schema-free content. An empty array has no recorded schema evidence; use a general type without a warning.
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
- `revisions` (array of `SchemaRevision`, required): Distinct effective definitions, including inherited fields, referenced by collections or entries.
  - `revisionID` (string, required): Recorded effective schema revision.
  - `hash` (string, required): Hash of the effective schema definition.
  - `definition` (object, required): Exact effective definition, including inherited fields.
    - `formatVersion` (constant, required): Value: `1`.
    - `fields` (array of `SchemaField`, required)
      - Any of: `SchemaProperty`
        - `id` (string, required)
        - `kind` (constant, required): Value: `"property"`.
        - `label` (string, required)
        - `type` (string, required): One of: `"text"`, `"number"`, `"checkbox"`, `"date"`, `"url"`, `"select"`, `"multi-select"`.
        - `initialValue` (`SchemaPropertyValue`, required)
          - Any of: Option 1 (boolean)
          - Any of: Option 2 (string)
          - Any of: Option 3 (array of string)
        - `options` (array of string, required)
        - `optional` (boolean, optional)
      - Any of: `SchemaFragment`
        - `id` (string, required)
        - `kind` (constant, required): Value: `"fragment"`.
        - `label` (string, required)
        - `allowedBlocks` (array of `SchemaBlockType`, required)
        - `initialContent` (array of `ContentNode`, required)
          - `type` (string, required)
          - `attrs` (object, optional)
            - `{key}` (any, optional)
          - `content` (array of `ContentNode`, optional)
          - `marks` (array of `ContentMark`, optional)
            - `type` (string, required)
            - `attrs` (object, optional)
              - `{key}` (any, optional)
          - `text` (string, optional)
        - `optional` (boolean, optional)
- `entries` (array of `TypeMetadataEntry`, optional)
  - `id` (string, required)
  - `collectionID` (any of, required)
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
  - `name` (string, required)
  - `path` (string, required)
  - `slugPath` (string, required)
  - `schemaRevisionID` (any of, required)
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
- `tree` (array of `TypeMetadataTree`, optional)
  - `collectionID` (any of, required)
    - Any of: Option 1 (string)
    - Any of: Option 2 (null)
  - `collectionIDs` (array of string, required): Selected direct children in display order.
  - `entryIDs` (array of string, required): Direct entries in display order.

### 400

400

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"BAD_REQUEST"`.
  - `status` (constant, required): Value: `400`.
  - `message` (string, required): Default: `"Bad Request"`.
  - `data` (`ValidationErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `issues` (array of `ValidationIssue`, optional)
      - `message` (string, required)
      - `code` (string, optional)
      - `path` (array of any of, optional)
        - Any of: Option 1 (string)
        - Any of: Option 2 (number)
        - Any of: Option 3 (object)
          - `key` (any of, required)
            - Any of: Option 1 (string)
            - Any of: Option 2 (number)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 401

401

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"UNAUTHORIZED"`.
  - `status` (constant, required): Value: `401`.
  - `message` (string, required): Default: `"Unauthorized"`.
  - `data` (`ErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 403

403

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"FORBIDDEN"`.
  - `status` (constant, required): Value: `403`.
  - `message` (string, required): Default: `"Forbidden"`.
  - `data` (`ForbiddenErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `missingPermissions` (array of string, optional)
    - `requiredPlan` (constant, optional): Value: `"pro"`.
    - `action` (string, optional): The requested action that was denied.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 404

404

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"NOT_FOUND"`.
  - `status` (constant, required): Value: `404`.
  - `message` (string, required): Default: `"Not Found"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 409

409

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"CONFLICT"`.
  - `status` (constant, required): Value: `409`.
  - `message` (string, required): Default: `"Conflict"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"SCHEMA_FIELD_KEY_CONFLICT"`.
  - `status` (constant, required): Value: `409`.
  - `message` (string, required): Default: `"SCHEMA_FIELD_KEY_CONFLICT"`.
  - `data` (`SchemaFieldKeyConflictErrorData`, required)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `key` (string, required)
    - `kind` (string, required): One of: `"fragment"`, `"property"`.
    - `fieldIDs` (array of string, required)
- One of: Option 3 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"SCHEMA_MIGRATION_IN_PROGRESS"`.
  - `status` (constant, required): Value: `409`.
  - `message` (string, required): Default: `"A schema migration is in progress for this collection"`.
  - `data` (`SchemaMigrationErrorData`, required)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `migrationID` (string, required)
- One of: Option 4 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 429

429

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"TOO_MANY_REQUESTS"`.
  - `status` (constant, required): Value: `429`.
  - `message` (string, required): Default: `"Too Many Requests"`.
  - `data` (`RateLimitErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `limit` (string, optional): The limit that was reached: a short-term rate limit, or a monthly API call, AI credit, or spending limit. One of: `"rate"`, `"api-calls"`, `"ai-credits"`, `"spending"`.
    - `retryAfterSeconds` (number, optional): Minimum delay before another attempt, in seconds. Also sent in Retry-After.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 500

500

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"INTERNAL_SERVER_ERROR"`.
  - `status` (constant, required): Value: `500`.
  - `message` (string, required): Default: `"Internal Server Error"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 503

503

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"SERVICE_UNAVAILABLE"`.
  - `status` (constant, required): Value: `503`.
  - `message` (string, required): Default: `"Service Unavailable"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)
