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 |
|---|---|---|---|
|
|
integer (path) |
Yes |
The pipeline identifier |
|
|
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 |
|---|---|---|
|
|
integer |
The pipeline identifier |
|
|
integer |
Unique identifier for the newly created pipeline item |
|
|
string |
|
|
|
integer |
The organization that was added |
|
|
integer or null |
Associated person ID, if applicable |
|
|
integer or null |
Associated document ID, if applicable |
|
|
object |
Column values keyed by column ID (see Values Object) |
Errors
|
Status |
Description |
|---|---|
|
|
Pipeline is not an organization pipeline |
|
|
Authentication required |
|
|
Authorization denied by policy chain |
|
|
Pipeline or organization not found |
|
|
Organization already exists in pipeline |
|
|
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}'