> ## 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 an edge type

> Registers a custom edge type. Carries `cardinality` (`one-to-one` / `one-to-many` / `many-to-one` / `many-to-many`), `cascade_on_delete` (`cascade` / `orphan` / `block`), source and target type constraints, and an optional `property_schema`. Core edge type names (`about`, `parent-of`, `in-thread`, `attached-to`, `references`, `authored-by`, `derived-from`, `supersedes`) are reserved and collide with `409 conflict`.

Admin-only. Custom edge types do not inherit — they're flat. See [Edges — custom edge types](/concepts/edges#custom-edge-types).



## OpenAPI

````yaml /openapi.json post /edges/types
openapi: 3.1.0
info:
  title: Marfa API
  version: 4.2.0
  description: Typed data layer for structured personal data
servers: []
security: []
paths:
  /edges/types:
    post:
      tags:
        - EdgeTypes
      summary: Register an edge type
      description: >-
        Registers a custom edge type. Carries `cardinality` (`one-to-one` /
        `one-to-many` / `many-to-one` / `many-to-many`), `cascade_on_delete`
        (`cascade` / `orphan` / `block`), source and target type constraints,
        and an optional `property_schema`. Core edge type names (`about`,
        `parent-of`, `in-thread`, `attached-to`, `references`, `authored-by`,
        `derived-from`, `supersedes`) are reserved and collide with `409
        conflict`.


        Admin-only. Custom edge types do not inherit — they're flat. See [Edges
        — custom edge types](/concepts/edges#custom-edge-types).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  minLength: 1
                label:
                  type: string
                description:
                  type: string
                cardinality:
                  type: string
                  enum:
                    - one-to-one
                    - one-to-many
                    - many-to-one
                    - many-to-many
                source_type_constraints:
                  type: array
                  items:
                    type: string
                target_type_constraints:
                  type: array
                  items:
                    type: string
                cascade_on_delete:
                  type: string
                  enum:
                    - cascade
                    - orphan
                    - block
                property_schema:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      type:
                        type: string
                      description:
                        type: string
                      required:
                        type: boolean
                      enum_values:
                        type: array
                        items:
                          type: string
                      items_type:
                        type: string
                    required:
                      - type
              required:
                - id
                - cardinality
      responses:
        '201':
          description: Edge type registered
          content:
            application/json:
              schema:
                type: object
                properties:
                  edge_type:
                    type: object
                    properties:
                      id:
                        type: string
                      label:
                        type: string
                      description:
                        type: string
                      cardinality:
                        type: string
                        enum:
                          - one-to-one
                          - one-to-many
                          - many-to-one
                          - many-to-many
                      source_type_constraints:
                        type: array
                        items:
                          type: string
                      target_type_constraints:
                        type: array
                        items:
                          type: string
                      cascade_on_delete:
                        type: string
                        enum:
                          - cascade
                          - orphan
                          - block
                      property_schema:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - id
                      - cardinality
                      - source_type_constraints
                      - target_type_constraints
                      - cascade_on_delete
                      - property_schema
                required:
                  - edge_type
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - missing_required_field
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Admin required
          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: Edge type already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - conflict
                      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_...)

````