> ## Documentation Index
> Fetch the complete documentation index at: https://docs.journeybee.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Partner

> Update an existing partnership's details, assignments, and custom fields

## Authentication

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://app.journeybee.io/api/v1/partnerships/{partnershipId}" \
    -H "Authorization: Bearer your-api-key-uuid" \
    -H "Content-Type: application/json" \
    -d '{"tierId": 3, "assignedUsers": [123, 456]}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.journeybee.io/api/v1/partnerships/{partnershipId}', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer your-api-key-uuid',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tierId: 3,
      assignedUsers: [123, 456]
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="partnershipId" type="number" required>
  The unique identifier of the company partnership to update
</ParamField>

## Request Body Schema

<ParamField body="tierId" type="number">
  ID of the tier to assign to this partner (set to `null` to remove)
</ParamField>

<ParamField body="categoryId" type="number">
  ID of the category to assign to this partner (set to `null` to remove)
</ParamField>

<ParamField body="stageUuid" type="string">
  UUID of the stage to move this partner to
</ParamField>

<ParamField body="assignedUsers" type="array">
  Array of user IDs to assign to this partnership (replaces existing assignments)
</ParamField>

<ParamField body="tags" type="array">
  Array of tag IDs to assign to this partnership (replaces existing tags)
</ParamField>

<ParamField body="customFields" type="array">
  Array of custom field values to update

  <Expandable title="Custom Field Object">
    <ParamField body="customFieldId" type="number" required>
      ID of the custom field to update
    </ParamField>

    <ParamField body="type" type="string" required>
      Field type: `text`, `textarea`, `number`, `date`, `boolean`, `select`, `multi_select`
    </ParamField>

    <ParamField body="value" type="object" required>
      Field value object matching the field type

      <Expandable title="Value Object Examples">
        <ParamField body="text" type="string">For text fields</ParamField>
        <ParamField body="number" type="number">For number fields</ParamField>
        <ParamField body="date" type="string">For date fields (ISO format)</ParamField>
        <ParamField body="boolean" type="boolean">For boolean fields</ParamField>
        <ParamField body="select" type="number">For select fields (option ID)</ParamField>
        <ParamField body="multi_select" type="array">For multi-select fields (array of option IDs)</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="fallbackData" type="object">
  Fallback partner data for when partner company becomes inactive

  <Expandable title="Fallback Data Object">
    <ParamField body="name" type="string">Partner company name</ParamField>
    <ParamField body="logo_square_uuid" type="string">Logo asset UUID</ParamField>
    <ParamField body="website_url" type="string">Partner website URL</ParamField>
    <ParamField body="country_label" type="string">Country name</ParamField>
  </Expandable>
</ParamField>

## Response Schema

<ResponseField name="id" type="number">
  The updated company partnership ID
</ResponseField>

<ResponseField name="uuid" type="string">
  The partnership UUID
</ResponseField>

<ResponseField name="updated_at" type="string">
  Timestamp of when the partnership was last updated
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://app.journeybee.io/api/v1/companies/123/partnerships/789" \
    -H "Authorization: Bearer jb_api_1234567890abcdef" \
    -H "Content-Type: application/json" \
    -d '{
      "tierId": 3,
      "categoryId": 2,
      "stageUuid": "stage-uuid-456",
      "assignedUsers": [123, 456],
      "tags": [10, 11, 12],
      "customFields": [
        {
          "customFieldId": 5,
          "type": "number",
          "value": {
            "number": 150000
          }
        },
        {
          "customFieldId": 6,
          "type": "text",
          "value": {
            "text": "Updated notes about this partnership"
          }
        }
      ],
      "fallbackData": {
        "name": "TechCorp Solutions",
        "website_url": "https://techcorp.com",
        "country_label": "United States"
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const updateData = {
    tierId: 3,
    categoryId: 2,
    stageUuid: "stage-uuid-456",
    assignedUsers: [123, 456],
    tags: [10, 11, 12],
    customFields: [
      {
        customFieldId: 5,
        type: "number",
        value: {
          number: 150000
        }
      },
      {
        customFieldId: 6,
        type: "text",
        value: {
          text: "Updated notes about this partnership"
        }
      }
    ],
    fallbackData: {
      name: "TechCorp Solutions",
      website_url: "https://techcorp.com",
      country_label: "United States"
    }
  };

  const response = await fetch('https://app.journeybee.io/api/v1/companies/123/partnerships/789', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer jb_api_1234567890abcdef',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(updateData)
  });

  const updatedPartnership = await response.json();
  ```
</CodeGroup>

## Example Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": 789,
    "uuid": "partnership-uuid-789",
    "updated_at": "2024-01-15T14:30:00Z"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "Invalid field values or stage UUID not found"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 401 Unauthorized theme={null}
  {
    "error": "Invalid API key or insufficient permissions"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 403 Forbidden theme={null}
  {
    "error": "Write access required for this operation"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 404 Not Found theme={null}
  {
    "error": "Partnership not found or not accessible"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 409 Conflict theme={null}
  {
    "error": "Stage change not allowed due to business rules"
  }
  ```
</ResponseExample>

## Notes

* Requires API key with `write_access` permission
* All changes trigger webhook events for external integrations
