Class: HubSpotSDK::Resources::Crm::Pipelines

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/crm/pipelines.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Pipelines

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Pipelines.

Parameters:



488
489
490
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 488

def initialize(client:)
  @client = client
end

Instance Method Details

#create(object_type, display_order:, label:, stages:, pipeline_id: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::Pipeline

Some parameter documentations has been truncated, see Models::Crm::PipelineCreateParams for more details.

Create a new pipeline with the provided property values. The entire pipeline object, including its unique ID, will be returned in the response.

Parameters:

  • object_type (String)
  • display_order (Integer)

    The order for displaying this pipeline. If two pipelines have a matching ‘displa

  • label (String)

    A unique label used to organize pipelines in HubSpot’s UI

  • stages (Array<HubSpotSDK::Models::Crm::PipelineStageInput>)

    Pipeline stage inputs used to create the new or replacement pipeline.

  • pipeline_id (String)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 30

def create(object_type, params)
  parsed, options = HubSpotSDK::Crm::PipelineCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["crm/pipelines/2026-03/%1$s", object_type],
    body: parsed,
    model: HubSpotSDK::Crm::Pipeline,
    options: options
  )
end

#create_stage(pipeline_id, object_type:, display_order:, label:, metadata:, stage_id: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PipelineStage

Some parameter documentations has been truncated, see Models::Crm::PipelineCreateStageParams for more details.

Create a pipeline stage

Parameters:

  • pipeline_id (String)

    Path param

  • object_type (String)

    Path param

  • display_order (Integer)

    Body param: The order for displaying this pipeline stage. If two pipeline stages

  • label (String)

    Body param: A label used to organize pipeline stages in HubSpot’s UI. Each pipel

  • metadata (Hash{Symbol=>String})

    Body param: A JSON object containing properties that are not present on all obje

  • stage_id (String)

    Body param

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 168

def create_stage(pipeline_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineCreateStageParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages", object_type, pipeline_id],
    body: parsed,
    model: HubSpotSDK::Crm::PipelineStage,
    options: options
  )
end

#delete(pipeline_id, object_type:, validate_deal_stage_usages_before_delete: nil, validate_references_before_delete: nil, request_options: {}) ⇒ nil

Delete a pipeline

Parameters:

  • pipeline_id (String)

    Path param

  • object_type (String)

    Path param

  • validate_deal_stage_usages_before_delete (Boolean)

    Query param

  • validate_references_before_delete (Boolean)

    Query param

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 125

def delete(pipeline_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineDeleteParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["crm/pipelines/2026-03/%1$s/%2$s", object_type, pipeline_id],
    query: query.transform_keys(
      validate_deal_stage_usages_before_delete: "validateDealStageUsagesBeforeDelete",
      validate_references_before_delete: "validateReferencesBeforeDelete"
    ),
    model: NilClass,
    options: options
  )
end

#delete_stage(stage_id, object_type:, pipeline_id:, request_options: {}) ⇒ nil

Delete a pipeline stage

Parameters:

  • stage_id (String)
  • object_type (String)
  • pipeline_id (String)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 195

def delete_stage(stage_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineDeleteStageParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  pipeline_id =
    parsed.delete(:pipeline_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages/%3$s", object_type, pipeline_id, stage_id],
    model: NilClass,
    options: options
  )
end

#get(pipeline_id, object_type:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::Pipeline

Return a single pipeline object identified by its unique ‘pipelineId`.

Parameters:

Returns:

See Also:



224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 224

def get(pipeline_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineGetParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s/%2$s", object_type, pipeline_id],
    model: HubSpotSDK::Crm::Pipeline,
    options: options
  )
end

#get_stage(stage_id, object_type:, pipeline_id:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PipelineStage

Return a pipeline stage by ID

Parameters:

  • stage_id (String)
  • object_type (String)
  • pipeline_id (String)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 250

def get_stage(stage_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineGetStageParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  pipeline_id =
    parsed.delete(:pipeline_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages/%3$s", object_type, pipeline_id, stage_id],
    model: HubSpotSDK::Crm::PipelineStage,
    options: options
  )
end

#list(object_type, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePipelineNoPaging

Return all pipelines for the object type specified by ‘objectType`.

Parameters:

Returns:

See Also:



99
100
101
102
103
104
105
106
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 99

def list(object_type, params = {})
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s", object_type],
    model: HubSpotSDK::Crm::CollectionResponsePipelineNoPaging,
    options: params[:request_options]
  )
end

#list_audit(pipeline_id, object_type:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePublicAuditInfoNoPaging

Return a reverse chronological list of all mutations that have occurred on the pipeline identified by ‘pipelineId`.

Parameters:

Returns:

See Also:



280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 280

def list_audit(pipeline_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineListAuditParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/audit", object_type, pipeline_id],
    model: HubSpotSDK::Crm::CollectionResponsePublicAuditInfoNoPaging,
    options: options
  )
end

#list_stage_audit(stage_id, object_type:, pipeline_id:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePublicAuditInfoNoPaging

Return a reverse chronological list of all mutations that have occurred on the pipeline stage identified by ‘stageId`.

Parameters:

  • stage_id (String)
  • object_type (String)
  • pipeline_id (String)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 307

def list_stage_audit(stage_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineListStageAuditParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  pipeline_id =
    parsed.delete(:pipeline_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages/%3$s/audit", object_type, pipeline_id, stage_id],
    model: HubSpotSDK::Crm::CollectionResponsePublicAuditInfoNoPaging,
    options: options
  )
end

#list_stages(pipeline_id, object_type:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePipelineStageNoPaging

Return all the stages associated with the pipeline identified by ‘pipelineId`.

Parameters:

Returns:

See Also:



336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 336

def list_stages(pipeline_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineListStagesParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages", object_type, pipeline_id],
    model: HubSpotSDK::Crm::CollectionResponsePipelineStageNoPaging,
    options: options
  )
end

#update(pipeline_id, object_type:, validate_deal_stage_usages_before_delete: nil, validate_references_before_delete: nil, archived: nil, display_order: nil, label: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::Pipeline

Some parameter documentations has been truncated, see Models::Crm::PipelineUpdateParams for more details.

Perform a partial update of the pipeline identified by ‘pipelineId`. The updated pipeline will be returned in the response.

Parameters:

  • pipeline_id (String)

    Path param

  • object_type (String)

    Path param

  • validate_deal_stage_usages_before_delete (Boolean)

    Query param

  • validate_references_before_delete (Boolean)

    Query param

  • archived (Boolean)

    Body param: Whether the pipeline is archived. This property should only be provi

  • display_order (Integer)

    Body param: The order for displaying this pipeline. If two pipelines have a matc

  • label (String)

    Body param: A unique label used to organize pipelines in HubSpot’s UI

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 68

def update(pipeline_id, params)
  query_params = [:validate_deal_stage_usages_before_delete, :validate_references_before_delete]
  parsed, options = HubSpotSDK::Crm::PipelineUpdateParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["crm/pipelines/2026-03/%1$s/%2$s", object_type, pipeline_id],
    query: query.transform_keys(
      validate_deal_stage_usages_before_delete: "validateDealStageUsagesBeforeDelete",
      validate_references_before_delete: "validateReferencesBeforeDelete"
    ),
    body: parsed.except(*query_params),
    model: HubSpotSDK::Crm::Pipeline,
    options: options
  )
end

#update_all_properties(pipeline_id, object_type:, display_order:, label:, stages:, validate_deal_stage_usages_before_delete: nil, validate_references_before_delete: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::Pipeline

Some parameter documentations has been truncated, see Models::Crm::PipelineUpdateAllPropertiesParams for more details.

Replace a pipeline

Parameters:

  • pipeline_id (String)

    Path param

  • object_type (String)

    Path param

  • display_order (Integer)

    Body param: The order for displaying this pipeline stage. If two pipeline stages

  • label (String)

    Body param: A label used to organize pipeline stages in HubSpot’s UI. Each pipel

  • stages (Array<HubSpotSDK::Models::Crm::PipelineStageInput>)

    Body param: The stages associated with the pipeline. They can be retrieved and u

  • validate_deal_stage_usages_before_delete (Boolean)

    Query param

  • validate_references_before_delete (Boolean)

    Query param

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 376

def update_all_properties(pipeline_id, params)
  query_params = [:validate_deal_stage_usages_before_delete, :validate_references_before_delete]
  parsed, options = HubSpotSDK::Crm::PipelineUpdateAllPropertiesParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["crm/pipelines/2026-03/%1$s/%2$s", object_type, pipeline_id],
    query: query.transform_keys(
      validate_deal_stage_usages_before_delete: "validateDealStageUsagesBeforeDelete",
      validate_references_before_delete: "validateReferencesBeforeDelete"
    ),
    body: parsed.except(*query_params),
    model: HubSpotSDK::Crm::Pipeline,
    options: options
  )
end

#update_stage(stage_id, object_type:, pipeline_id:, metadata:, archived: nil, display_order: nil, label: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PipelineStage

Some parameter documentations has been truncated, see Models::Crm::PipelineUpdateStageParams for more details.

Parameters:

  • stage_id (String)

    Path param

  • object_type (String)

    Path param

  • pipeline_id (String)

    Path param

  • metadata (Hash{Symbol=>String})

    Body param: A JSON object containing properties that are not present on all obje

  • archived (Boolean)

    Body param: Whether the pipeline is archived.

  • display_order (Integer)

    Body param: The order for displaying this pipeline stage. If two pipeline stages

  • label (String)

    Body param: A label used to organize pipeline stages in HubSpot’s UI. Each pipel

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 421

def update_stage(stage_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineUpdateStageParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  pipeline_id =
    parsed.delete(:pipeline_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages/%3$s", object_type, pipeline_id, stage_id],
    body: parsed,
    model: HubSpotSDK::Crm::PipelineStage,
    options: options
  )
end

#update_stage_all_properties(stage_id, object_type:, pipeline_id:, display_order:, label:, metadata:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PipelineStage

Some parameter documentations has been truncated, see Models::Crm::PipelineUpdateStageAllPropertiesParams for more details.

Replace all the properties of an existing pipeline stage with the values provided. The updated stage will be returned in the response.

Parameters:

  • stage_id (String)

    Path param

  • object_type (String)

    Path param

  • pipeline_id (String)

    Path param

  • display_order (Integer)

    Body param: The order for displaying this pipeline stage. If two pipeline stages

  • label (String)

    Body param: A label used to organize pipeline stages in HubSpot’s UI. Each pipel

  • metadata (Hash{Symbol=>String})

    Body param: A JSON object containing properties that are not present on all obje

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/hubspot_sdk/resources/crm/pipelines.rb', line 466

def update_stage_all_properties(stage_id, params)
  parsed, options = HubSpotSDK::Crm::PipelineUpdateStageAllPropertiesParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  pipeline_id =
    parsed.delete(:pipeline_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["crm/pipelines/2026-03/%1$s/%2$s/stages/%3$s", object_type, pipeline_id, stage_id],
    body: parsed,
    model: HubSpotSDK::Crm::PipelineStage,
    options: options
  )
end