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

# Update version metadata (label, description, pin only)

PATCH https://api.smallest.ai/atoms/v1/agent/{id}/versions/{versionId}
Content-Type: application/json

**Deprecated on the v2 branch model.** Migrate to `Metadata edits removed on v2. Set `label` at publish via `POST /agent/{id}/branches/{branchId}/draft/publish`.`. When `ENABLE_BRANCH_MODEL` is on, this endpoint returns `409 versioning_v2_migration_required` with the `Deprecation: true` header. See the [migration guide](/voice-agents/deprecations/agent-versioning-migration).

|
Update a published version's label, description, or pinned status. At least one field is required.
Published versions (both active and inactive) are config-immutable — their agent
configuration cannot be changed. To modify config, create a new draft from the version,
edit the draft, and publish it as a new version.


Reference: https://docs.smallest.ai/voice-agents/api-reference/agent-versioning-versions/update-version-metadata

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /agent/{id}/versions/{versionId}:
    patch:
      operationId: update-version-metadata
      summary: Update version metadata (label, description, pin only)
      description: >
        **Deprecated on the v2 branch model.** Migrate to `Metadata edits
        removed on v2. Set `label` at publish via `POST
        /agent/{id}/branches/{branchId}/draft/publish`.`. When
        `ENABLE_BRANCH_MODEL` is on, this endpoint returns `409
        versioning_v2_migration_required` with the `Deprecation: true` header.
        See the [migration
        guide](/voice-agents/deprecations/agent-versioning-migration).


        |

        Update a published version's label, description, or pinned status. At
        least one field is required.

        Published versions (both active and inactive) are config-immutable —
        their agent

        configuration cannot be changed. To modify config, create a new draft
        from the version,

        edit the draft, and publish it as a new version.
      tags:
        - agentVersioningVersions
      parameters:
        - name: id
          in: path
          description: The agent ID.
          required: true
          schema:
            type: string
        - name: versionId
          in: path
          description: The published version ID
          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: Version metadata updated
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/agent_versioning_versions_update_version_metadata_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. Returned for workflow_graph agents when the organization
            lacks conversational agents access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '404':
          description: Agent or version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponse'
        '409':
          description: >
            The v1 versioning endpoint is deprecated on the branch model and
            will not process this request. The response body carries
            `error_type: "versioning_v2_migration_required"` and the response
            includes the `Deprecation: true` header. See the [migration
            guide](/voice-agents/deprecations/agent-versioning-migration) for
            the v2 equivalent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersioningV2MigrationRequiredResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVersionMetaRequest'
servers:
  - url: https://api.smallest.ai/atoms/v1
    description: Production server
components:
  schemas:
    UpdateVersionMetaRequest:
      type: object
      properties:
        label:
          type:
            - string
            - 'null'
          description: Version label
        description:
          type:
            - string
            - 'null'
          description: Version description
        isPinned:
          type: boolean
          description: Pin or unpin the version
      description: At least one of label, description, or isPinned must be provided.
      title: UpdateVersionMetaRequest
    AgentVersionStatus:
      type: string
      enum:
        - published
        - draft
        - archived
      description: Current status of the version record
      title: AgentVersionStatus
    AgentVersionBlocks:
      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
      description: References to the 13 config section blocks
      title: AgentVersionBlocks
    WorkflowType:
      type: string
      enum:
        - workflow_graph
        - single_prompt
      description: >-
        The type of workflow configuration. workflow_graph uses a node-based
        visual workflow, single_prompt uses a simple prompt-based configuration.
      title: WorkflowType
    AgentVersion:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier
        agent:
          type: string
          description: The agent this version belongs to
        status:
          $ref: '#/components/schemas/AgentVersionStatus'
          description: Current status of the version record
        versionNumber:
          type:
            - integer
            - 'null'
          description: Auto-incremented version number (published versions only)
        label:
          type:
            - string
            - 'null'
          description: Human-readable label for the version
        description:
          type:
            - string
            - 'null'
          description: Description of what changed in this version
        isPinned:
          type: boolean
          default: false
          description: Whether the version is pinned for quick access
        publishedBy:
          type:
            - string
            - 'null'
          description: User ID of who published this version
        publishedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When this version was published
        activatedBy:
          type:
            - string
            - 'null'
          description: User ID of who activated this version
        activatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When this version was activated
        draftId:
          type:
            - string
            - 'null'
          description: Unique draft identifier (drafts only)
        draftName:
          type:
            - string
            - 'null'
          description: Human-readable draft name
        draftRevision:
          type:
            - integer
            - 'null'
          description: Revision number within the draft (drafts only)
        sourceVersionId:
          type:
            - string
            - 'null'
          description: The published version this draft was branched from
        blocks:
          $ref: '#/components/schemas/AgentVersionBlocks'
          description: References to the 13 config section blocks
        workflowType:
          $ref: '#/components/schemas/WorkflowType'
        parentVersion:
          type:
            - string
            - 'null'
          description: The version this was derived from
        isActive:
          type: boolean
          description: Whether this is the currently active version for the agent
        createdBy:
          type: string
          description: User ID of who created this record
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      description: >-
        Represents either a draft revision or a published version of an agent's
        configuration.
      title: AgentVersion
    agent_versioning_versions_update_version_metadata_Response_200:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: '#/components/schemas/AgentVersion'
      title: agent_versioning_versions_update_version_metadata_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
    VersioningV2MigrationRequiredResponseErrorType:
      type: string
      enum:
        - versioning_v2_migration_required
      title: VersioningV2MigrationRequiredResponseErrorType
    VersioningV2MigrationRequiredResponse:
      type: object
      properties:
        status:
          type: boolean
        error_type:
          $ref: '#/components/schemas/VersioningV2MigrationRequiredResponseErrorType'
        errors:
          type: array
          items:
            type: string
      description: >
        Returned by deprecated v1 versioning writes and list reads when
        `ENABLE_BRANCH_MODEL` is on. Response header carries `Deprecation:
        true`. The `error_type` value is a stable discriminator.
      title: VersioningV2MigrationRequiredResponse
    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": {
    "_id": "5f8d0d55b54764421b7156c1",
    "agent": "5f8d0d55b54764421b7156b9",
    "status": "published",
    "versionNumber": 3,
    "label": "Q2 2024 Update",
    "description": "Updated greeting prompts and call handling logic for improved user experience.",
    "isPinned": true,
    "publishedBy": "user_12345",
    "publishedAt": "2024-01-15T09:30:00Z",
    "activatedBy": "user_12345",
    "activatedAt": "2024-01-15T09:30:00Z",
    "draftId": "5f8d0d55b54764421b7156d0",
    "draftName": "Q2 Feature Enhancements",
    "draftRevision": 2,
    "sourceVersionId": "5f8d0d55b54764421b7156bf",
    "blocks": {
      "workflow_prompt": "block_001",
      "workflow_tools": "block_002",
      "workflow_graph": "block_003",
      "llm": "block_004",
      "voice": "block_005",
      "language": "block_006",
      "call_handling": "block_007",
      "detection": "block_008",
      "analytics": "block_009",
      "timeouts": "block_010",
      "audio": "block_011",
      "privacy": "block_012",
      "widget": "block_013"
    },
    "workflowType": "workflow_graph",
    "parentVersion": "5f8d0d55b54764421b7156be",
    "isActive": true,
    "createdBy": "user_12345",
    "createdAt": "2024-01-10T08:00:00Z",
    "updatedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
from smallestai import SmallestAI

client = SmallestAI(
    token="YOUR_TOKEN_HERE",
)

client.atoms.agent_versioning_versions.update_version_metadata_label_description_pin_only(
    id="id",
    version_id="versionId",
)

```

```javascript
const url = 'https://api.smallest.ai/atoms/v1/agent/id/versions/versionId';
const options = {
  method: 'PATCH',
  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/versions/versionId"

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

	req, _ := http.NewRequest("PATCH", 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/versions/versionId")

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

request = Net::HTTP::Patch.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.patch("https://api.smallest.ai/atoms/v1/agent/id/versions/versionId")
  .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('PATCH', 'https://api.smallest.ai/atoms/v1/agent/id/versions/versionId', [
  '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/versions/versionId");
var request = new RestRequest(Method.PATCH);
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/versions/versionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```