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

# Get paginated history for a record

Fetches all historical versions of a record in descending chronological order. Returns the current version and all previous versions of the record.


# 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"
          }
        }
      },
      "PaginatedRecordsDTO": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordDTO"
            }
          },
          "cursor": {
            "type": "string",
            "nullable": true
          }
        }
      }
    }
  },
  "paths": {
    "/records/{record_id}/history": {
      "get": {
        "x-amazon-apigateway-integration": {
          "$ref": "#/components/x-amazon-apigateway-integrations/metadata-service"
        },
        "operationId": "getRecordHistory",
        "summary": "Get paginated history for a record",
        "description": "Fetches all historical versions of a record in descending chronological order. Returns the current version and all previous versions of the record.\n",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the record"
          },
          {
            "in": "query",
            "name": "dataset_id",
            "description": "The node ID of the dataset which the object belongs to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Number of records to return per page"
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Pagination cursor from previous response"
          },
          {
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Point-in-time for record history query; defaults to now"
          }
        ],
        "security": [
          {
            "token_dataset_auth": []
          }
        ],
        "tags": [
          "Records"
        ],
        "responses": {
          "200": {
            "description": "Paginated record history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRecordsDTO"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}
```