Update a package

PATCH
/api/v1/orgs/{orgId}/deals/{dealId}/packages/{packageId}

Updates package fields (name only in v1). Set deal-level fields such as transactionType or amount when creating the deal with createDeal; updatePackage does not change them. Works on a template deal as well as a live deal; the response then includes isTemplate=true.

Requires the api_deals_create scope.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

dealId
required
string

Deal ID that owns the package

Formatuuid
packageId
required
string

Package ID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
name
required
string
Length1 <= length <= 200

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://app.goclai.com/api/v1/orgs/org_2abc123/deals/550e8400-e29b-41d4-a716-446655440010/packages/550e8400-e29b-41d4-a716-446655440011" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
  "dealId": "f480fdfe-5c44-458b-b537-f3d9f40f9678",
  "name": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "isTemplate": true
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}