{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/twenty/json-schema/twenty-relation-metadata-response-schema.json",
  "title": "RelationMetadataResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/twenty-relations-api-openapi.yml#/components/schemas/RelationMetadataResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "relation": {
          "$ref": "#/$defs/RelationMetadata"
        }
      }
    }
  },
  "$defs": {
    "RelationMetadata": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "relationType": {
          "type": "string",
          "enum": [
            "ONE_TO_MANY",
            "MANY_TO_ONE",
            "ONE_TO_ONE"
          ]
        },
        "fromObjectMetadataId": {
          "type": "string",
          "format": "uuid"
        },
        "toObjectMetadataId": {
          "type": "string",
          "format": "uuid"
        },
        "fromFieldMetadataId": {
          "type": "string",
          "format": "uuid"
        },
        "toFieldMetadataId": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  }
}