> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign phone number

> Points the voice side or the SMS side of a phone number at a project, optionally pinning an environment and a version. Only the side named by `target` changes, so moving a number that uses both sides takes one call per side.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json put /v1/stable/phone-number/{phoneNumberID}/assign
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/phone-number/{phoneNumberID}/assign:
    put:
      tags:
        - Phone Number
      summary: Assign phone number
      description: Points the voice side or the SMS side of a phone number at a
        project, optionally pinning an environment and a version. Only the side
        named by `target` changes, so moving a number that uses both sides takes
        one call per side.
      operationId: StablePhoneNumberController_assign
      parameters:
        - name: phoneNumberID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the phone number to operate on.
          description: The ID of the phone number to operate on.
        - name: workspaceID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the workspace the number belongs to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StablePhoneNumberAssignRequest"
      responses:
        "200":
          description: Confirms the phone number was assigned. The body is a message only,
            so refetch the phone number to see the `voice` or `sms` target it
            now answers as.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableUpdateResponse"
          x-vf-doc:
            description: Confirms the phone number was assigned. The body is a message only,
              so refetch the phone number to see the `voice` or `sms` target it
              now answers as.
      security:
        - token: []
components:
  schemas:
    StablePhoneNumberAssignRequest:
      type: object
      properties:
        target:
          type: string
          enum:
            - sms
            - voice
          description: "Which side of the number to point at the project: `voice` for
            incoming calls, `sms` for incoming SMS. The other side is left as it
            was."
          x-enumNames:
            - SMS
            - VOICE
        version:
          description: "Which version of the environment answers: `published`, the one
            serving live traffic, or `draft`, the working copy. Requires
            `environmentAlias`. Defaults to `published`."
          type: string
          enum:
            - draft
            - published
          x-enumNames:
            - DRAFT
            - PUBLISHED
        projectID:
          type: string
          description: The ID of the project the number should reach.
        environmentAlias:
          description: The alias of the environment that should answer (e.g. `main`). Omit
            it to assign the number to the project without pinning an
            environment, which also clears a pin a previous assign set.
          type: string
          minLength: 1
      required:
        - target
        - projectID
      additionalProperties: false
    StableUpdateResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message confirming the update.
      required:
        - message
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
