Skip to content

Integrity API

The Integrity API provides access to PyPI's implementation of PEP 740.

Concepts

The concepts and objects in the Integrity API closely mirror PEP 740:

  • Attestation objects encapsulate a single "attestation" for a single file, such as a publish attestation or SLSA Provenance.

  • Provenance objects encapsulate one or more attestations for a given file, bundling them with the identity that produced them.

The Integrity API deals in provenance objects; users should extract and verify individual attestations from a file's provenance, as appropriate.

Routes

Get provenance for file

Route: GET /integrity/<project>/<version>/<filename>/provenance

Get the provenance object for the given <filename>.

This endpoint is currently only available as JSON.

Example JSON request (default if no Accept header is passed):

GET /integrity/sampleproject/4.0.0/sampleproject-4.0.0.tar.gz/provenance HTTP/1.1
Host: pypi.org
Accept: application/vnd.pypi.integrity.v1+json
Example JSON response

This is an example response, demonstrating a provenance object containing one attestation and its Trusted Publishing identity.

{
  "attestation_bundles": [
    {
      "attestations": [
        {
          "envelope": {
            "signature": "MEUCIQD1JCA8lWR9na44+zY2tr13sEuMCIu+FLS6eDkwESP5KgIgQDNG+eA5PiLSvVd+0AJn3Nk1V3CpRjRoz59L/MMTxyM=",
            "statement": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEiLCJzdWJqZWN0IjpbeyJuYW1lIjoic2FtcGxlcHJvamVjdC00LjAuMC50YXIuZ3oiLCJkaWdlc3QiOnsic2hhMjU2IjoiMGFjZTc5ODBmODJjNTgxNWVkZTRjZDdiZjlmNjY5MzY4NGNlYzJhZTQ3YjliN2FkZTlhZGQ1MzNiODYyN2M2YiJ9fV0sInByZWRpY2F0ZVR5cGUiOiJodHRwczovL2RvY3MucHlwaS5vcmcvYXR0ZXN0YXRpb25zL3B1Ymxpc2gvdjEiLCJwcmVkaWNhdGUiOm51bGx9"
          },
          "verification_material": {
            "certificate": "MIIGoTCCBiigAwIBAgITFai+PDKak1xA1HLq0mskqhDV5zAKBggqhkjOPQQDAzA3MRUwEwYDVQQKEwxzaWdzdG9yZS5kZXYxHjAcBgNVBAMTFXNpZ3N0b3JlLW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FtVUtVRXN6TDJnMGNIbG5Remh3TjI4MFFVRkJSMVJCTlM5WU5VRkJRVUpCVFVGU2VrSkdRV2xCTm01WlN6QkhlSEZXZWtwMWRISnFjbGxCTVdKQlNVdElWUXBxUjNKelNFMU1jazlLVkZSRlZXbEZVa0ZKYUVGS1dtOTBRVlJ1VTNkc1MzUTNRek5hZDJoNE0yWmpVM0pvUjJaUFlXdFViRTB5ZHlzNGNXMXNkR05xQ2sxQmIwZERRM0ZIVTAwME9VSkJUVVJCTW1OQlRVZFJRMDFDSzJsc2MxQm5lVFI1YmxWSE9VZDBjVVJGUW5GWE9DdGFjV3BZTmt4d2RYaFJjV3BEY2pjS2N6UjVkSGwwTW5Cd1JtUm5hbkpIY2tjeFJGazBibE5hZEZGSmQySnNjbWR4T1hRNWFYcEJUVlJyU21WeGFGRkNjekpQVldsNVNVcGFhWEJqWlVRMWRncEJRVVV2VG1ablpDODVkVXN3VFZwQlNFWnpUR2RoYkhGUFFtdzRDaTB0TFMwdFJVNUVJRU5GVWxSSlJrbERRVlJGTFMwdExTMEsifV19fQ==",
                "inclusionPromise": {
                  "signedEntryTimestamp": "MEQCIGzFZon9/joNsiQOL1uoIP/gtz7/A6eAB+50oX3M0CBaAiAZmLVxcgknlWls6R1FswJWCHY0vkwQ/jE5dSkcY43jWA=="
                },
                "inclusionProof": {
                  "checkpoint": {
                    "envelope": "rekor.sigstore.dev - 1193050959916656506\n25232879\nQrnMowJnGj9hZkL1UOvkg7w+KuG27PEDcsdaEqCtoDM=\n\n— rekor.sigstore.dev wNI9ajBFAiEAshgj30XTIU+L6UyYL0yzLXJbLFmxPEc8ZRmS1R3N1sQCIFCjFEqe9J+Et9sWzJp6SE3p7Eh/+97zON7mwX6unCem\n"
                  },
                  "hashes": [
                    "Bc4heeKQhKCr6/ZtuEHmAyp8AzvP4N1ROusEacAmfFQ=",
                    "ZTeyp2wk6H1Bgz3SZOqQWoQvCmkiltfFstDiy1WaR9Y=",
                    "vnHPC5XIhbYQib86Hi6M4OaEOFGFMlOip8+5mxZd8cs=",
                    "BEONTVFois+c47/YA7vzwZG7fbNLBkVLz1hUM/WMb1k=",
                    "PWqRmPYAwa1fq6R1qSrYlOxCtiKnFZq9hnNt7XwCIA8=",
                    "KHxYP0XNSf1yKjp+xY/5Kkckw0Yweyjx9Z6qn2+pnZM=",
                    "8/b9kmTAbALhl4EaKIH4uMXhES9ILB0XQkuH44FltJY=",
                    "mXfX9NDkaWje6HpniWis2CBELUGjv8LiW2jeMOclCs0=",
                    "jRPOva2IEma7ZE7mPN3xHtEnXtMF/HNvrmbC5TKTy14=",
                    "s8vUdxeRlxXWTCMdSLhiSzRiYM3eGsVvrm+5HWkTNBc=",
                    "4lUF0YOu9XkIDXKXA0wMSzd6VeDY3TZAgmoOeWmS2+Y=",
                    "gf+9m552B3PnkWnO0o4KdVvjcT3WVHLrCbf1DoVYKFw="
                  ],
                  "logIndex": "25232877",
                  "rootHash": "QrnMowJnGj9hZkL1UOvkg7w+KuG27PEDcsdaEqCtoDM=",
                  "treeSize": "25232879"
                },
                "integratedTime": "1730932627",
                "kindVersion": {
                  "kind": "dsse",
                  "version": "0.0.1"
                },
                "logId": {
                  "keyId": "wNI9atQGlz+VWfO6LRygH4QUfY/8W4RFwiT5i5WRgB0="
                },
                "logIndex": "147137139"
              }
            ]
          },
          "version": 1
        }
      ],
      "publisher": {
        "claims": null,
        "environment": "",
        "kind": "GitHub",
        "repository": "pypa/sampleproject",
        "workflow": "release.yml"
      }
    }
  ],
  "version": 1
}

Status codes

  • 200 OK - no error, provenance is available
  • 403 Forbidden - access is temporarily disabled by the PyPI administrators
  • 404 Not Found - file has no provenance
  • 406 Not Acceptable - Accept: header not recognized