Skip to content

Update a client

PATCH
/products/{productId}/clients/{id}
curl --request PATCH \
--url https://api.motenya.app/v1/products/example/clients/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "kind": "company", "vatNumber": "example", "registrationNumber": "example", "addresses": [ { "label": "example", "line1": "example", "line2": "example", "city": "example", "region": "example", "postalCode": "example", "country": "example" } ], "tags": [ "example" ], "custom": "example" }'

Only the fields sent change; addresses and tags replace the whole list.

Requires crm:write.

productId
required
string
>= 1 characters <= 64 characters
id
required
string
>= 1 characters <= 64 characters
Media typeapplication/json
object
name
string | null
<= 200 characters
kind
string | null
Allowed values: company individual
vatNumber
string | null
<= 40 characters
registrationNumber
string | null
<= 40 characters
addresses
Array<object> | null
<= 10 items
object
label
string | null
<= 60 characters
line1
required
string
>= 1 characters <= 200 characters
line2
string | null
<= 200 characters
city
required
string
>= 1 characters <= 100 characters
region
string | null
<= 100 characters
postalCode
string | null
<= 20 characters
country
required

ISO 3166-1 alpha-2, e.g. RO.

string
>= 2 characters <= 2 characters
tags
Array<string> | null
<= 30 items
custom

Custom field values keyed by field key; null clears one. See GET /products/{productId}/custom-fields.

object | null

Success

Media typeapplication/json
object
id
required
string
>= 1 characters <= 64 characters
name
required
string
kind
required
string
Allowed values: company individual
vatNumber
required
string | null
registrationNumber
required
string | null
addresses
required
Array<object>
object
label
required
string | null
line1
required
string
line2
required
string | null
city
required
string
region
required
string | null
postalCode
required
string | null
country
required
string
tags
required
Array<string>
custom
required
object
key
additional properties
source
required
string
externalId
required
string | null
contacts
required
Array<object>
object
contactId
required
string
>= 1 characters <= 64 characters
name
required
string | null
email
required
string | null
role
required
string | null
createdAt
required
string
updatedAt
required
string
key
additional properties

Example

{
"kind": "company"
}

Invalid request

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing, invalid, revoked or expired API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing scope, API turned off, published article without publish scope, or account suspended

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Not found, or outside the knowledge bases this key may use

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Slug or translation already exists

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rejected by validation (e.g. unknown language or category)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rate limited; see Retry-After

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Internal error