> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myme.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a custom type

> Registers a custom type at runtime. Identifier must namespace under one of `app.<app-name>.<type>`, `user.<type>`, or `<publisher>.<type>` — reserved roots (`core`, `system`, `marfa`) reject with `400 reserved_namespace`. Bodies are validated; mismatched semver bumps (additive change submitted as major, etc.) reject with `400 version_bump_mismatch`. Child types may not redefine ancestor fields — `400 inheritance_violation`. Property names may not shadow first-class `Item` wire fields (`device`, `source_id`, `timestamp`, `version`, `schema_version`, `tier`, `state`, `capture_latitude`, `capture_longitude`, etc.) — `400 property_shadows_field`.

Admin keys bypass; non-admin credentials need the `metadata.types:write` scope, default-off for new keys. See [Authoring types](/concepts/authoring-types) for the rubric and error catalogue.



## OpenAPI

````yaml /openapi.json post /types
openapi: 3.1.0
info:
  title: Marfa API
  version: 4.2.0
  description: Typed data layer for structured personal data
servers: []
security: []
paths:
  /types:
    post:
      tags:
        - Types
      summary: Register a custom type
      description: >-
        Registers a custom type at runtime. Identifier must namespace under one
        of `app.<app-name>.<type>`, `user.<type>`, or `<publisher>.<type>` —
        reserved roots (`core`, `system`, `marfa`) reject with `400
        reserved_namespace`. Bodies are validated; mismatched semver bumps
        (additive change submitted as major, etc.) reject with `400
        version_bump_mismatch`. Child types may not redefine ancestor fields —
        `400 inheritance_violation`. Property names may not shadow first-class
        `Item` wire fields (`device`, `source_id`, `timestamp`, `version`,
        `schema_version`, `tier`, `state`, `capture_latitude`,
        `capture_longitude`, etc.) — `400 property_shadows_field`.


        Admin keys bypass; non-admin credentials need the `metadata.types:write`
        scope, default-off for new keys. See [Authoring
        types](/concepts/authoring-types) for the rubric and error catalogue.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                nullable: true
      responses:
        '201':
          description: Custom type registered
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: object
                    properties:
                      id:
                        type: string
                      label:
                        type: string
                      description:
                        type: string
                      parent:
                        type: string
                      fields:
                        type: object
                        additionalProperties:
                          nullable: true
                      version:
                        type: number
                      display_hints:
                        type: object
                        properties:
                          title_field:
                            type: string
                          body_field:
                            type: string
                      version_policy:
                        type: object
                        properties:
                          recent_days:
                            type: number
                          daily_snapshot_days:
                            type: number
                          weekly_snapshot_days:
                            type: number
                          max_versions:
                            type: number
                      merge_policy:
                        type: object
                        properties:
                          fields:
                            type: object
                            additionalProperties:
                              type: string
                              enum:
                                - last_writer_wins
                                - keep_both_copies
                          default:
                            type: string
                            enum:
                              - last_writer_wins
                              - keep_both_copies
                    required:
                      - id
                      - fields
                      - version
                required:
                  - type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unauthorized
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Missing metadata.types:write permission
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - forbidden
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '409':
          description: Type already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - type_already_exists
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or OAuth Token
      description: Pass an API key (marfa_k1_...) or OAuth access token (marfa_at_...)

````