View Source ExPipedrive.PersonLabels (ex_pipedrive v0.2.0)
Person label definitions via the system label_ids field.
Pipedrive does not expose a dedicated personLabels endpoint — person
labels are option values on the label_ids field returned by GET /api/v2/personFields. This module wraps the API v2 bulk field-options
endpoints (POST / PATCH / DELETE /api/v2/personFields/label_ids/options) so label definitions can be
listed and managed without hand-rolling ExPipedrive.Raw calls.
Assigning or clearing labels on a person is done through
ExPipedrive.Persons.update/3 with a label_ids attribute (a list of
label ids) — there is no separate assign/clear endpoint.
Summary
Functions
Adds a person label via POST /api/v2/personFields/label_ids/options.
Deletes a person label via DELETE /api/v2/personFields/label_ids/options.
Lists person label definitions via GET /api/v2/personFields/label_ids.
Updates a person label via PATCH /api/v2/personFields/label_ids/options.
Functions
@spec create(Tesla.Client.t(), term()) :: {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}
Adds a person label via POST /api/v2/personFields/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 a person label via DELETE /api/v2/personFields/label_ids/options.
Returns the deleted %Label{}.
@spec list(Tesla.Client.t()) :: {:ok, [ExPipedrive.Label.t()]} | {:error, ExPipedrive.Error.t()}
Lists person label definitions via GET /api/v2/personFields/label_ids.
@spec update(Tesla.Client.t(), term(), term()) :: {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}
Updates a person label via PATCH /api/v2/personFields/label_ids/options.