         // construct REST request
         let request = RestRequest(
             method: "POST",
-            url: serviceURL + "/v1/environments/\(environmentID)/collections/\(collectionID)/documents",
+            url: serviceURL + "/v1/environments/\(environmentID)/collections/\(collectionID)/documents/\(documentID)",
             credentials: .apiKey,
             headerParameters: defaultHeaders,
             acceptType: "application/json",

            multipartFormData.append(type, withName: "type")
        }
        if let metadata = metadata {
            multipartFormData.append(metadata, withName: "metadata")
        }
        if let configuration = configuration {
            multipartFormData.append(configuration, withName: "configuration")
        }
        guard let body = try? multipartFormData.toData() else {
            failure?(RestError.encodingError)

            multipartFormData.append(type, withName: "type")
        }
        if let metadata = metadata {
            guard let data = try? Data(contentsOf: metadata) else {
                failure?(RestError.encodingError)
                return
            }
            multipartFormData.append(data, withName: "metadata")
        }
        if let configuration = configuration {
            guard let data = try? Data(contentsOf: configuration) else {
                failure?(RestError.encodingError)
                return
            }
            multipartFormData.append(data, withName: "configuration")
        }
        guard let body = try? multipartFormData.toData() else {
            failure?(RestError.encodingError)
