---
title: Create a new unassigned stop
description: Create a new unassigned stop with the given data.
url: /api/v0.2b/unassigned-stops/createUnassignedStop
---

# Create a new unassigned stop

`POST /unassignedStops`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v0.2b
servers:
  - url: https://api.spoke.com/public/v0.2b
security:
  - BasicAuth: []
paths:
  /unassignedStops:
    post:
      operationId: createUnassignedStop
      summary: Create a new unassigned stop
      tags:
        - Unassigned Stops
      description: Create a new unassigned stop with the given data.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: object
                  properties:
                    addressName:
                      description: The name of the address. This will not be used for geocoding, and is only for the final address display purposes.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 255
                        - type: "null"
                    addressLineOne:
                      description: The first line of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 255
                        - type: "null"
                    addressLineTwo:
                      description: The second line of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 255
                        - type: "null"
                    city:
                      description: The city of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 100
                        - type: "null"
                    state:
                      description: The state of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 100
                        - type: "null"
                    zip:
                      description: The zip code of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 100
                        - type: "null"
                    country:
                      description: The country of the address.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 100
                        - type: "null"
                    latitude:
                      description: The latitude of the address in decimal degrees.
                      anyOf:
                        - type: number
                          minimum: -90
                          maximum: 90
                        - type: "null"
                    longitude:
                      description: The longitude of the address in decimal degrees.
                      anyOf:
                        - type: number
                          minimum: -180
                          maximum: 180
                        - type: "null"
                  additionalProperties: false
                  description: Address of the stop, at least one of the fields is required. If the latitude and longitude fields are set they will override any of the others. The addressName field is not used for geocoding and is only for display purposes.
                depot:
                  description: The Depot ID that this unassigned stop belongs to, in the format `depot/<id>`. If not provided, or null, it will default to the team's main depot.
                  anyOf:
                    - type: string
                      pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
                    - type: "null"
                timing:
                  anyOf:
                    - type: object
                      properties:
                        earliestAttemptTime:
                          description: Time of day of the earliest time this stop should happen
                          anyOf:
                            - type: object
                              properties:
                                hour:
                                  type: integer
                                  minimum: 0
                                  maximum: 23
                                  description: Hour of the day
                                minute:
                                  type: integer
                                  minimum: 0
                                  maximum: 59
                                  description: Minute of the hour
                              required:
                                - hour
                                - minute
                              additionalProperties: false
                              description: Time of day in hours and minutes. Use a 24 hour clock.
                            - type: "null"
                        latestAttemptTime:
                          description: Time of day of the latest time this stop should happen
                          anyOf:
                            - type: object
                              properties:
                                hour:
                                  type: integer
                                  minimum: 0
                                  maximum: 23
                                  description: Hour of the day
                                minute:
                                  type: integer
                                  minimum: 0
                                  maximum: 59
                                  description: Minute of the hour
                              required:
                                - hour
                                - minute
                              additionalProperties: false
                              description: Time of day in hours and minutes. Use a 24 hour clock.
                            - type: "null"
                        estimatedAttemptDuration:
                          description: Duration in seconds of the activity in this stop, only set if you want to override the default. This can be set up to 8 hours.
                          anyOf:
                            - type: integer
                              minimum: 1
                              maximum: 28800
                            - type: "null"
                      additionalProperties: false
                      description: Timing information for this stop
                    - type: "null"
                recipient:
                  anyOf:
                    - type: object
                      properties:
                        externalId:
                          description: External ID of the recipient, as defined by the API user
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                        email:
                          description: The email address of the recipient. Multiple emails are not supported.
                          anyOf:
                            - type: string
                              maxLength: 255
                              format: email
                              pattern: ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
                            - type: "null"
                        phone:
                          description: Phone number of the recipient
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                        name:
                          description: Name of the recipient
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                      additionalProperties: false
                      description: Recipient information for this stop
                    - type: "null"
                orderInfo:
                  anyOf:
                    - type: object
                      properties:
                        products:
                          description: Products in this stop
                          maxItems: 100
                          type: array
                          items:
                            type: string
                            minLength: 1
                            maxLength: 255
                        sellerOrderId:
                          description: Seller order ID
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                        sellerName:
                          description: Seller name
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                        sellerWebsite:
                          description: Seller website
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 255
                            - type: "null"
                      additionalProperties: false
                      description: Order information for this stop
                    - type: "null"
                paymentOnDelivery:
                  anyOf:
                    - type: object
                      properties:
                        amount:
                          description: Amount *in minor units* (e.g. cents) to be collected upon delivery
                          anyOf:
                            - type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            - type: "null"
                        currency:
                          description: Currency of the payment. Defaults to the team's currency.
                          anyOf:
                            - type: string
                              enum:
                                - AED
                                - ARS
                                - AUD
                                - BRL
                                - CAD
                                - CHF
                                - CLP
                                - CNY
                                - COP
                                - DKK
                                - EGP
                                - EUR
                                - GBP
                                - HKD
                                - HUF
                                - ILS
                                - INR
                                - JPY
                                - KRW
                                - MYR
                                - MXN
                                - NOK
                                - NZD
                                - PEN
                                - RON
                                - RUB
                                - SAR
                                - SEK
                                - SGD
                                - TRY
                                - USD
                                - UYU
                                - ZAR
                            - type: "null"
                      additionalProperties: false
                      description: Payment on delivery (also known as "Cash on Delivery") data for this stop
                    - type: "null"
                proofOfAttemptRequirements:
                  anyOf:
                    - type: object
                      properties:
                        enabled:
                          description: Whether proof of attempt is required for this stop
                          type:
                            - boolean
                            - "null"
                      additionalProperties: false
                      description: Proof of attempt requirement settings for this stop
                    - type: "null"
                allowedDrivers:
                  description: Driver IDs that are allowed to be assigned to this stop. If not provided, the stop will be assigned to any available driver during optimization.
                  anyOf:
                    - maxItems: 100
                      type: array
                      items:
                        type: string
                        pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
                    - type: "null"
                activity:
                  default: delivery
                  description: Activity type
                  anyOf:
                    - type: string
                      enum:
                        - delivery
                        - pickup
                    - type: "null"
                optimizationOrder:
                  description: The preferred order of this stop in the optimized route. If not provided or `"default"`, the stop will be placed in the optimal order, decided by the optimization algorithm. Otherwise it will be placed either `"first"` or `"last"`.
                  anyOf:
                    - type: string
                      enum:
                        - first
                        - last
                        - default
                    - type: "null"
                packageCount:
                  description: Number of packages in the stop
                  anyOf:
                    - type: number
                      minimum: 1
                      maximum: 10000
                    - type: "null"
                weight:
                  description: Weight information for this stop.
                  anyOf:
                    - type: object
                      properties:
                        amount:
                          type: number
                          minimum: 0
                          maximum: 999999
                          multipleOf: 0.01
                          description: The weight amount for this stop.
                        unit:
                          type: string
                          enum:
                            - kilogram
                            - pound
                            - metric-ton
                          description: The weight unit in which the amount is specified.
                      required:
                        - amount
                        - unit
                    - type: "null"
                notes:
                  description: Notes for the stop
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 2000
                    - type: "null"
                circuitClientId:
                  description: Client ID of the retailer in Spoke Connect
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 100
                    - type: "null"
                barcodes:
                  description: List of barcode IDs associated with this stop
                  maxItems: 200
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 255
                customProperties:
                  description: Key-value pairs of custom stop properties for this stop. The keys must be unique and match a custom stop property defined in your team.
                  anyOf:
                    - type: object
                      propertyNames:
                        type: string
                        maxLength: 50
                        description: The custom stop property id
                      additionalProperties:
                        anyOf:
                          - type: string
                            minLength: 1
                            maxLength: 255
                          - type: "null"
                        description: The value of the custom stop property, up to 255 characters.
                    - type: "null"
              required:
                - address
              additionalProperties: false
              description: The request body for creating an unassigned stop. Address is a required field, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set (and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be. The depotId field is not required, but will default to the main depot of the team if not provided, be sure to provide it if you want to use a different depot.
        required: true
        description: The request body for creating an unassigned stop. Address is a required field, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set (and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be. The depotId field is not required, but will default to the main depot of the team if not provided, be sure to provide it if you want to use a different depot.
      responses:
        "200":
          description: The created unassignedStop
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unassignedStopSchema"
                description: The created unassignedStop
        "400":
          description: The request has errors. Either syntactic or semantic
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: The request has errors. Either syntactic or semantic
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Unauthorized
        "403":
          description: The request contains fields that are not supported by your team subscription.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        type: string
                        description: The error message.
                      code:
                        type: string
                        enum:
                          - feature_not_in_subscription
                      url:
                        type: string
                        enum:
                          - https://dispatch.spoke.com/paywall
                    required:
                      - message
                      - code
                      - url
                    description: Feature not included in your team subscription
                description: The request contains fields that are not supported by your team subscription.
        "404":
          description: The driver or depot could not be found.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        anyOf:
                          - type: string
                            enum:
                              - Driver not found
                          - type: string
                    required:
                      - message
                    description: The provided driver id does not exist
                    title: Driver not found
                    x-response-description: The provided driver id does not exist
                  - type: object
                    properties:
                      message:
                        type: string
                        enum:
                          - Depot not found
                    required:
                      - message
                    description: The provided depot id does not exist
                    title: Depot not found
                    x-response-description: The provided depot id does not exist
                  - type: object
                    properties:
                      message:
                        type: string
                        enum:
                          - Main depot not found
                      code:
                        type: string
                        enum:
                          - main_depot_not_found
                    required:
                      - message
                      - code
                    description: The team has no main depot configured
                    title: Main depot not found
                description: The driver or depot could not be found.
        "422":
          description: The stop is unprocessable.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        anyOf:
                          - type: string
                            enum:
                              - An error occurred when creating the unassigned stop, but the error is not due to a validation error, instead it is another conflict, check if the provided data is semantically valid.
                          - type: string
                    required:
                      - message
                    description: Failed to create stop
                  - type: object
                    properties:
                      message:
                        type: string
                        description: The error message.
                      code:
                        type: string
                        enum:
                          - vehicle_capacity_disabled
                      url:
                        type: string
                        enum:
                          - https://dispatch.spoke.com/settings/team-profile
                    required:
                      - message
                      - code
                      - url
                    description: Vehicle capacity mode is disabled in the team's settings
                    x-response-description: Vehicle capacity mode is disabled in the team's settings
                description: The stop is unprocessable.
        "500":
          description: An internal server error occurred
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: An internal server error occurred
        default:
          description: The default error model
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: The default error model
components:
  schemas:
    timeOfDaySchema:
      type: object
      properties:
        hour:
          type: integer
          minimum: 0
          maximum: 23
          description: Hour of the day
        minute:
          type: integer
          minimum: 0
          maximum: 59
          description: Minute of the hour
      required:
        - hour
        - minute
      additionalProperties: false
      description: Time of day in hours and minutes. Uses a 24 hour clock.
    unassignedStopIdSchema:
      type: string
      pattern: ^unassignedStops\/[a-zA-Z0-9---_]{1,50}$
    unassignedStopSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/unassignedStopIdSchema"
          description: The id of the unassigned stop, in the format `unassignedStops/<id>`.
        depot:
          type: string
          pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
          description: The depot that this unassigned stop belongs to.
        address:
          type: object
          properties:
            address:
              type: string
              description: The address of the stop.
            addressLineOne:
              type: string
              description: The first line of the address.
            addressLineTwo:
              type: string
              description: The second line of the address.
            latitude:
              anyOf:
                - type: number
                  minimum: -90
                  maximum: 90
                - type: "null"
              description: The latitude of the address in decimal degrees.
            longitude:
              anyOf:
                - type: number
                  minimum: -180
                  maximum: 180
                - type: "null"
              description: The longitude of the address in decimal degrees.
            placeId:
              description: The identifier of the place corresponding to this stop on Google Places
              type:
                - "null"
                - string
            placeTypes:
              type: array
              items:
                type: string
              description: Array of strings that is provided by the Google AutoCompleteAPI
          required:
            - address
            - addressLineOne
            - addressLineTwo
            - latitude
            - longitude
            - placeId
            - placeTypes
          additionalProperties: false
          description: The address of the stop.
        barcodes:
          type: array
          items:
            type: string
          description: List of Barcode IDs associated with the stop.
        allowedDriversIdentifiers:
          type: array
          items:
            type: string
          description: The allowed drivers that can be assigned to this stop.
        notes:
          description: Notes for the stop.
          type:
            - "null"
            - string
        packageCount:
          description: The number of packages.
          type:
            - "null"
            - number
        weight:
          anyOf:
            - type: object
              properties:
                amount:
                  type: number
                  minimum: 0
                  description: The weight amount for this stop.
                unit:
                  type: string
                  enum:
                    - kilogram
                    - pound
                    - metric-ton
                  description: The weight unit in which the amount is specified (defined at team's capacity unit).
              required:
                - amount
                - unit
              additionalProperties: false
              description: Weight information for the stop.
            - type: "null"
        orderInfo:
          type: object
          properties:
            products:
              type: array
              items:
                type: string
              description: The products of the stop.
            sellerName:
              description: Name of the seller where the order is from.
              type:
                - "null"
                - string
            sellerOrderId:
              description: Id of the seller where the order is from.
              type:
                - "null"
                - string
            sellerWebsite:
              description: Website of the seller where the order is from.
              type:
                - "null"
                - string
          required:
            - products
            - sellerName
            - sellerOrderId
            - sellerWebsite
          additionalProperties: false
          description: The order information of the stop.
        recipient:
          type: object
          properties:
            name:
              description: The name of the recipient.
              type:
                - "null"
                - string
            email:
              description: The email of the recipient.
              type:
                - "null"
                - string
            phone:
              description: The phone of the recipient.
              type:
                - "null"
                - string
            externalId:
              description: The external id of the recipient.
              type:
                - "null"
                - string
          required:
            - name
            - email
            - phone
            - externalId
          additionalProperties: false
          description: The recipient of the stop.
        activity:
          default: delivery
          type: string
          enum:
            - delivery
            - pickup
        trackingLink:
          description: The recipient tracking link.
          type:
            - "null"
            - string
        timing:
          type: object
          properties:
            estimatedAttemptDuration:
              description: Time that the driver estimates to spend on the stop to do his job (deliver a parcel, visit a client, etc) in seconds.
              type:
                - "null"
                - number
            earliestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The earliest time that the driver should arrive at the stop
            latestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The latest time that the driver should arrive at the stop.
          required:
            - estimatedAttemptDuration
            - earliestAttemptTime
            - latestAttemptTime
          additionalProperties: false
          description: The timing data of the stop.
        optimizationOrder:
          default: default
          type: string
          enum:
            - first
            - last
            - default
        paymentOnDelivery:
          anyOf:
            - type: object
              properties:
                amount:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: "null"
                  description: The amount *in minor units* (e.g. cents) to be collected upon delivery.
                currency:
                  type: string
                  description: The payment's currency in ISO 4217 standard.
              required:
                - amount
                - currency
              additionalProperties: false
              description: The payment due upon delivery also known as "Cash on Delivery".
            - type: "null"
        proofOfAttemptRequirements:
          type: object
          properties:
            enabled:
              description: Whether the proof of attempt is enabled.This only works if the team subscription has access to proof of delivery
              type:
                - "null"
                - boolean
          required:
            - enabled
          additionalProperties: false
          description: The proof of attempt requirements of the stop.
        customProperties:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type:
                  - string
                  - "null"
            - type: "null"
          description: Custom properties of the stop, can be used to store additional information.
        circuitClientId:
          description: The associated Client ID of the Spoke Connect
          type:
            - "null"
            - string
      required:
        - id
        - depot
        - address
        - barcodes
        - allowedDriversIdentifiers
        - notes
        - packageCount
        - weight
        - orderInfo
        - recipient
        - trackingLink
        - timing
        - paymentOnDelivery
        - proofOfAttemptRequirements
        - customProperties
        - circuitClientId
      additionalProperties: false
      description: An unassigned stop.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````