> 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 draft detail

GET https://api.smallest.ai/atoms/v1/agent/{id}/drafts/{draftId}

**Deprecated.** By-id reads are kept working during the v1 coexistence window (\~1 month). A v1 `draftId` remains resolvable. Migrate to `GET /agent/{id}/branches/{branchId}/draft`. Will be removed at the sunset date.

Returns the latest revision of a draft along with its edit history.

Reference: https://docs.smallest.ai/api-reference/voice-agents/agent-versioning-drafts/get-draft-detail

## Authentication

- `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

## Request

### Path parameters

- `id` (string, required) — The agent ID.
- `draftId` (string, required) — The draft ID

### Query parameters

- `limit` (integer, optional) — Max number of edit history entries to return (1-100)

## Response

### 200

Successful response

- `status` (boolean, optional)
- `data` (AgentIdDraftsDraftIdGetResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Invalid input

- `status` (boolean, optional)
- `errors` (list of string, optional)

### 401 Unauthorized Error

Unauthorized access

- `status` (boolean, optional)
- `errors` (list of string, optional)

### 403 Forbidden Error

Forbidden access

- `status` (boolean, optional)
- `data` (ApiResponseData, optional)

### 404 Not Found Error

Agent or draft not found

- `any`

### 500 Internal Server Error

Internal server error

- `status` (boolean, optional)
- `errors` (list of string, optional)

## Types

### AgentIdDraftsDraftIdGetResponsesContentApplicationJsonSchemaData

- `latest` (AgentVersion, optional) — Represents either a draft revision or a published version of an agent's configuration.
- `editHistory` (list of DraftEditHistoryEntry, optional)
- `editCount` (integer, optional) — Total number of edits on this draft

### ApiResponseData

### AgentVersion

Represents either a draft revision or a published version of an agent's configuration.

- `_id` (string, optional) — Unique identifier
- `agent` (string, optional) — The agent this version belongs to
- `status` (enum, optional) — Current status of the version record
  - Allowed values: `published`, `draft`, `archived`
- `versionNumber` (integer, optional, nullable) — Auto-incremented version number (published versions only)
- `label` (string, optional, nullable) — Human-readable label for the version
- `description` (string, optional, nullable) — Description of what changed in this version
- `isPinned` (boolean, optional, default: false) — Whether the version is pinned for quick access
- `publishedBy` (string, optional, nullable) — User ID of who published this version
- `publishedAt` (datetime, optional, nullable) — When this version was published
- `activatedBy` (string, optional, nullable) — User ID of who activated this version
- `activatedAt` (datetime, optional, nullable) — When this version was activated
- `draftId` (string, optional, nullable) — Unique draft identifier (drafts only)
- `draftName` (string, optional, nullable) — Human-readable draft name
- `draftRevision` (integer, optional, nullable) — Revision number within the draft (drafts only)
- `sourceVersionId` (string, optional, nullable) — The published version this draft was branched from
- `blocks` (AgentVersionBlocks, optional) — References to the 13 config section blocks
- `workflowType` (enum, optional) — The type of workflow configuration. - `single_prompt` — simple prompt-based agent (default). - `workflow_graph` — node-based visual workflow. **Restricted:** requires the `conversational-agents` org flag. Requests without that flag receive HTTP 403 `"Conversational Flow agents are no longer available for your organization."` The Zod validator still accepts this enum value on any org, but the authorization middleware gates it. - `multi_agents` — multi-agent orchestration (restricted; requires `slmModel` to be one of `[electron, gpt-5.2-azure]`).
  - Allowed values: `workflow_graph`, `single_prompt`, `multi_agents`
- `parentVersion` (string, optional, nullable) — The version this was derived from
- `isActive` (boolean, optional) — Whether this is the currently active version for the agent
- `createdBy` (string, optional) — User ID of who created this record
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)

### DraftEditHistoryEntry

- `revision` (integer, optional) — Draft revision number
- `changedSections` (list of string, optional) — List of config sections that changed in this revision
- `editorName` (string, optional, nullable) — Display name of the editor
- `editorId` (string, optional, nullable) — User ID of the editor
- `timestamp` (datetime, optional) — When the edit was made

### AgentVersionBlocks

References to the 13 config section blocks

- `workflow_prompt` (string, optional)
- `workflow_tools` (string, optional)
- `workflow_graph` (string, optional)
- `llm` (string, optional)
- `voice` (string, optional)
- `language` (string, optional)
- `call_handling` (string, optional)
- `detection` (string, optional)
- `analytics` (string, optional)
- `timeouts` (string, optional)
- `audio` (string, optional)
- `privacy` (string, optional)
- `widget` (string, optional)

## Examples

**Response**

```json
{
  "status": true,
  "data": {
    "latest": {
      "_id": "string",
      "agent": "string",
      "status": "published",
      "versionNumber": 1,
      "label": "string",
      "description": "string",
      "isPinned": false,
      "publishedBy": "string",
      "publishedAt": "2024-01-15T09:30:00Z",
      "activatedBy": "string",
      "activatedAt": "2024-01-15T09:30:00Z",
      "draftId": "string",
      "draftName": "string",
      "draftRevision": 1,
      "sourceVersionId": "string",
      "blocks": {
        "workflow_prompt": "string",
        "workflow_tools": "string",
        "workflow_graph": "string",
        "llm": "string",
        "voice": "string",
        "language": "string",
        "call_handling": "string",
        "detection": "string",
        "analytics": "string",
        "timeouts": "string",
        "audio": "string",
        "privacy": "string",
        "widget": "string"
      },
      "workflowType": "workflow_graph",
      "parentVersion": "string",
      "isActive": true,
      "createdBy": "string",
      "createdAt": "2024-01-15T09:30:00Z",
      "updatedAt": "2024-01-15T09:30:00Z"
    },
    "editHistory": [
      {
        "revision": 1,
        "changedSections": [
          "string"
        ],
        "editorName": "string",
        "editorId": "string",
        "timestamp": "2024-01-15T09:30:00Z"
      }
    ],
    "editCount": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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/drafts/draftId")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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/drafts/draftId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/agent/id/drafts/draftId")! 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()
```