For AI agents: markdown of this page — /docs-content-en/entities/person-types/delete.md documentation index — /llms.txt

Delete a payer type

DELETE /v1/person-types/:id

Deletes a payer type from the online store list by ID. You cannot restore a deleted type through the API. Create a new type if needed.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionPayer type ID, a non-negative integer. List: GET /v1/person-types

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Payer type deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Payer type deleted')
}

Response

Successful deletion returns HTTP 204 No Content with an empty body. Check the status code to confirm success.

Response example

http
HTTP/1.1 204 No Content

Error response example

404 — the payer type has already been deleted:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "person type is not exists"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionThe path id is not a non-negative integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe payer type with this id does not exist or has already been deleted. Message: person type is not exists
HTTP422 CodeBITRIX_ERROR DescriptionA type with code: "CRM_CONTACT" or code: "CRM_COMPANY" is protected from deletion. Message: person type code is protected, b24Code: 200750000003
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected deletion for another reason. The reason is in message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key owner lacks permission to modify payer types in Bitrix24
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the sale scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

For the full list of common API errors, see Error codes.

Known specifics

To deactivate your own type instead of deleting it, send its name and active: false in PATCH /v1/person-types/:id.

See also