> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# Get revision publish trail

GET https://api.smallest.ai/atoms/v1/agent/{id}/branches/{branchId}/revisions/{revisionId}/history

Return the publish trail for a revision: who published it, and the ordered list of prior revisions on this branch with the sections that changed at each step.


Reference: https://docs.smallest.ai/voice-agents/api-reference/agent-versioning-revisions/get-history

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /agent/{id}/branches/{branchId}/revisions/{revisionId}/history:
    get:
      operationId: get-history
      summary: Get revision publish trail
      description: >
        Return the publish trail for a revision: who published it, and the
        ordered list of prior revisions on this branch with the sections that
        changed at each step.
      tags:
        - agentVersioningRevisions
      parameters:
        - name: id
          in: path
          description: The agent ID.
          required: true
          schema:
            type: string
        - name: branchId
          in: path
          description: The branch ID.
          required: true
          schema:
            type: string
        - name: revisionId
          in: path
          description: >-
            The revision ID. Equal to the v1 `versionId` for revisions that were
            migrated from the v1 model.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            API key from the console ApiKey collection, sent as Bearer token.
            Also accepts session cookies for browser-based auth.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/agent_versioning_revisions_get_history_Response_200
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponse'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '403':
          description: Forbidden access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '404':
          description: >-
            Resource not found. The referenced ID does not exist or does not
            belong to the caller's organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetRevisionHistoryRequestNotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
servers:
  - url: https://api.smallest.ai/atoms/v1
    description: Production server
components:
  schemas:
    RevisionStatus:
      type: string
      enum:
        - published
        - draft
        - archived
      title: RevisionStatus
    VersionBlocks:
      type: object
      properties:
        workflow_prompt:
          type: string
        workflow_tools:
          type: string
        workflow_graph:
          type: string
        llm:
          type: string
        voice:
          type: string
        language:
          type: string
        call_handling:
          type: string
        detection:
          type: string
        analytics:
          type: string
        timeouts:
          type: string
        audio:
          type: string
        privacy:
          type: string
        widget:
          type: string
        playbooks:
          type: string
          description: >-
            Only present on revisions created after multi-agent playbooks
            shipped.
      description: >-
        ObjectId references to the `AgentConfigBlock` docs that make up a
        revision, one per config section.
      title: VersionBlocks
    RevisionSecurityCheck:
      type: object
      properties:
        status:
          type: string
          description: The `SecurityCheckStatus` enum.
        reason:
          type:
            - string
            - 'null'
        triggeredAt:
          type:
            - string
            - 'null'
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
      description: Populated after publish. `null` on pre-feature versions.
      title: RevisionSecurityCheck
    RevisionPendingPublishState:
      type: string
      enum:
        - active
        - cancelled
      title: RevisionPendingPublishState
    RevisionPendingPublish:
      type: object
      properties:
        state:
          $ref: '#/components/schemas/RevisionPendingPublishState'
        startedBy:
          type: string
        startedAt:
          type: string
          format: date-time
      description: Set while a publish is armed against this draft revision.
      title: RevisionPendingPublish
    PromptScoreDimensionsItems:
      type: object
      properties:
        tier:
          type: integer
        level:
          type: string
        evidence_span:
          type: string
        title:
          type: string
        description:
          type: string
      title: PromptScoreDimensionsItems
    PromptScore:
      type: object
      properties:
        overall_score:
          type: number
          format: double
        overall_grade:
          type: string
        band:
          type: string
        estimated_ttft_overhead_ms:
          type: number
          format: double
        scoredAt:
          type: string
          format: date-time
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/PromptScoreDimensionsItems'
      description: Result of the prompt-scoring pass, if any.
      title: PromptScore
    Revision:
      type: object
      properties:
        _id:
          type: string
        agent:
          type: string
        status:
          $ref: '#/components/schemas/RevisionStatus'
        branch:
          type:
            - string
            - 'null'
          description: Owning branch (v2). `null` on legacy rows until backfilled.
        revisionNumber:
          type:
            - integer
            - 'null'
          description: Monotonic per-branch commit number. Only set on committed rows.
        versionNumber:
          type:
            - integer
            - 'null'
          description: >-
            Legacy v1 published-version number. `null` for branch revisions and
            drafts.
        label:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        isPinned:
          type: boolean
        publishedBy:
          type:
            - string
            - 'null'
        publishedAt:
          type:
            - string
            - 'null'
          format: date-time
        publishedByName:
          type:
            - string
            - 'null'
          description: Display name of the publisher. `null` when unresolvable.
        restoredFromLabel:
          type:
            - string
            - 'null'
          description: >-
            On a commit produced by restore, the label of the revision it
            copied.
        draftId:
          type:
            - string
            - 'null'
        draftName:
          type:
            - string
            - 'null'
        draftRevision:
          type:
            - integer
            - 'null'
        sourceVersionId:
          type:
            - string
            - 'null'
        blocks:
          $ref: '#/components/schemas/VersionBlocks'
        workflowType:
          type: string
          description: The `WorkflowType` enum for this revision.
        parentVersion:
          type:
            - string
            - 'null'
        isActive:
          type: boolean
        activatedBy:
          type:
            - string
            - 'null'
        activatedAt:
          type:
            - string
            - 'null'
          format: date-time
        securityCheck:
          oneOf:
            - $ref: '#/components/schemas/RevisionSecurityCheck'
            - type: 'null'
          description: Populated after publish. `null` on pre-feature versions.
        pendingPublish:
          oneOf:
            - $ref: '#/components/schemas/RevisionPendingPublish'
            - type: 'null'
          description: Set while a publish is armed against this draft revision.
        restoredFromRevisionId:
          type:
            - string
            - 'null'
          description: On a commit produced by restore, the revision it copied.
        sourceDraftId:
          type:
            - string
            - 'null'
        promptScore:
          $ref: '#/components/schemas/PromptScore'
        promptScoreStale:
          type: boolean
        createdBy:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      description: >
        An `AgentVersion` document. Represents either a committed revision
        (`status: published`, with `branch` + `revisionNumber`) or an
        in-progress draft revision (`status: draft`, with `draftId` +
        `draftRevision`). Fields that do not apply to a given row are `null`.
      title: Revision
    AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaDataTrailItems:
      type: object
      properties:
        revision:
          $ref: '#/components/schemas/Revision'
        changedSections:
          type: array
          items:
            type: string
      title: >-
        AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaDataTrailItems
    AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        revision:
          $ref: '#/components/schemas/Revision'
        publishedBy:
          type: string
        trail:
          type: array
          items:
            $ref: >-
              #/components/schemas/AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaDataTrailItems
      title: >-
        AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaData
    agent_versioning_revisions_get_history_Response_200:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: >-
            #/components/schemas/AgentIdBranchesBranchIdRevisionsRevisionIdHistoryGetResponsesContentApplicationJsonSchemaData
      title: agent_versioning_revisions_get_history_Response_200
    BadRequestErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: BadRequestErrorResponse
    UnauthorizedErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: UnauthorizedErrorResponse
    ApiResponseData:
      type: object
      properties: {}
      title: ApiResponseData
    ApiResponse:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: '#/components/schemas/ApiResponseData'
      title: ApiResponse
    GetRevisionHistoryRequestNotFoundError:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: GetRevisionHistoryRequestNotFoundError
    InternalServerErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: InternalServerErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the console ApiKey collection, sent as Bearer token. Also
        accepts session cookies for browser-based auth.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "status": true,
  "data": {
    "revision": {
      "_id": "64b8f9a2e4b0c123456789ab",
      "agent": "64b8f9a2e4b0c123456789ac",
      "status": "published",
      "branch": "64b8f9a2e4b0c123456789ad",
      "revisionNumber": 5,
      "versionNumber": 42,
      "label": "Release 1.4.0",
      "description": "Added new voice commands and improved detection accuracy.",
      "isPinned": false,
      "publishedBy": "user_987654321",
      "publishedAt": "2024-04-10T14:22:00Z",
      "publishedByName": "Alice Johnson",
      "restoredFromLabel": null,
      "draftId": null,
      "draftName": null,
      "draftRevision": null,
      "sourceVersionId": null,
      "blocks": {
        "workflow_prompt": "64b8f9a2e4b0c123456789ae",
        "workflow_tools": "64b8f9a2e4b0c123456789af",
        "workflow_graph": "64b8f9a2e4b0c123456789b0",
        "llm": "64b8f9a2e4b0c123456789b1",
        "voice": "64b8f9a2e4b0c123456789b2",
        "language": "64b8f9a2e4b0c123456789b3",
        "call_handling": "64b8f9a2e4b0c123456789b4",
        "detection": "64b8f9a2e4b0c123456789b5",
        "analytics": "64b8f9a2e4b0c123456789b6",
        "timeouts": "64b8f9a2e4b0c123456789b7",
        "audio": "64b8f9a2e4b0c123456789b8",
        "privacy": "64b8f9a2e4b0c123456789b9",
        "widget": "64b8f9a2e4b0c123456789ba",
        "playbooks": "64b8f9a2e4b0c123456789bb"
      },
      "workflowType": "standard",
      "parentVersion": "64b8f9a2e4b0c123456789b9",
      "isActive": true,
      "activatedBy": "user_987654321",
      "activatedAt": "2024-04-10T14:30:00Z",
      "securityCheck": {
        "status": "passed",
        "reason": null,
        "triggeredAt": "2024-04-10T14:00:00Z",
        "completedAt": "2024-04-10T14:15:00Z"
      },
      "pendingPublish": null,
      "restoredFromRevisionId": null,
      "sourceDraftId": null,
      "promptScore": {
        "overall_score": 92.5,
        "overall_grade": "A",
        "band": "high",
        "estimated_ttft_overhead_ms": 120.5,
        "scoredAt": "2024-04-10T14:20:00Z",
        "dimensions": [
          {
            "tier": 1,
            "level": "high",
            "evidence_span": "workflow_prompt",
            "title": "Prompt Clarity",
            "description": "The prompt is clear and concise, leading to better model responses."
          }
        ]
      },
      "promptScoreStale": false,
      "createdBy": "user_123456789",
      "createdAt": "2024-04-09T10:00:00Z",
      "updatedAt": "2024-04-10T14:22:00Z"
    },
    "publishedBy": "Alice Johnson",
    "trail": [
      {
        "revision": {
          "_id": "64b8f9a2e4b0c123456789a1",
          "agent": "64b8f9a2e4b0c123456789ac",
          "status": "published",
          "branch": "64b8f9a2e4b0c123456789ad",
          "revisionNumber": 4,
          "versionNumber": 41,
          "label": "Release 1.3.5",
          "description": "Fixed bugs in call handling and improved analytics.",
          "isPinned": false,
          "publishedBy": "user_876543210",
          "publishedAt": "2024-03-20T11:00:00Z",
          "publishedByName": "Bob Smith",
          "restoredFromLabel": null,
          "draftId": null,
          "draftName": null,
          "draftRevision": null,
          "sourceVersionId": null,
          "blocks": {
            "workflow_prompt": "64b8f9a2e4b0c123456789a2",
            "workflow_tools": "64b8f9a2e4b0c123456789a3",
            "workflow_graph": "64b8f9a2e4b0c123456789a4",
            "llm": "64b8f9a2e4b0c123456789a5",
            "voice": "64b8f9a2e4b0c123456789a6",
            "language": "64b8f9a2e4b0c123456789a7",
            "call_handling": "64b8f9a2e4b0c123456789a8",
            "detection": "64b8f9a2e4b0c123456789a9",
            "analytics": "64b8f9a2e4b0c123456789aa",
            "timeouts": "64b8f9a2e4b0c123456789ab",
            "audio": "64b8f9a2e4b0c123456789ac",
            "privacy": "64b8f9a2e4b0c123456789ad",
            "widget": "64b8f9a2e4b0c123456789ae",
            "playbooks": "64b8f9a2e4b0c123456789af"
          },
          "workflowType": "standard",
          "parentVersion": "64b8f9a2e4b0c123456789a0",
          "isActive": false,
          "activatedBy": "user_876543210",
          "activatedAt": "2024-03-20T11:10:00Z",
          "securityCheck": {
            "status": "passed",
            "reason": null,
            "triggeredAt": "2024-03-20T10:45:00Z",
            "completedAt": "2024-03-20T10:55:00Z"
          },
          "pendingPublish": null,
          "restoredFromRevisionId": null,
          "sourceDraftId": null,
          "promptScore": {
            "overall_score": 88.3,
            "overall_grade": "B+",
            "band": "medium",
            "estimated_ttft_overhead_ms": 130,
            "scoredAt": "2024-03-20T10:50:00Z",
            "dimensions": [
              {
                "tier": 2,
                "level": "medium",
                "evidence_span": "call_handling",
                "title": "Call Handling Efficiency",
                "description": "Improved call routing logic."
              }
            ]
          },
          "promptScoreStale": false,
          "createdBy": "user_876543210",
          "createdAt": "2024-03-19T09:00:00Z",
          "updatedAt": "2024-03-20T11:00:00Z"
        },
        "changedSections": [
          "call_handling",
          "analytics"
        ]
      },
      {
        "revision": {
          "_id": "64b8f9a2e4b0c12345678990",
          "agent": "64b8f9a2e4b0c123456789ac",
          "status": "published",
          "branch": "64b8f9a2e4b0c123456789ad",
          "revisionNumber": 3,
          "versionNumber": 40,
          "label": "Release 1.3.0",
          "description": "Initial release with basic voice and language support.",
          "isPinned": false,
          "publishedBy": "user_765432109",
          "publishedAt": "2024-02-15T08:00:00Z",
          "publishedByName": "Carol Lee",
          "restoredFromLabel": null,
          "draftId": null,
          "draftName": null,
          "draftRevision": null,
          "sourceVersionId": null,
          "blocks": {
            "workflow_prompt": "64b8f9a2e4b0c12345678991",
            "workflow_tools": "64b8f9a2e4b0c12345678992",
            "workflow_graph": "64b8f9a2e4b0c12345678993",
            "llm": "64b8f9a2e4b0c12345678994",
            "voice": "64b8f9a2e4b0c12345678995",
            "language": "64b8f9a2e4b0c12345678996",
            "call_handling": "64b8f9a2e4b0c12345678997",
            "detection": "64b8f9a2e4b0c12345678998",
            "analytics": "64b8f9a2e4b0c12345678999",
            "timeouts": "64b8f9a2e4b0c1234567899a",
            "audio": "64b8f9a2e4b0c1234567899b",
            "privacy": "64b8f9a2e4b0c1234567899c",
            "widget": "64b8f9a2e4b0c1234567899d",
            "playbooks": "64b8f9a2e4b0c1234567899e"
          },
          "workflowType": "standard",
          "parentVersion": null,
          "isActive": false,
          "activatedBy": "user_765432109",
          "activatedAt": "2024-02-15T08:10:00Z",
          "securityCheck": {
            "status": "passed",
            "reason": null,
            "triggeredAt": "2024-02-15T07:45:00Z",
            "completedAt": "2024-02-15T07:55:00Z"
          },
          "pendingPublish": null,
          "restoredFromRevisionId": null,
          "sourceDraftId": null,
          "promptScore": {
            "overall_score": 85,
            "overall_grade": "B",
            "band": "medium",
            "estimated_ttft_overhead_ms": 140,
            "scoredAt": "2024-02-15T07:50:00Z",
            "dimensions": [
              {
                "tier": 2,
                "level": "medium",
                "evidence_span": "voice",
                "title": "Voice Recognition",
                "description": "Basic voice recognition implemented."
              }
            ]
          },
          "promptScoreStale": false,
          "createdBy": "user_765432109",
          "createdAt": "2024-02-14T07:00:00Z",
          "updatedAt": "2024-02-15T08:00:00Z"
        },
        "changedSections": [
          "voice",
          "language"
        ]
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history"

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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history';
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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history"

	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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history")

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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history")
  .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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history");
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.smallest.ai/atoms/v1/agent/id/branches/branchId/revisions/revisionId/history")! 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()
```