Adding Organizations

Add existing organizations to your pipelines programmatically. AlphaLens creates a pipeline item and triggers all associated background processes including custom questions and CRM sync.

Add an Organization to a Pipeline

POST /api/v1/pipelines/{pipeline_id}/organizations

Add an existing organization to a pipeline by ID. This creates a new pipeline item and triggers all associated background processes (custom questions, CRM sync).

Access Control

Requires (CREATE, COLLECTION_ITEM) permission, enforced by the policy chain.

Parameters

Parameter

Type

Required

Description

pipeline_id

integer (path)

Yes

The pipeline identifier

organization_id

integer (body)

Yes

The ID of the organization to add

Request Body

json

{
  "organization_id": 0
}

Response — 201 Created

Returns a PipelineItemValuesResponse containing the created pipeline item and its associated values.

Field

Type

Description

pipeline_id

integer

The pipeline identifier

pipeline_item_id

integer

Unique identifier for the newly created pipeline item

entity_type

string

"organization"

organization_id

integer

The organization that was added

person_id

integer or null

Associated person ID, if applicable

document_id

integer or null

Associated document ID, if applicable

values

object

Column values keyed by column ID (see Values Object)

Errors

Status

Description

400

Pipeline is not an organization pipeline

401

Authentication required

403

Authorization denied by policy chain

404

Pipeline or organization not found

409

Organization already exists in pipeline

422

Validation error — check request body format

Example

bash

curl -X POST "/api/v1/pipelines/42/organizations" \
  -H "Content-Type: application/json" \
  -H "API-Key: your-api-key" \
  -d '{"organization_id": 1085}'