# Get attestation statements for an image


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





`GET /images/{name}/attestations`

Return the in-toto attestation statements attached to the image for the
given platform. The daemon locates the attestation manifest(s) that
reference the matching platform image manifest, reads their statement
layers, and returns the verbatim statement JSON together with layer
metadata.

If the image has no attestations an empty array is returned.


## Connection and access

[API connection and authentication guidance](/reference/api/engine/version/v1.57/#connection)


Server: `/v1.57`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
null
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --unix-socket "${DOCKER_SOCKET:-/var/run/docker.sock}" \
  --header 'Accept: application/json' \
  'http://localhost/v1.57/images/<NAME>/attestations'
```



## Parameters

### name

Location: path. Required: yes.

Image name or id

```json
{
  "description": "Image name or id",
  "in": "path",
  "name": "name",
  "pointer": "/paths/~1images~1{name}~1attestations/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

### platform

Location: query. Required: no.

JSON-encoded OCI platform to select the image variant whose
attestations to return.
If omitted, the daemon's default (host) platform is used.

Only one platform value is currently accepted; passing more than
one returns an error. The parameter is declared as an array so the
wire shape can accept multiple values in the future without an
API version bump.

Example: `{"os": "linux", "architecture": "amd64"}`

```json
{
  "description": "JSON-encoded OCI platform to select the image variant whose\nattestations to return.\nIf omitted, the daemon's default (host) platform is used.\n\nOnly one platform value is currently accepted; passing more than\none returns an error. The parameter is declared as an array so the\nwire shape can accept multiple values in the future without an\nAPI version bump.\n\nExample: `{\"os\": \"linux\", \"architecture\": \"amd64\"}`",
  "explode": true,
  "in": "query",
  "name": "platform",
  "pointer": "/paths/~1images~1{name}~1attestations/get/parameters/1",
  "required": false,
  "schema": {
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "style": "form"
}
```

### type

Location: query. Required: no.

In-toto predicate type URI to filter returned statements. May be
repeated to accept any of several predicate types. If omitted, all
statements are returned.

Example: `type=https://slsa.dev/provenance/v0.2&type=https://spdx.dev/Document`

```json
{
  "description": "In-toto predicate type URI to filter returned statements. May be\nrepeated to accept any of several predicate types. If omitted, all\nstatements are returned.\n\nExample: `type=https://slsa.dev/provenance/v0.2\u0026type=https://spdx.dev/Document`",
  "explode": true,
  "in": "query",
  "name": "type",
  "pointer": "/paths/~1images~1{name}~1attestations/get/parameters/2",
  "required": false,
  "schema": {
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "style": "form"
}
```

### statement

Location: query. Required: no.

Include the verbatim in-toto statement body in each returned
entry. Defaults to false; when omitted or false, only the
descriptor and predicate type are returned and statement blobs
are not read.

```json
{
  "description": "Include the verbatim in-toto statement body in each returned\nentry. Defaults to false; when omitted or false, only the\ndescriptor and predicate type are returned and statement blobs\nare not read.",
  "in": "query",
  "name": "statement",
  "pointer": "/paths/~1images~1{name}~1attestations/get/parameters/3",
  "required": false,
  "schema": {
    "default": false,
    "type": "boolean"
  }
}
```

## Request and responses

### Response 200 application/json

No error


Schema:

```json
{
  "items": {
    "$ref": "#/components/schemas/AttestationStatement"
  },
  "type": "array"
}
```










### Response 400 application/json

Bad parameter (e.g. malformed `platform` value)


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


### Response 404 application/json

No such image, or no manifest found for the requested platform


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


### Response 500 application/json

Server error


Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


### Response 501 application/json

The daemon's image backend does not support attestations. This
is returned by the legacy (graphdriver) image store, which does
not preserve OCI image indexes.



Schema:

```json
{
  "$ref": "#/components/schemas/ErrorResponse"
}
```









Schema example:
```json
{
  "message": "Something went wrong."
}
```


## Complete operation contract

```json
{
  "description": "Return the in-toto attestation statements attached to the image for the\ngiven platform. The daemon locates the attestation manifest(s) that\nreference the matching platform image manifest, reads their statement\nlayers, and returns the verbatim statement JSON together with layer\nmetadata.\n\nIf the image has no attestations an empty array is returned.\n",
  "operationId": "ImageAttestations",
  "parameters": [
    {
      "description": "Image name or id",
      "in": "path",
      "name": "name",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "JSON-encoded OCI platform to select the image variant whose\nattestations to return.\nIf omitted, the daemon's default (host) platform is used.\n\nOnly one platform value is currently accepted; passing more than\none returns an error. The parameter is declared as an array so the\nwire shape can accept multiple values in the future without an\nAPI version bump.\n\nExample: `{\"os\": \"linux\", \"architecture\": \"amd64\"}`",
      "explode": true,
      "in": "query",
      "name": "platform",
      "required": false,
      "schema": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "style": "form"
    },
    {
      "description": "In-toto predicate type URI to filter returned statements. May be\nrepeated to accept any of several predicate types. If omitted, all\nstatements are returned.\n\nExample: `type=https://slsa.dev/provenance/v0.2\u0026type=https://spdx.dev/Document`",
      "explode": true,
      "in": "query",
      "name": "type",
      "required": false,
      "schema": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "style": "form"
    },
    {
      "description": "Include the verbatim in-toto statement body in each returned\nentry. Defaults to false; when omitted or false, only the\ndescriptor and predicate type are returned and statement blobs\nare not read.",
      "in": "query",
      "name": "statement",
      "required": false,
      "schema": {
        "default": false,
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/AttestationStatement"
            },
            "type": "array"
          }
        }
      },
      "description": "No error"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Bad parameter (e.g. malformed `platform` value)"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "No such image, or no manifest found for the requested platform"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    },
    "501": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The daemon's image backend does not support attestations. This\nis returned by the legacy (graphdriver) image store, which does\nnot preserve OCI image indexes.\n"
    }
  },
  "summary": "Get attestation statements for an image",
  "tags": [
    "Image"
  ]
}
```

## Referenced schemas

- [#/components/schemas/AttestationStatement](/reference/api/engine/version/v1.57/schemas/AttestationStatement/)

- [#/components/schemas/ErrorResponse](/reference/api/engine/version/v1.57/schemas/ErrorResponse/)




