> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Audit Document by ID

GET https://api.staple.io/v2/audit/documents/{docId}

Get a document by specifying its ID.

Reference: https://docs.staple.ai/api-reference/v2/documents/audit-document-by-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/audit/documents/{docId}:
    get:
      operationId: auditDocumentById
      summary: Audit Document by ID
      description: Get a document by specifying its ID.
      tags:
        - documents
      parameters:
        - name: docId
          in: path
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Documents_auditDocumentById_Response_200'
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_auditDocumentById_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_auditDocumentById_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples



**Response**

```json
{
  "auditDocument": {
    "completedAt": null,
    "completedBy": null,
    "docId": 1,
    "docName": "documents_tKp8QET3l1TGnz3-szG100OGK7seaqDrNO27_0.jpg",
    "docOriginalURL": "https://staple-new-product-staging.s3.ap-southeast-1.amazonaws.com/originals/4fe8b35280a24f508c0f254a049cfadf.jpg?AWSAccessKeyId=AKIATO6YT43IVPW557NL&Expires=1669274133&Signature=b4Rnw%2BQha0eLXZlmPyTyy2vkzKM%3D&response-content-disposition=inline%3B%20filename%3D%22originals%2F4fe8b35280a24f508c0f254a049cfadf.jpg%22&response-content-type=image%2Fjpeg",
    "docProcessedURLs": [
      "https://staple-new-product-staging.s3.ap-southeast-1.amazonaws.com/documents/4fe8b35280a24f508c0f254a049cfadf/0.jpg?AWSAccessKeyId=AKIATO6YT43IVPW557NL&Expires=1669274133&Signature=HZNpBSAf23tZTP5EosWAOYY%2FbEI%3D&response-content-disposition=inline%3B%20filename%3D%22documents%2F4fe8b35280a24f508c0f254a049cfadf%2F0.jpg%22&response-content-type=image%2Fjpeg"
    ],
    "duplicateIds": [],
    "error": null,
    "exportIds": [],
    "exportedAt": null,
    "exportedBy": null,
    "failedExportReason": null,
    "modelType": "INVOICE",
    "queueId": 1,
    "rejectedAt": null,
    "rejectedBy": null,
    "rejectedReason": null,
    "status": "RECEIVED",
    "timeToComplete": null,
    "uploadedAt": 1669107237724,
    "uploadedBy": "developer@gmail.com"
  }
}
```

**SDK Code**

```python Audit Document by ID
import requests

url = "https://api.staple.io/v2/audit/documents/docId"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Audit Document by ID
const url = 'https://api.staple.io/v2/audit/documents/docId';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audit Document by ID
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v2/audit/documents/docId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audit Document by ID
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/audit/documents/docId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Audit Document by ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.staple.io/v2/audit/documents/docId")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Audit Document by ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.staple.io/v2/audit/documents/docId', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Audit Document by ID
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/audit/documents/docId");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Audit Document by ID
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/audit/documents/docId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```