# Edit a Partnership Task

`PATCH https://api.suger.cloud/ai/org/{orgId}/prm/partnershipTask/{taskId}`

Change a task's title, description, priority, due date, assignees, tags, subtasks, resources or `assignedSide` (set it to INBOUND to hand the work to the partner). Fields you leave out stay as they are. `subtasks` and `resources` replace the whole list when sent; send back every resource the partner attached, since leaving one out answers 403 TASK_RESOURCE_REMOVAL_NOT_ALLOWED. Send the task's current `version` (from GetPartnershipTask): a stale one is refused with 409 TASK_VERSION_CONFLICT, so read the task again and retry. `taskId` is the task's `id` from ListPartnershipTasks.

On a task received from the partner (`direction` INBOUND) this organization can change only its assignees, resources and `cppoOfferId`, and its subtasks' assignees, plus their statuses when the task is assigned to it (`assignedSide` INBOUND or BOTH); the subtasks must keep their titles, priorities and order. Any other change answers 403 TASK_PARTNER_SIDE_NOT_ALLOWED. To change its status, call TransitionPartnershipTask.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `taskId` | path | string | yes | Task ID |

## Request Body

Required.

Content-Type: `application/json` · Schema: `UpdatePartnershipTaskRequest`

**`UpdatePartnershipTaskRequest`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `assignedSide` | string | no |  |
| `assigneeUserIds` | array<string> | no | AssigneeUserIDs replaces the full list of assignees on this side when set. nil = unchanged; empty slice = clear all; non-empty = replace. |
| `cppoOfferId` | string | no | pass empty string to clear |
| `description` | string | no |  |
| `direction` | string | no |  |
| `dueAt` | string | no | pass the zero time ("0001-01-01T00:00:00Z") to clear |
| `priority` | string | no |  |
| `referralId` | string | no | pass empty string to clear |
| `resources` | array<PartnershipTaskResource> | no | full-array replacement when set |
| `subtasks` | array<PartnershipSubtask> | no | full-array replacement when set |
| `tags` | array<string> | no |  |
| `title` | string | no |  |
| `version` | integer | no |  |

**`PartnershipTaskResource`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `attachedByOrgId` | string | no | AttachedByOrgID records which org's user attached this resource. The PATCH path uses it to enforce per-attacher delete: only the org that attached a resource may remove it. Empty values are treated as source-side-owned by the update validator (legacy rows from before this field existed); only the source org can prune them. |
| `displayName` | string | no |  |
| `externalUrl` | string | no |  |
| `file` | PartnershipTaskResourceFile | no |  |
| `kind` | string | no |  |
| `partnerFileId` | string | no |  |

**`PartnershipSubtask`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `assigneeUserId` | string | no | AssigneeUserID is the org-local user assigned to this subtask. Per-side: each mirror row carries its own value and it is not synced across the partnership pair. |
| `completedAt` | string | no | CompletedAt is stamped by the server when a subtask is saved with status == COMPLETED and CompletedAt is nil, so clients can just flip the status and let the server handle the timestamp. |
| `priority` | string | no |  |
| `status` | string | no |  |
| `title` | string | no |  |

**`PartnershipTaskResourceFile`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `available` | boolean | no |  |
| `name` | string | no |  |
| `sizeBytes` | integer | no |  |
| `type` | string | no |  |

## Responses

### 200 — Updated task

Content-Type: `application/json` · Schema: `PartnershipTask`

**`PartnershipTask`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `assignedSide` | string | no | OUTBOUND, INBOUND, or BOTH — which side does the work. Stored verbatim on both mirror rows (not flipped). |
| `assigneeUserIds` | array<string> | no | User IDs assigned to this task on this side. |
| `category` | string | no | Set from template.category at materialization; null otherwise |
| `completedAt` | string | no | Set when status moves to COMPLETED; cleared on reopen |
| `cppoOfferId` | string | no | Optional link to workload.offer.id (must be CPPO-typed and share partnership) |
| `createTime` | string | no | Creation timestamp |
| `createdByUserId` | string | no | Creator's user id. NULL on mirror rows (partner org has no real creator user). |
| `createdByUserName` | string | no | Display name of the creator — both mirror rows carry the same value |
| `description` | string | no | Optional free-form description |
| `direction` | string | no | OUTBOUND or INBOUND. |
| `dueAt` | string | no | Target due date |
| `id` | string | no | ID of the ent. Unique partnership task identifier (UUID) |
| `info` | PartnershipTaskInfo | no |  |
| `lastUpdateTime` | string | no | Last update timestamp |
| `organizationId` | string | no | ISV org id — tenant isolation |
| `partnershipId` | string | no |  |
| `priority` | string | no | URGENT, HIGH, NORMAL, LOW. |
| `referralId` | string | no | Optional link to cosell.referral.id — validated to share partnership at write time |
| `status` | string | no | OPEN, IN_PROGRESS, BLOCKED, COMPLETED. |
| `tags` | array<string> | no | Free-form tag strings. |
| `taskPairId` | string | no | Shared UUID that links the two mirror rows across a partnership |
| `templateId` | string | no | Optional provenance link to prm.partnership_task_template.id — snapshot semantics |
| `title` | string | no | Task title |
| `version` | integer | no | Optimistic-concurrency counter; bumped on every write |

**`PartnershipTaskInfo`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `autoAssignUnresolved` | boolean | no | AutoAssignUnresolved is set when a role-based assignee was requested at create time but resolved to no one on either side. The task may still carry fixed assignees from the request; the UI shows the "no matching contact" warning badge only while the row has no assignees. On the partner-side mirror row the flag is set only for external roles; resolution FAILURES (as opposed to a genuine no-match) leave it unset. |
| `journeyAssignmentId` | string | no | JourneyAssignmentID / JourneyStepID link a task materialized from a journey CUSTOM_TASK step back to that step. Set only on journey tasks; drives the "Journey task" badge and the bidirectional step↔task completion sync. Stored here (not as columns) to avoid a partnership_task migration. |
| `journeyStepId` | string | no |  |
| `resources` | array<PartnershipTaskResource> | no |  |
| `subtasks` | array<PartnershipSubtask> | no |  |
| `marketingPoints` | MarketingPointsRequest | no |  |

**`PartnershipTaskResource`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `attachedByOrgId` | string | no | AttachedByOrgID records which org's user attached this resource. The PATCH path uses it to enforce per-attacher delete: only the org that attached a resource may remove it. Empty values are treated as source-side-owned by the update validator (legacy rows from before this field existed); only the source org can prune them. |
| `displayName` | string | no |  |
| `externalUrl` | string | no |  |
| `file` | PartnershipTaskResourceFile | no |  |
| `kind` | string | no |  |
| `partnerFileId` | string | no |  |

**`PartnershipSubtask`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `assigneeUserId` | string | no | AssigneeUserID is the org-local user assigned to this subtask. Per-side: each mirror row carries its own value and it is not synced across the partnership pair. |
| `completedAt` | string | no | CompletedAt is stamped by the server when a subtask is saved with status == COMPLETED and CompletedAt is nil, so clients can just flip the status and let the server handle the timestamp. |
| `priority` | string | no |  |
| `status` | string | no |  |
| `title` | string | no |  |

**`MarketingPointsRequest`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activityTypeId` | string | no |  |
| `activityName` | string | no |  |
| `points` | integer | no |  |
| `activityDate` | string | no |  |
| `journeyAssignmentId` | string | no |  |
| `journeyStepId` | string | no |  |

**`PartnershipTaskResourceFile`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `available` | boolean | no |  |
| `name` | string | no |  |
| `sizeBytes` | integer | no |  |
| `type` | string | no |  |

### 400 — Validation error

Content-Type: `application/json`

### 409 — Version conflict or referral/CPPO mismatch

Content-Type: `application/json`

### 500 — Internal server error

Content-Type: `application/json`

## Example

_The request bodies are this operation's documented examples; the response and error bodies are generated from its schema. Substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.fours.com/settings/oauth-app/)._

### Request

```bash
curl -X PATCH 'https://api.suger.cloud/ai/org/{orgId}/prm/partnershipTask/{taskId}' \
  -H "Authorization: Bearer $SUGER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "version": 3,
  "priority": "URGENT",
  "dueAt": "2026-11-27T17:00:00Z"
}'
```

### Response — 200

```json
{
  "assignedSide": "string",
  "assigneeUserIds": [
    "01H0000000000000000000"
  ],
  "category": "string",
  "completedAt": "string",
  "cppoOfferId": "01H0000000000000000000",
  "createTime": "2026-01-31T12:00:00Z",
  "createdByUserId": "01H0000000000000000000",
  "createdByUserName": "Acme Corp",
  "description": "string",
  "direction": "string",
  "dueAt": "string",
  "id": "01H0000000000000000000"
}
```

### Error — 400

```json
"string"
```

---

API reference: https://doc.fours.com/api/
