> 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.

# List revisions on a branch

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

Paginated list of committed and scanning revisions on this branch, newest first.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /agent/{id}/branches/{branchId}/revisions:
    get:
      operationId: list
      summary: List revisions on a branch
      description: >-
        Paginated list of committed and scanning revisions on this branch,
        newest first.
      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: limit
          in: query
          required: false
          schema:
            type: integer
            default: 20
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            default: 0
        - 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_list_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/ListBranchRevisionsRequestNotFoundError'
        '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
    AgentIdBranchesBranchIdRevisionsGetResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        revisions:
          type: array
          items:
            $ref: '#/components/schemas/Revision'
        total:
          type: integer
      title: >-
        AgentIdBranchesBranchIdRevisionsGetResponsesContentApplicationJsonSchemaData
    agent_versioning_revisions_list_Response_200:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: >-
            #/components/schemas/AgentIdBranchesBranchIdRevisionsGetResponsesContentApplicationJsonSchemaData
      title: agent_versioning_revisions_list_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
    ListBranchRevisionsRequestNotFoundError:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: ListBranchRevisionsRequestNotFoundError
    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": {
    "revisions": [
      {
        "_id": "642f1c3e9a1b2c0012345678",
        "agent": "642f1c3e9a1b2c001234abcd",
        "status": "published",
        "branch": "642f1c3e9a1b2c0098765432",
        "revisionNumber": 42,
        "versionNumber": 7,
        "label": "Initial Release",
        "description": "First stable published revision of the agent.",
        "isPinned": false,
        "publishedBy": "5f8d0d55b54764421b7156c3",
        "publishedAt": "2024-04-10T14:22:00Z",
        "publishedByName": "Alice Johnson",
        "restoredFromLabel": null,
        "draftId": null,
        "draftName": null,
        "draftRevision": null,
        "sourceVersionId": "5f8d0d55b54764421b7156c3",
        "blocks": {
          "workflow_prompt": "642f1c3e9a1b2c00abcdef01",
          "workflow_tools": "642f1c3e9a1b2c00abcdef02",
          "workflow_graph": "642f1c3e9a1b2c00abcdef03",
          "llm": "642f1c3e9a1b2c00abcdef04",
          "voice": "642f1c3e9a1b2c00abcdef05",
          "language": "642f1c3e9a1b2c00abcdef06",
          "call_handling": "642f1c3e9a1b2c00abcdef07",
          "detection": "642f1c3e9a1b2c00abcdef08",
          "analytics": "642f1c3e9a1b2c00abcdef09",
          "timeouts": "642f1c3e9a1b2c00abcdef0a",
          "audio": "642f1c3e9a1b2c00abcdef0b",
          "privacy": "642f1c3e9a1b2c00abcdef0c",
          "widget": "642f1c3e9a1b2c00abcdef0d",
          "playbooks": "642f1c3e9a1b2c00abcdef0e"
        },
        "workflowType": "standard",
        "parentVersion": "642f1c3e9a1b2c0012345677",
        "isActive": true,
        "activatedBy": "5f8d0d55b54764421b7156c3",
        "activatedAt": "2024-04-10T14:30:00Z",
        "securityCheck": {
          "status": "passed",
          "reason": null,
          "triggeredAt": "2024-04-10T14:25:00Z",
          "completedAt": "2024-04-10T14:28: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:29:00Z",
          "dimensions": [
            {
              "tier": 1,
              "level": "excellent",
              "evidence_span": "workflow_prompt",
              "title": "Prompt Clarity",
              "description": "The prompt is clear and concise, leading to accurate responses."
            }
          ]
        },
        "promptScoreStale": false,
        "createdBy": "5f8d0d55b54764421b7156c3",
        "createdAt": "2024-04-09T10:00:00Z",
        "updatedAt": "2024-04-10T14:30:00Z"
      }
    ],
    "total": 1
  }
}
```

**SDK Code**

```python
import requests

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

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';
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"

	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")

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")
  .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', [
  '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");
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")! 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()
```