---
id: package-diff
title: "Diff two revisions"
description: "Compare two revisions of one package. `changes` lists every component name whose pin differs, with the component as pinned by each side (`null` on the side where the name doesn't exist). Artifact components also carry the artifact `type` and the pinned revision's `meta`, so you can tell what changed, for example a new digest or git reference."
sidebar_label: "Diff two revisions"
hide_title: true
hide_table_of_contents: true
api: eJztV9tu20gM/RWCL2kB+ZLEaVO9dbv3p0WaxRYogjUlUdY00ow6M4pjGPr3giP57jRBm31YoE9xJIpzSB7ycJaYsUutqr0yGmN8Z6qaLIOfG7B8p5wy2oHJwWiGmtJbmvEQpmlBesZuCqVy3gHfsV1AaqraaNYeNFUM88I4hlppyFSes3URzJUvwBe8ZUpOTDRnkCyAKS3AqYzhxVQ3ZTkFo4N9eDYvWJAV3PnPDDt94oHvlfMvh/DWepVT6jfOHVDpDKRk7SJ8RyuTqV/UPAXSWXjeI1gFfOJgWrGnaQTOwMI0kJIGz2UJ84I8dNFnEeTGAt9TVZcMBJrnkKkZOw/Gwkx5sJyzZZ3yECM0NVuSNP+RYYx9LmPJDUboaeYw/oh/dY/xJsKaLFXs2cqLJSodvvIFRijxY4wqwwgtf26U5QxjbxuO0KUFV4TxEiVGjNF5q/QMI8yNrchjjE2jMmyjvdJfF+sKg8oEcR8axnhKZ8l5OskGF/wqH0zodTK4TN9kgzGf5md0nkzSC/HYo/zcsF1sYObWVM8NNCHH63odwE3Pswlf5K8G9Dq5HEwE6SWP88EqDIniQbjePDdYT3bG/mG4qyQO0ovs1WDCr/PBJb1JBuP0NDvj83xCFwm2NxE6Thur/CIQImGybN82vsD44428tuxqox07wXk2HsufQzRdNworHSTs58xdj+20vABMjfasvXihui5VGtg7+uTE1fIwJSb5xKnHCGsrXPeqAxLKf8TqkaIODxyp7PH8fwML8I6tU11M+863OmB4Phxj27aREORJ4eyV/fsDehpPnhzQZBVQP8237MlakpZQniv3eIm7zjk87TAnexrhZZz28jAU6A+RRdSAEgHe9ePXPO9Iit/nVSTDWdyByoESJ194UZbHFWRRc5AM0YaA9jgTvgvrHmmeD23bcVf5UP1+0P8s6tO9mXz4cDgv3pVKTmRrjYX1eIGsYfAGlL6jUmWgdN34CCrlnNIz2AiXgFfaNXmu0uCoZhusnnfCOE++ce9Mtk1CpT3P2G5zfjIeC9t37Y60RkLZvyIA7LxUOUT/9S9+ogyuNl9U7Jyo+KMt8XtTkR5YpkwIA3xfl6RDEnYV4molHSehbU+6pcd1CxWtR7qHRJWlrGsVebaKSgcv1rLzlPHxErdZEiK/6sve8+TiGE/es71ju8+THyX+P5Y4BOcLI1vqjEMpZOuMcdQPDTdaqqwd9ZurC6XvdtTGlhhj4X3t4tGIajWU0VWX5EXUhqmpdtaY91L8rr7by8w6o+II+90rFC0YYdT/+HUllH/+cx1iUjoPA3mtf3g6HA/HuIl2tV63EdbG+Yr0Rr5QhuHuFrRfzOWGzj9uSv/dTakvv+d7P6pLUlrqFbi17Ln4cSVgUqI4rEmBjjcRFsZ5MVguRfb/tmXbyuNuyReSZspJJ2YY51S6fX3eLvGLq/4W8BIeunMchXrLi821547KRkzCfeObzz5+hfjK6eEWszn7Rv6xqltLvicJuzfEowBWO6RebENYAZNL0k0bYcGUsQ1guhdv05Rrv/XJgV5IFOvR9Nsv1xgh7U6MvQkRvB+Fs1x2FtfmlnXb4iZttywHtW37BX0A2yQ=
sidebar_class_name: "get api-method"
info_path: docs/api/package
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Diff two revisions"}
>
</Heading>

<MethodEndpoint
  method={"get"}
  path={"/packages/{id}/diff"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Compare two revisions of one package. `changes` lists every component name whose pin differs, with the component as pinned by each side (`null` on the side where the name doesn't exist). Artifact components also carry the artifact `type` and the pinned revision's `meta`, so you can tell what changed, for example a new digest or git reference.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"The package id.","example":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"},{"in":"query","name":"from","required":true,"schema":{"type":"string","format":"uuid"},"description":"The base revision id.","example":"c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f"},{"in":"query","name":"to","required":true,"schema":{"type":"string","format":"uuid"},"description":"The target revision id.","example":"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={undefined}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The differences between the two revisions.","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"object","description":"The base revision.","properties":{"id":{"type":"string","format":"uuid","example":"c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f"},"version":{"type":"string","example":"1.3.0"}}},"to":{"type":"object","description":"The target revision.","properties":{"id":{"type":"string","format":"uuid","example":"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"},"version":{"type":"string","example":"1.4.0"}}},"changes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The component name that differs."},"from":{"type":"object","nullable":true,"description":"The component as pinned by the base revision, or null if absent there. Artifact components also carry type and meta."},"to":{"type":"object","nullable":true,"description":"The component as pinned by the target revision, or null if absent there. Artifact components also carry type and meta."}}}}},"title":"packageDiff"}}}},"4XX":{"description":"Client error responses due to invalid input, missing parameters or insufficient permissions.","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer","example":400},"code":{"type":"string","example":"bad_request"},"error":{"type":"string","example":"Bad Request"},"message":{"type":"string","description":"Human-readable explanation.","example":"Revision '1.4.0' exists with a different bill of materials (revision e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b)"}},"title":"errorResponse"}}}},"5XX":{"description":"Server error responses.","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer","example":400},"code":{"type":"string","example":"bad_request"},"error":{"type":"string","example":"Bad Request"},"message":{"type":"string","description":"Human-readable explanation.","example":"Revision '1.4.0' exists with a different bill of materials (revision e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b)"}},"title":"errorResponse"}}}}}}
>
  
</StatusCodes>


      