Promotes a draft version to production.

http
POST https://services.leadconnectorhq.com/agent-studio/agent/versions/{versionId}/publish

Authorization

NameTypeRequiredExampleDescription
AuthorizationstringYesBearer token generated from the Leadway portal. See Authentication.
VersionstringYes2021-07-28API version.

Path parameters

NameTypeRequiredExampleDescription
versionIdstringYesv1a2b3c4d5e6f7g8h9i0

Query parameters

NameTypeRequiredExampleDescription
sourcestringNoapi

Body

NameTypeRequiredExampleDescription
locationIdstringYesC2QujeCh8ZnC7al2InWRAccount ID for authorization
userIdstringNousr_abc123def456User ID performing the promotion action
userNamestringNoJohn DoeUser name performing the promotion action
userEmailstringNojohn.doe@example.comUser email performing the promotion action

Responses

200 - Version promoted and published successfully
  • success (boolean, required): Success status Example: True

  • message (string, required): Response message Example: Draft published to production successfully. New draft version created for future edits.

  • data (object, required): Result data with production and new draft version details

json
{
  "success": true,
  "message": "Draft published to production successfully. New draft version created for future edits.",
  "data": {
    "productionVersion": {
      "versionId": "v1a2b3c4d5e6f7g8h9i0",
      "agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
      "versionName": "Customer Support Agent v2",
      "state": "prod",
      "isPublished": true,
      "version": 2,
      "publishedAt": "2024-02-27T12:00:00.000Z",
      "publishedBy": "usr_abc123def456",
      "publishedByName": "John Doe",
      "publishedByEmail": "john.doe@example.com"
    },
    "newDraftVersion": {
      "versionId": "v2b3c4d5e6f7g8h9i0j1",
      "agentId": "p1q2r3s4t5u6v7w8x9y0z1a2",
      "versionName": "Customer Support Agent v3",
      "state": "draft",
      "isPublished": false,
      "version": 3,
      "createdAt": "2024-02-27T12:00:00.000Z"
    }
  }
}
400 - Bad Request - Only draft versions can be promoted
401 - Unauthorized
json
{}
404 - Version not found
422 - Unprocessable Entity
json
{}
500 - Internal Server Error
  • statusCode (number): Example: 500

  • message (string): Example: Internal Server Error

json
{
  "statusCode": 500,
  "message": "Internal Server Error"
}

Example

curl -X POST 'https://services.leadconnectorhq.com/agent-studio/agent/versions/YOUR_versionId/publish' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "C2QujeCh8ZnC7al2InWR",
  "userId": "usr_abc123def456",
  "userName": "John Doe",
  "userEmail": "john.doe@example.com"
}'

Last updated October 26, 2026

Was this page helpful?