# STAKEHOLDERS

stakeholders endpoints.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### POST /stakeholder-types/:type_id/members

Add a contact to a stakeholder type. Requires contact_id.

**Scopes:** `contacts:write` — [full detail](./stakeholders/post-stakeholder-types-type-id-members.md)

### POST /tasks/:task_id/stakeholders

Assign a stakeholder to a task. The contact must belong to a stakeholder type with "assignable to work" enabled. The task appears in that stakeholder's portal My Tasks tab.

**Scopes:** `opportunities:write` — [full detail](./stakeholders/post-tasks-task-id-stakeholders.md)

### POST /work-orders/:work_order_id/stakeholders

Assign a stakeholder to a work order. The contact must belong to a stakeholder type with "assignable to work" enabled. Also shares the work order into that stakeholder's portal so it shows in their Work Orders tab.

**Scopes:** `opportunities:write` — [full detail](./stakeholders/post-work-orders-work-order-id-stakeholders.md)

### POST /deal-stakeholders

Attach a stakeholder contact to an opportunity. Requires deal_id and contact_id; optional bucket_id (the stakeholder type) and role.

**Scopes:** `opportunities:write` — [full detail](./stakeholders/post-deal-stakeholders.md)

### POST /stakeholder-types

Create a stakeholder type. Requires name; optional capability flags default to off.

**Scopes:** `contacts:write` — [full detail](./stakeholders/post-stakeholder-types.md)

### DELETE /stakeholder-types/:type_id

Delete a stakeholder type by UUID. Destructive; its membership links go too.

**Scopes:** `contacts:delete` — [full detail](./stakeholders/delete-stakeholder-types-type-id.md)

### DELETE /deal-stakeholders/:id

Detach a stakeholder from an opportunity by the attachment row UUID.

**Scopes:** `opportunities:delete` — [full detail](./stakeholders/delete-deal-stakeholders-id.md)

### GET /stakeholder-types/:type_id

Fetch a single stakeholder type by UUID.

**Scopes:** `contacts:read` — [full detail](./stakeholders/get-stakeholder-types-type-id.md)

### GET /deal-stakeholders

List the external stakeholders attached to an opportunity. Requires the deal_id query parameter.

**Scopes:** `opportunities:read` — [full detail](./stakeholders/get-deal-stakeholders.md)

### GET /stakeholder-types/:type_id/members

List the contacts in a stakeholder type.

**Scopes:** `contacts:read` — [full detail](./stakeholders/get-stakeholder-types-type-id-members.md)

### GET /stakeholder-types

List stakeholder types (external-people groups such as Contractors, Referrers, Partners) with their capability flags (portal_eligible, commission_eligible, assignable_to_work_orders).

**Scopes:** `contacts:read` — [full detail](./stakeholders/get-stakeholder-types.md)

### GET /tasks/:task_id/stakeholders

List the stakeholders assigned to a task.

**Scopes:** `opportunities:read` — [full detail](./stakeholders/get-tasks-task-id-stakeholders.md)

### GET /work-orders/:work_order_id/stakeholders

List the stakeholders (e.g. contractors) assigned to a work order.

**Scopes:** `opportunities:read` — [full detail](./stakeholders/get-work-orders-work-order-id-stakeholders.md)

### DELETE /stakeholder-types/:type_id/members/:member_id

Remove a contact from a stakeholder type by the membership row UUID.

**Scopes:** `contacts:delete` — [full detail](./stakeholders/delete-stakeholder-types-type-id-members-member-id.md)

### DELETE /tasks/:task_id/stakeholders/:contact_id

Unassign a stakeholder from a task by contact UUID.

**Scopes:** `opportunities:delete` — [full detail](./stakeholders/delete-tasks-task-id-stakeholders-contact-id.md)

### DELETE /work-orders/:work_order_id/stakeholders/:contact_id

Unassign a stakeholder from a work order by contact UUID.

**Scopes:** `opportunities:delete` — [full detail](./stakeholders/delete-work-orders-work-order-id-stakeholders-contact-id.md)

### PATCH /stakeholder-types/:type_id

Update a stakeholder type (name, colour, or the capability flags). Pass only the fields you want to change.

**Scopes:** `contacts:write` — [full detail](./stakeholders/patch-stakeholder-types-type-id.md)
