POST

DocumentStatuses.Add

Add a Document Status. Matches Settings → Document Status Submit. If all_document_status_id / document_status_id > 0 is sent, updates that row (dashboard form behavior).

Permissions

  • User must be logged in with a valid bearer token.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Creates a DocumentStatuses record or sends the requested data after validation.

Push Service

Pushes event documentstatuses.add.created to users who should see this change.

Automation

No automation is run for this function.

Special Instructions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • Dashboard fields: all_document_statuses_en, all_document_statuses_he, all_status_statuses_color, document_status_type (default purchase_orders), all_document_status_id.
  • API-friendly aliases: name_en, name_he, color / status_color, type_for.
  • On create, status_order is set to max(status_order)+1 for the account.

Required Parameters

NameTypeSampleExplanation
name_en
post
stringIn ProductionEnglish name. Alias: all_document_statuses_en.
name_he
post
stringIn ProductionHebrew / second-lang name. Alias: all_document_statuses_he.

Optional Parameters

NameTypeSampleWhat it gives
color
post
string#000000Color hex. Aliases: all_status_statuses_color, status_color. Default #000000.
type_for
post
stringpurchase_ordersDashboard hidden document_status_type. Default purchase_orders.
all_document_status_id
post
int0When > 0, updates that row instead of inserting. Aliases: document_status_id, id.

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/DocumentStatuses.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "name_en": "Quality Checked",
        "name_he": "Quality Checked",
        "color": "#8B6914",
        "type_for": "purchase_orders"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/DocumentStatuses.Add",
    "url_domain": "https:\/\/{domain}\/app\/DocumentStatuses.Add"
}

Endpoint

POST /app/DocumentStatuses.Add
POST https://{user}.bull36.com/app/DocumentStatuses.Add
POST https://{domain}/app/DocumentStatuses.Add

Sample Output

{
    "success": 1,
    "message": "Your document status is added",
    "document_status_id": 3455,
    "socket_event": "documentstatuses.add.created"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({ name_en: 'Quality Checked', name_he: 'Quality Checked', color: '#8B6914' });
const res = await fetch('/app/DocumentStatuses.Add', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "success": 0,
    "message": "Missing required parameter: name_en"
}