View Source ExPipedrive.OrganizationLabels (ex_pipedrive v0.2.0)

Organization label definitions via the system label_ids field.

Pipedrive does not expose a dedicated organizationLabels endpoint — organization labels are option values on the label_ids field returned by GET /api/v2/organizationFields. This module wraps the API v2 bulk field-options endpoints (POST / PATCH / DELETE /api/v2/organizationFields/label_ids/options) so label definitions can be listed and managed without hand-rolling ExPipedrive.Raw calls.

Assigning or clearing labels on an organization is done through ExPipedrive.Organizations.update/3 with a label_ids attribute (a list of label ids) — there is no separate assign/clear endpoint.

Summary

Functions

Adds an organization label via POST /api/v2/organizationFields/label_ids/options.

Deletes an organization label via DELETE /api/v2/organizationFields/label_ids/options.

Lists organization label definitions via GET /api/v2/organizationFields/label_ids.

Updates an organization label via PATCH /api/v2/organizationFields/label_ids/options.

Functions

@spec create(Tesla.Client.t(), term()) ::
  {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}

Adds an organization label via POST /api/v2/organizationFields/label_ids/options.

Accepts a map (preferred) or %Label{} with :label and optional :color. Returns the created %Label{}.

@spec delete(Tesla.Client.t(), term()) ::
  {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}

Deletes an organization label via DELETE /api/v2/organizationFields/label_ids/options.

Returns the deleted %Label{}.

@spec list(Tesla.Client.t()) ::
  {:ok, [ExPipedrive.Label.t()]} | {:error, ExPipedrive.Error.t()}

Lists organization label definitions via GET /api/v2/organizationFields/label_ids.

Link to this function

update(client, id, attrs)

View Source
@spec update(Tesla.Client.t(), term(), term()) ::
  {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}

Updates an organization label via PATCH /api/v2/organizationFields/label_ids/options.