# Create system status

Create a system status with a tenant-wide dimension.

**Notice**：Notice:
- The data to be operated is tenant dimension data, please operate with care.
- Create up to 10 system states per tenant.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/personal_settings/v1/system_statuses
HTTP Method | POST
Rate Limit | [100 per minute](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Obtain and update system status(personal_settings:status:system_status_update)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Request body

Parameter | Type | Required | Description
---|---|---|---
title | string | Yes | System status title, the number of characters in the title should be in the range of 1 to 20. Titles of different system statuses cannot be repeated.<br>**Notice:** <br>- one Chinese character=two English character=two other language character<br>**Example value**: "出差"
i18n_title | system_status_i18n_name | No | System status i18n title, the number of characters in the title should be in the range of 1 to 20. Any title in i18n_title cannot be repeated between different system statuses.<br>**Notice** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | No | Chinese name<br>**Example value**: "出差"
en_us | string | No | English name<br>**Example value**: "On business trip"
ja_jp | string | No | Japanese name<br>**Example value**: "出張中"
icon_key | string | Yes | Icon<br>[**Icon optional value**](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/overview)<br>**Example value**: "GeneralBusinessTrip"<br>**Optional values are**:<br>- GeneralDoNotDisturb：GeneralDoNotDisturb<br>- GeneralInMeetingBusy：GeneralInMeetingBusy<br>- Coffee：Coffee<br>- GeneralBusinessTrip：GeneralBusinessTrip<br>- GeneralWorkFromHome：GeneralWorkFromHome<br>- StatusEnjoyLife：StatusEnjoyLife<br>- GeneralTravellingCar：GeneralTravellingCar<br>- StatusBus：StatusBus<br>- StatusInFlight：StatusInFlight<br>- Typing：Typing<br>- EatingFood：EatingFood<br>- SICK：SICK<br>- GeneralSun：GeneralSun<br>- GeneralMoonRest：GeneralMoonRest<br>- StatusReading：StatusReading<br>- Status_PrivateMessage：Status_PrivateMessage<br>- StatusFlashOfInspiration：StatusFlashOfInspiration<br>- GeneralVacation：GeneralVacation
color | string | No | Color<br>**Example value**: "BLUE"<br>**Optional values are**:<br>- BLUE：BLUE<br>- GRAY：GRAY<br>- INDIGO：INDIGO<br>- WATHET：WATHET<br>- GREEN：GREEN<br>- TURQUOISE：TURQUOISE<br>- YELLOW：YELLOW<br>- LIME：LIME<br>- RED：RED<br>- ORANGE：ORANGE<br>- PURPLE：PURPLE<br>- VIOLET：VIOLET<br>- CARMINE：CARMINE<br>**Default value**: `BLUE`
priority | int | No | The smaller the value, the higher the priority of the display. Different system status cannot have the same priority.<br>**Example value**: 1<br>**Default value**: `0`<br>**Data validation rules**:<br>- Value range: `0` ～ `9`
sync_setting | system_status_sync_setting | No | Sync setting
is_open_by_default | boolean | No | Is open by default<br>**Example value**: true<br>**Default value**: `true`
title | string | No | System status sync title, the number of characters in the title should be in the range of 1 to 30.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.<br>**Example value**: "出差期间自动开启"<br>**Default value**: `自动开启`
i18n_title | system_status_sync_i18n_name | No | System status sync i18n title, the number of characters in the title should be in the range of 1 to 30.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | No | Chinese name<br>**Example value**: "出差期间自动开启"
en_us | string | No | English name<br>**Example value**: "Auto display Business Trip"
ja_jp | string | No | Japanese name<br>**Example value**: "出張中に自動的にオンにする"
explain | string | No | System status sync explain, the number of characters in the explain should be in the range of 1 to 60.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.<br>**Example value**: "出差审批通过后，将自动开启并优先展示该状态。"<br>**Default value**: `从相关系统进行信息同步，同步后将自动开启并优先展示该状态。`
i18n_explain | system_status_sync_i18n_explain | No | System status sync i18n explain, the number of characters in the explain should be in the range of 1 to 60.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | No | Chinese name<br>**Example value**: "出差审批通过后，该状态将自动开启并优先展示"
en_us | string | No | English name<br>**Example value**: "Auto-display after travel request is approved."
ja_jp | string | No | Japanese name<br>**Example value**: "申請が承認されると、このステータスが優先的に表示されます"

### Request body example
```json
{
    "title": "出差",
    "i18n_title": {
        "zh_cn": "出差",
        "en_us": "On business trip",
        "ja_jp": "出張中"
    },
    "icon_key": "GeneralBusinessTrip",
    "color": "BLUE",
    "priority": 1,
    "sync_setting": {
        "is_open_by_default": true,
        "title": "出差期间自动开启",
        "i18n_title": {
            "zh_cn": "出差期间自动开启",
            "en_us": "Auto display Business Trip",
            "ja_jp": "出張中に自動的にオンにする"
        },
        "explain": "出差审批通过后，将自动开启并优先展示该状态。",
        "i18n_explain": {
            "zh_cn": "出差审批通过后，该状态将自动开启并优先展示",
            "en_us": "Auto-display after travel request is approved.",
            "ja_jp": "申請が承認されると、このステータスが優先的に表示されます"
        }
    }
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
system_status | system_status | System status
system_status_id | string | System status id
title | string | System status title, the number of characters in the title should be in the range of 1 to 20. Titles of different system statuses cannot be repeated.<br>**Notice:** <br>- one Chinese character=two English character=two other language character
i18n_title | system_status_i18n_name | System status i18n title, the number of characters in the title should be in the range of 1 to 20. Any title in i18n_title cannot be repeated between different system statuses.<br>**Notice** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | Chinese name
en_us | string | English name
ja_jp | string | Japanese name
icon_key | string | Icon<br>[**Icon optional value**](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/overview)<br>**Optional values are**:<br>- GeneralDoNotDisturb：GeneralDoNotDisturb<br>- GeneralInMeetingBusy：GeneralInMeetingBusy<br>- Coffee：Coffee<br>- GeneralBusinessTrip：GeneralBusinessTrip<br>- GeneralWorkFromHome：GeneralWorkFromHome<br>- StatusEnjoyLife：StatusEnjoyLife<br>- GeneralTravellingCar：GeneralTravellingCar<br>- StatusBus：StatusBus<br>- StatusInFlight：StatusInFlight<br>- Typing：Typing<br>- EatingFood：EatingFood<br>- SICK：SICK<br>- GeneralSun：GeneralSun<br>- GeneralMoonRest：GeneralMoonRest<br>- StatusReading：StatusReading<br>- Status_PrivateMessage：Status_PrivateMessage<br>- StatusFlashOfInspiration：StatusFlashOfInspiration<br>- GeneralVacation：GeneralVacation
color | string | Color<br>**Optional values are**:<br>- BLUE：BLUE<br>- GRAY：GRAY<br>- INDIGO：INDIGO<br>- WATHET：WATHET<br>- GREEN：GREEN<br>- TURQUOISE：TURQUOISE<br>- YELLOW：YELLOW<br>- LIME：LIME<br>- RED：RED<br>- ORANGE：ORANGE<br>- PURPLE：PURPLE<br>- VIOLET：VIOLET<br>- CARMINE：CARMINE
priority | int | The smaller the value, the higher the priority of the display. Different system status cannot have the same priority.
sync_setting | system_status_sync_setting | Sync setting
is_open_by_default | boolean | Is open by default
title | string | System status sync title, the number of characters in the title should be in the range of 1 to 30.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
i18n_title | system_status_sync_i18n_name | System status sync i18n title, the number of characters in the title should be in the range of 1 to 30.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | Chinese name
en_us | string | English name
ja_jp | string | Japanese name
explain | string | System status sync explain, the number of characters in the explain should be in the range of 1 to 60.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
i18n_explain | system_status_sync_i18n_explain | System status sync i18n explain, the number of characters in the explain should be in the range of 1 to 60.<br>**Notice:** <br>- one Chinese character=two English character=two other language character.
zh_cn | string | Chinese name
en_us | string | English name
ja_jp | string | Japanese name

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "system_status": {
            "system_status_id": "7101214603622940633",
            "title": "出差",
            "i18n_title": {
                "zh_cn": "出差",
                "en_us": "On business trip",
                "ja_jp": "出張中"
            },
            "icon_key": "GeneralBusinessTrip",
            "color": "BLUE",
            "priority": 1,
            "sync_setting": {
                "is_open_by_default": true,
                "title": "出差期间自动开启",
                "i18n_title": {
                    "zh_cn": "出差期间自动开启",
                    "en_us": "Auto display Business Trip",
                    "ja_jp": "出張中に自動的にオンにする"
                },
                "explain": "出差审批通过后，将自动开启并优先展示该状态。",
                "i18n_explain": {
                    "zh_cn": "出差审批通过后，该状态将自动开启并优先展示",
                    "en_us": "Auto-display after travel request is approved.",
                    "ja_jp": "申請が承認されると、このステータスが優先的に表示されます"
                }
            }
        }
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 2005001 | Your request contains an invalid request parameter. | The parameter is incorrect. Please check the input parameter according to the error message returned by the interface and refer to the documentation.
400 | 2005002 | The same name or i18n name has already be created within your tenant. | The system state corresponding to this name or internationalized name has already been created, please use another name.
400 | 2005003 | Name or i18n name contains sensitive words. | The name or internationalized name contains sensitive words, please use another name.
400 | 2005004 | The number of tenant system status exceeds limit | The number of tenant dimension system states exceeds 10.
400 | 2005005 | The priority of tenant system status has already be created within your tenant. | Use another priority, or adjust the priority of other system status.
400 | 2005007 | Tenant does not have permission to api. | Tenant does not have permission to api, Please apply to use.

