> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# deployVersion

> Deploy a specific version of a call flow.

Deploy a specific version of a call flow resource.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/fabric/resources/call_flows/{id}/versions:
    post:
      operationId: subpackageCallFlows_deploy_call_flow_version
      summary: Deploy call flow version
      description: >-
        Makes one saved Call Flow version active, selected by document version
        or version ID. Use it after updating a visual flow when that revision is
        ready to handle calls; updating the Call Flow saves a revision but does
        not replace this deployment step. Directly authored [SWML
        Scripts](/docs/apis/rest/swml-scripts/create-swml-script) do not use
        Call Flow versions.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or
        _Video_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_callFlows
      parameters:
        - name: id
          in: path
          description: The unique identifier of the Call Flow.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: >-
            The request has succeeded and a new resource has been created as a
            result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallFlowVersionDeployResponse'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode422'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallFlowVersionDeployRequest'
tags:
  - name: subpackage_callFlows
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    CallFlowVersionDeployByDocumentVersion:
      type: object
      properties:
        document_version:
          type: integer
          description: The current revision of the call flow.
      required:
        - document_version
      title: CallFlowVersionDeployByDocumentVersion
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    CallFlowVersionDeployByVersionId:
      type: object
      properties:
        call_flow_version_id:
          $ref: '#/components/schemas/uuid'
          description: Any call flow version ID for this call flow.
      required:
        - call_flow_version_id
      title: CallFlowVersionDeployByVersionId
    CallFlowVersionDeployRequest:
      oneOf:
        - $ref: '#/components/schemas/CallFlowVersionDeployByDocumentVersion'
        - $ref: '#/components/schemas/CallFlowVersionDeployByVersionId'
      title: CallFlowVersionDeployRequest
    CallFlowVersionDeployResponseFlowData:
      type: object
      properties: {}
      description: Call Flow Builder state, stored as an opaque JSON object.
      title: CallFlowVersionDeployResponseFlowData
    CallFlowVersionDeployResponseRelayml:
      type: object
      properties: {}
      description: >-
        The calling SWML document deployed by this version. Uses [calling SWML
        methods](/docs/swml/reference/calling).
      title: CallFlowVersionDeployResponseRelayml
    CallFlowVersionDeployResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: The unique identifier of the deployed Call Flow Version.
        created_at:
          type: string
          description: The creation timestamp.
        updated_at:
          type: string
          description: The last update timestamp.
        document_version:
          type: integer
          description: The document version.
        flow_data:
          $ref: '#/components/schemas/CallFlowVersionDeployResponseFlowData'
          description: Call Flow Builder state, stored as an opaque JSON object.
        relayml:
          $ref: '#/components/schemas/CallFlowVersionDeployResponseRelayml'
          description: >-
            The calling SWML document deployed by this version. Uses [calling
            SWML methods](/docs/swml/reference/calling).
      required:
        - id
        - created_at
        - updated_at
        - document_version
      title: CallFlowVersionDeployResponse
    Types.StatusCodes.RestApiErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The category of error.
        code:
          type: string
          description: A specific error code.
        message:
          type: string
          description: A description of what caused the error.
        attribute:
          type:
            - string
            - 'null'
          description: The request parameter that caused the error, if applicable.
        url:
          type: string
          description: A link to documentation about this error.
      required:
        - type
        - code
        - message
        - url
      description: Details about a specific error.
      title: Types.StatusCodes.RestApiErrorItem
    Types.StatusCodes.StatusCode422:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      required:
        - errors
      description: The request contains invalid parameters. See errors for details.
      title: Types.StatusCodes.StatusCode422
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (201)

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2024-05-06T12:20:00Z",
  "updated_at": "2024-05-06T12:25:00Z",
  "document_version": 2,
  "flow_data": {},
  "relayml": {
    "sections": {
      "main": [
        {
          "play": {
            "url": "https://cdn.signalwire.com/swml/audio.mp3"
          }
        }
      ]
    },
    "version": "1.0.0"
  }
}
```

## **Example**

```typescript {9}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

const result = await client.fabric.callFlows.deployVersion("call-flow-id", {
  call_flow_version_id: "version-id",
});
console.log(`Deployed version: ${result.id}`);
```