@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Pipelines
@base https://api.hubapi.com
@version v3
@auth OAuth2 | ApiKey private-app-legacy in header | ApiKey private-app in header
@common_fields {objectType: str}
@endpoints 14
@toc crm(14)

@endpoint GET /crm/v3/pipelines/{objectType}
@returns(200) {results: [map]}

@endpoint POST /crm/v3/pipelines/{objectType}
@required {displayOrder: int(int32), label: str, stages: [map{displayOrder!: int(int32), label!: str, metadata!: map, stageId: str}]}
@optional {pipelineId: str}
@returns(201) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, stages: [map], updatedAt: str(date-time)}

@endpoint GET /crm/v3/pipelines/{objectType}/{pipelineId}
@required {pipelineId: str}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, stages: [map], updatedAt: str(date-time)}

@endpoint PUT /crm/v3/pipelines/{objectType}/{pipelineId}
@required {pipelineId: str, displayOrder: int(int32), label: str, stages: [map{displayOrder!: int(int32), label!: str, metadata!: map, stageId: str}]}
@optional {validateDealStageUsagesBeforeDelete: bool=false, validateReferencesBeforeDelete: bool=false}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, stages: [map], updatedAt: str(date-time)}

@endpoint DELETE /crm/v3/pipelines/{objectType}/{pipelineId}
@required {pipelineId: str}
@optional {validateDealStageUsagesBeforeDelete: bool=false, validateReferencesBeforeDelete: bool=false}
@returns(204)

@endpoint PATCH /crm/v3/pipelines/{objectType}/{pipelineId}
@required {pipelineId: str}
@optional {validateDealStageUsagesBeforeDelete: bool=false, validateReferencesBeforeDelete: bool=false, archived: bool, displayOrder: int(int32), label: str}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, stages: [map], updatedAt: str(date-time)}

@endpoint GET /crm/v3/pipelines/{objectType}/{pipelineId}/audit
@required {pipelineId: str}
@returns(200) {results: [map]}

@endpoint GET /crm/v3/pipelines/{objectType}/{pipelineId}/stages
@required {pipelineId: str}
@returns(200) {results: [map]}

@endpoint POST /crm/v3/pipelines/{objectType}/{pipelineId}/stages
@required {pipelineId: str, displayOrder: int(int32), label: str, metadata: map}
@optional {stageId: str}
@returns(201) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, metadata: map, updatedAt: str(date-time), writePermissions: str}

@endpoint GET /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}
@required {pipelineId: str, stageId: str}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, metadata: map, updatedAt: str(date-time), writePermissions: str}

@endpoint PUT /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}
@required {pipelineId: str, stageId: str, displayOrder: int(int32), label: str, metadata: map}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, metadata: map, updatedAt: str(date-time), writePermissions: str}

@endpoint DELETE /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}
@required {pipelineId: str, stageId: str}
@returns(204)

@endpoint PATCH /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}
@required {pipelineId: str, stageId: str, metadata: map}
@optional {archived: bool, displayOrder: int(int32), label: str}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), displayOrder: int(int32), id: str, label: str, metadata: map, updatedAt: str(date-time), writePermissions: str}

@endpoint GET /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}/audit
@required {pipelineId: str, stageId: str}
@returns(200) {results: [map]}

@end
