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

# Download the signature audit trail

GET https://api.cloudraker.com/spaces/{spaceId}/runs/{runId}/audit

Streams the machine-readable audit trail (`application/json`, `content-disposition: attachment`) — the same envelope, signer roster, and event log the signed PDF carries as its `audit-trail.json` attachment. It also reports `status` and omits the PDF page count. Requires `space:read` (denied → 404) and is available before completion. This is a byte stream; its content type, status, and headers are preserved.

Reference: https://docs.cloudraker.com/api/cloud-raker-api/workspace/space-runs/get-space-run-audit-trail

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /spaces/{spaceId}/runs/{runId}/audit:
    get:
      operationId: get-space-run-audit-trail
      summary: Download the signature audit trail
      description: >-
        Streams the machine-readable audit trail (`application/json`,
        `content-disposition: attachment`) — the same envelope, signer roster,
        and event log the signed PDF carries as its `audit-trail.json`
        attachment. It also reports `status` and omits the PDF page count.
        Requires `space:read` (denied → 404) and is available before completion.
        This is a byte stream; its content type, status, and headers are
        preserved.
      tags:
        - spaceRuns
      parameters:
        - name: spaceId
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The audit trail, served as an attachment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignAuditTrail'
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    SignAuditTrailDocument:
      type: object
      properties:
        name:
          type: string
        sha256:
          type: string
        size:
          type: number
          format: double
      required:
        - name
        - sha256
        - size
      title: SignAuditTrailDocument
    SignAuditTrailSignersItems:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          format: email
        typedName:
          type:
            - string
            - 'null'
        emailVerifiedAt:
          type:
            - string
            - 'null'
          format: date-time
        signedAt:
          type:
            - string
            - 'null'
          format: date-time
        ip:
          type:
            - string
            - 'null'
        userAgent:
          type:
            - string
            - 'null'
      required:
        - name
        - email
        - typedName
        - emailVerifiedAt
        - signedAt
        - ip
        - userAgent
      title: SignAuditTrailSignersItems
    SignAuditTrailEventsItems:
      type: object
      properties:
        occurredAt:
          type: string
          format: date-time
        eventType:
          type: string
        actor:
          type: string
        ip:
          type:
            - string
            - 'null'
      required:
        - occurredAt
        - eventType
        - actor
        - ip
      title: SignAuditTrailEventsItems
    SignAuditTrail:
      type: object
      properties:
        envelopeId:
          type: string
        document:
          $ref: '#/components/schemas/SignAuditTrailDocument'
        status:
          type: string
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
        signers:
          type: array
          items:
            $ref: '#/components/schemas/SignAuditTrailSignersItems'
        events:
          type: array
          items:
            $ref: '#/components/schemas/SignAuditTrailEventsItems'
      required:
        - envelopeId
        - document
        - status
        - completedAt
        - signers
        - events
      description: >-
        Served as an attachment. The same material the signed PDF carries as
        `audit-trail.json`, plus `status`, minus the page count.
      title: SignAuditTrail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "envelopeId": "env_9f8b7c6d-1234-4a56-b789-0cdef1234567",
  "document": {
    "name": "Contract_Agreement.pdf",
    "sha256": "3a7bd3e2360a3d5f8b9c4e2d1f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a",
    "size": 245678.4
  },
  "status": "completed",
  "completedAt": "2024-01-15T09:30:00Z",
  "signers": [
    {
      "name": "Alice Johnson",
      "email": "alice.johnson@example.com",
      "typedName": "Alice Johnson",
      "emailVerifiedAt": "2024-01-10T14:22:00Z",
      "signedAt": "2024-01-15T09:15:00Z",
      "ip": "203.0.113.42",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
    }
  ],
  "events": [
    {
      "occurredAt": "2024-01-15T09:00:00Z",
      "eventType": "envelope_created",
      "actor": "system",
      "ip": null
    },
    {
      "occurredAt": "2024-01-15T09:10:00Z",
      "eventType": "signer_invited",
      "actor": "alice.johnson@example.com",
      "ip": "203.0.113.42"
    },
    {
      "occurredAt": "2024-01-15T09:15:00Z",
      "eventType": "document_signed",
      "actor": "alice.johnson@example.com",
      "ip": "203.0.113.42"
    },
    {
      "occurredAt": "2024-01-15T09:30:00Z",
      "eventType": "envelope_completed",
      "actor": "system",
      "ip": null
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/spaces/spaceId/runs/runId/audit"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/spaces/spaceId/runs/runId/audit';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/spaces/spaceId/runs/runId/audit"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/spaces/spaceId/runs/runId/audit")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.cloudraker.com/spaces/spaceId/runs/runId/audit")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cloudraker.com/spaces/spaceId/runs/runId/audit', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/spaces/spaceId/runs/runId/audit");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/spaces/spaceId/runs/runId/audit")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```