---
updatedAt: 2026-09-09T18:46:43.000Z
agentTools:
  projectIndex: https://docs.pennsieve.io/llms.txt
---

# List relationships (paginated)

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "version": "3.0",
    "title": "Metadata API",
    "description": "Serverless Metadata API - complete spec matching handler.go routes and DTO/request structs.\n",
    "termsOfService": "https://docs.pennsieve.io/page/pennsieve-terms-of-use",
    "contact": {
      "name": "Pennsieve Support",
      "email": "support@pennsieve.net"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api2.pennsieve.io/metadata",
      "description": "Production"
    },
    {
      "url": "https://api2.pennsieve.net/metadata",
      "description": "Development"
    }
  ],
  "components": {
    "x-amazon-apigateway-integrations": {
      "metadata-service": {
        "type": "aws_proxy",
        "uri": "${metadata_service_lambda_arn}",
        "httpMethod": "POST",
        "passthroughBehavior": "when_no_match",
        "contentHandling": "CONVERT_TO_TEXT",
        "payloadFormatVersion": "2.0"
      }
    },
    "securitySchemes": {
      "token_dataset_auth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-amazon-apigateway-authorizer": {
          "type": "request",
          "identitySource": "$request.header.Authorization,$request.querystring.dataset_id",
          "authorizerUri": "${authorize_lambda_invoke_uri}",
          "authorizerPayloadFormatVersion": "2.0",
          "enableSimpleResponses": true,
          "authorizerResultTtlInSeconds": 300,
          "authorizerCredentials": "${gateway_authorizer_role}"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Incorrect authentication or insufficient permissions.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Server error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "RecordDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "provenance_id": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "model_version": {
            "type": "integer"
          },
          "value": {
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RecordRelationshipDTO": {
        "type": "object",
        "properties": {
          "record": {
            "$ref": "#/components/schemas/RecordDTO"
          },
          "relationship_type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "PaginatedRecordRelationshipsDTO": {
        "type": "object",
        "properties": {
          "relationships": {
            "type": "object",
            "properties": {
              "inbound": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecordRelationshipDTO"
                }
              },
              "outbound": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecordRelationshipDTO"
                }
              }
            }
          },
          "cursor": {
            "type": "string",
            "nullable": true
          }
        }
      }
    }
  },
  "paths": {
    "/records/{record_id}/relationships": {
      "get": {
        "x-amazon-apigateway-integration": {
          "$ref": "#/components/x-amazon-apigateway-integrations/metadata-service"
        },
        "operationId": "getRelationshipsForRecord",
        "summary": "List relationships (paginated)",
        "parameters": [
          {
            "in": "query",
            "name": "dataset_id",
            "description": "The node ID of the dataset which the object belongs to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Number of relationships to return per page"
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Pagination cursor for fetching next page"
          }
        ],
        "security": [
          {
            "token_dataset_auth": []
          }
        ],
        "tags": [
          "Relationships"
        ],
        "responses": {
          "200": {
            "description": "Paginated relationships",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRecordRelationshipsDTO"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}
```