Изменить организацию CRM
/api/v1/developer/crm/organizations/{organizationId}Идемпотентно изменяет CRM-атрибуты либо приводит lifecycle организации к active/archived.
Право доступаcrm.organizations.write
Authorization: Bearer YOUR_PROJECT_TOKEN
Параметры
organizationIdобязательно · pathstringminLength: 1 · maxLength: 160JSON Schema
{ "type": "string", "minLength": 1, "maxLength": 160 }idempotency-keyобязательно · headerstringpattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{7,159}$"JSON Schema
{ "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,159}$" }
Тело запроса
application/jsonunion
Вариант 1
object
name- stringminLength: 1 · maxLength: 160
website- string | nullmaxLength: 2048
taxId- string | nullmaxLength: 80
city- string | nullmaxLength: 160
operationобязательно- stringenum: ["attributes"]
JSON Schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"website": {
"type": [
"string",
"null"
],
"maxLength": 2048
},
"taxId": {
"type": [
"string",
"null"
],
"maxLength": 80
},
"city": {
"type": [
"string",
"null"
],
"maxLength": 160
},
"operation": {
"type": "string",
"enum": [
"attributes"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
}Вариант 2
object
operationобязательно- stringenum: ["lifecycle"]
statusобязательно- stringenum: ["active","archived"]
JSON Schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"lifecycle"
]
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
}
},
"required": [
"operation",
"status"
],
"additionalProperties": false
}JSON Schema
{
"oneOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"website": {
"type": [
"string",
"null"
],
"maxLength": 2048
},
"taxId": {
"type": [
"string",
"null"
],
"maxLength": 80
},
"city": {
"type": [
"string",
"null"
],
"maxLength": 160
},
"operation": {
"type": "string",
"enum": [
"attributes"
]
}
},
"required": [
"operation"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"lifecycle"
]
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
}
},
"required": [
"operation",
"status"
],
"additionalProperties": false
}
],
"$ref": "#/components/schemas/UpdateDeveloperCrmOrganizationRequest"
}Примеры запроса
curl --request PATCH 'https://YOUR_NOVA_HOST/api/v1/developer/crm/organizations/ORGANIZATION_ID' --header 'Authorization: Bearer YOUR_PROJECT_TOKEN' --header 'Idempotency-Key: YOUR_UNIQUE_COMMAND_ID' --header 'Content-Type: application/json' --data '{"operation":"attributes","city":"Новосибирск"}'Ответы
200 Updated CRM organization receipt
application/jsonobject
resourceIdобязательно- stringminLength: 1 · maxLength: 160
changedобязательно- boolean
JSON Schema
{
"type": "object",
"properties": {
"resourceId": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"changed": {
"type": "boolean"
}
},
"required": [
"resourceId",
"changed"
],
"$ref": "#/components/schemas/DeveloperMutationResponse"
}400 Invalid organization command or idempotency key
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}401 Invalid developer credential
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}404 CRM organization not found
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}409 Archived organization or idempotency key conflict
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}429 Developer API rate limit exceeded
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}503 Developer API rate limiter unavailable
application/problem+jsonobject
type- stringformat: "uri" · default: "about:blank"
titleобязательно- string
statusобязательно- integerminimum: 100 · maximum: 599
detail- string
instance- string
errors- object
JSON Schema
{
"type": "object",
"properties": {
"type": {
"type": "string",
"format": "uri",
"default": "about:blank"
},
"title": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": 100,
"maximum": 599
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
},
"errors": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"title",
"status"
]
}