---
title: "POST /codesnippet/batchget"
method: POST
path: "/codesnippet/batchget"
---

# POST /codesnippet/batchget

`POST /codesnippet/batchget`

Retrieves code snippets from findings that Amazon Inspector detected code vulnerabilities in.

## Request body

- object
  - `findingArns` FindingArn[], required — An array of finding ARNs for the findings you want to retrieve code snippets from.

## Response `200`

Success

- BatchGetCodeSnippetResponse
  - `codeSnippetResults` CodeSnippetResult[] — The retrieved code snippets associated with the provided finding ARNs.
    - `findingArn` string — The ARN of a finding that the code snippet is associated with.
    - `startLine` integer — The line number of the first line of a code snippet.
    - `endLine` integer — The line number of the last line of a code snippet.
    - `codeSnippet` CodeLine[] — Contains information on the retrieved code snippet.
      - `content` string, required — The content of a line of code
      - `lineNumber` integer, required — The line number that a section of code is located at.
    - `suggestedFixes` SuggestedFix[] — Details of a suggested code fix.
      - `description` string — The fix's description.
      - `code` string — The fix's code.
  - `errors` CodeSnippetError[] — Any errors Amazon Inspector encountered while trying to retrieve the requested code snippets.
    - `findingArn` string, required — The ARN of the finding that a code snippet couldn't be retrieved for.
    - `errorCode` 'INTERNAL_ERROR' | 'ACCESS_DENIED' | 'CODE_SNIPPET_NOT_FOUND' | 'INVALID_INPUT', required — The error code for the error that prevented a code snippet from being retrieved.
    - `errorMessage` string, required — The error message received when Amazon Inspector failed to retrieve a code snippet.

## Other responses

- `480` — ValidationException
- `481` — AccessDeniedException
- `482` — ThrottlingException
- `483` — InternalServerException

---

[API](https://skmtc.net/aws/apis/inspector2.md) · [All operations](https://skmtc.net/aws/apis/inspector2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/inspector2/versions/c51110c7cd43/schema)
