# Obtain details of an approval instance

You can obtain detailed information about a specific approval instance using the Approval Instance Code, including the name of the approval instance, creation time, user who initiated the approval, status, and task list, among other information.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/approval/v4/instances/:instance_id
HTTP Method | GET
Rate Limit | [1000 per minute & 50 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.**<br>Enable any scope from the list | View, create, update, and delete info of Approval app(approval:approval)<br>Access Approval(approval:approval:readonly)<br>View, create, update, and delete info in Approval instance(approval:instance)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user ID(contact:user.employee_id:readonly)

### 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)

### Path parameters

Parameter | Type | Description
---|---|---
instance_id | string | Approval instance Code. Acquisition methods:<br>- After [Creating approval instance](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create), obtain the approval instance code from the returned results.<br>- Call [Batch acquire approval instance ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) to get the approval instance code within the specified approval definition.<br>- Call [Query instance list](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query) and set filtering criteria to query the specified approval instance code.<br>**Example value**: "81D31358-93AF-92D6-7425-01A5D67C4E71"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
locale | string | No | Language. The default value is the language configured with the value `true` for `is_default` in the `i18n_resources` parameter when [creating the approval definition](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create).<br>**Example value**: zh-CN<br>**Optional values are**:<br>- zh-CN：Chinese<br>- en-US：English<br>- ja-JP：Japanese<br>- zh-HK：Traditional Chinese (Hong Kong, China)<br>- zh-TW：Traditional Chinese (Taiwan, China)<br>- de-DE：German<br>- es-ES：Spanish<br>- fr-FR：French<br>- id-ID：Indonesian<br>- it-IT：Italian<br>- ko-KR：Korean<br>- pt-BR：Portuguese<br>- th-TH：Thai<br>- vi-VN：Vietnamese<br>- ms-MY：Malay<br>- ru-RU：Russian
user_id | string | No | The user ID of the person who initiated the approval, with the ID type specified by the `user_id_type` parameter.<br>**Example value**: f7cb567e
user_id_type | string | No | User ID categories<br>**Example value**: user_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)
nested_mutable_group | boolean | No | Return to the complete Bitable control<br>**Example value**: True

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
approval_name | string | Approval title
start_time | string | Approval creation time, in milliseconds timestamp format.
end_time | string | Approval completion time, in milliseconds timestamp format. If the approval is not yet completed, the value of this parameter is 0.
user_id | string | The user_id of the person who initiated the approval.
open_id | string | The open_id of the person who initiated the approval.
serial_number | string | Approval ticket number
department_id | string | The ID of the department where the user who initiated the approval belongs.
status | string | Approval instance status.<br>**Optional values are**:<br>- PENDING：Under review<br>- APPROVED：Pass<br>- REJECTED：Reject<br>- CANCELED：Withdraw<br>- DELETED：Delete
uuid | string | The unique identifier ID of the approval instance.
form | string | Approval form control JSON string, for detailed description of control values, please refer to the **Control value description** section below this article.
task_list | instance_task\[\] | Approval task list
id | string | Task ID
user_id | string | The user_id of the approver. This parameter returns an empty value when automatically approved or automatically rejected.
open_id | string | The open_id of the approver. This parameter returns an empty value when automatically approved or automatically rejected.
status | string | Task status<br>**Optional values are**:<br>- PENDING：Under review<br>- APPROVED：Pass<br>- REJECTED：Reject<br>- TRANSFERRED：Transferred<br>- DONE：Done
node_id | string | Node id to which task belongs
node_name | string | Node name to which task belongs
custom_node_id | string | The custom id of the node to which the task belongs. If the custom id is not set, this field will not be returned
type | string | Approval method<br>**Optional values are**:<br>- AND：Will sign<br>- OR：Individual approval<br>- AUTO_PASS：Pass automatically<br>- AUTO_REJECT：Automatic rejection<br>- SEQUENTIAL：In order
start_time | string | The start time of the approval task, in milliseconds timestamp.
end_time | string | The completion time of the approval task, in milliseconds timestamp. Returns 0 if not completed.
comment_list | instance_comment\[\] | List of comments
id | string | Comment id
user_id | string | The user_id of the user who posted the comment.
open_id | string | The open_id of the user who posted the comment.
comment | string | Comment content
create_time | string | The time of the comment, in milliseconds timestamp.
files | file\[\] | Comment attachments
url | string | Resource path
file_size | int | Attachment size, in bytes.
title | string | Attachment title
type | string | Attachment type:<br>- image<br>- attachment: consistent with the type selected during upload.
timeline | instance_timeline\[\] | Approval dynamic
type | string | Dynamic type. Different dynamic types correspond to different ext return values. Please refer to the following enumeration value descriptions for details.<br>**Optional values are**:<br>- START：Approval start. The ext parameter does not return any value.<br>- PASS：Pass. The ext parameter does not return any value.<br>- REJECT：Reject. The ext parameter does not return any value.<br>- AUTO_PASS：Pass automatically. The ext parameter does not return any value.<br>- AUTO_REJECT：Automatic rejection. The ext parameter does not return any value.<br>- REMOVE_REPEAT：Deduplicate. The ext parameter does not return any value.<br>- TRANSFER：Transfer. The ext parameter returns a user_id_list that includes the user IDs of those the task is transferred to.<br>- ADD_APPROVER_BEFORE：Pre-approver. The ext parameter returns a user_id_list that includes the user IDs of those who signed.<br>- ADD_APPROVER：And sign. The ext parameter returns a user_id_list that includes the user IDs of those who signed.<br>- ADD_APPROVER_AFTER：Post-approver. The ext parameter returns a user_id_list that includes the user IDs of those who signed.<br>- DELETE_APPROVER：Subtract. The ext parameter returns a user_id_list that includes the user IDs of those who signed.<br>- ROLLBACK_SELECTED：Specify fallback. The ext parameter does not return any value.<br>- ROLLBACK：Fall back all. The ext parameter does not return any value.<br>- CANCEL：Withdraw. The ext parameter does not return any value.<br>- DELETE：Delete. The ext parameter does not return any value.<br>- CC：CC. The ext parameter returns a user_id that includes the user IDs of those who received a copy.
create_time | string | Occurrence time, in milliseconds timestamp.
user_id | string | User who generated the dynamic, user_id
open_id | string | User who generated the dynamic, open_id
user_id_list | string\[\] | List of recipients, which contains user_ids.
open_id_list | string\[\] | List of recipients, which contains open_ids.
task_id | string | task_id for generating dynamic associations
comment | string | Reason
cc_user_list | instance_cc_user\[\] | CC list
user_id | string | Cc user id
cc_id | string | Approval the unique identifier of the CC instance
open_id | string | Cc open id
ext | string | Other dynamic information in JSON format, currently including user_id_list, user_id, open_id_list, open_id
node_key | string | Generate the node key of the task
files | file\[\] | Approval attachments
url | string | Resource path
file_size | int | Attachment size. Unit: byte.
title | string | Attachment title
type | string | Attachment type:<br>- image<br>- attachment: consistent with the type selected during upload.
modified_instance_code | string | Modified original instance code, this field is only displayed when querying modified instances
reverted_instance_code | string | Revoked original instance code, this field is only displayed when querying revoked instances
approval_code | string | Approval definition code.
reverted | boolean | Whether the document has been revoked
instance_code | string | Approval instance code

### Control value description

| Type | Description |
|-|-|
| input | Short answer |
| textarea | Paragraph |
| date | Date control in RFC3339 format, example value: 2019-10-01T08:12:01+08:00 |
| radio/radioV2 | Single select choice control. The value corresponds to the option text. If [linked to external options](https://open.feishu.cn/document/ukTMukTMukTM/uADM4QjLwADO04CMwgDN), it corresponds to the option ID. |
| address | Address control in the format `China/Beijing/Beijing/Chaoyang Qu/chang an jie`; if detailed address input is allowed, the last item is the user-entered detailed address. |

The JSON example of the above controls is as follows:

```json
{
    "id": "widget1",
    "custom_id": "user_info",
    "name": "Item application",
    "type": "input",
    "value": "data"
}
```
| Type | Description |
|-|-|
| number | Number |
| amount | Amount |
| formula | Formula |

The JSON example of the above controls is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "number",
    "value": 1234.56
}
```

| Type | Description |
|-|-|
| contact | Contacts control. The value contains the user `user_id`; `open_ids` contains the user `open_id`. For different user ID descriptions, refer to [user identity overview](https://open.feishu.cn/document/home/user-identity-introduction/introduction). |

The JSON example of the above controls is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "contact",
    "value": ["f8ca557e"],
    "open_ids": ["ou_12345"]
}
```

| Type | Description |
|-|-|
| attachmentV2 | Attachment control. `ext` is the attachment name; `value` is the attachment address, separated by commas, and the link is valid for 12 hours. |
| image/imageV2 | Image/Video control. `ext` is the image name; `value` is the image address, separated by commas, and the link is valid for 12 hours. <br> **Note**: When initiating approval from the client page, the image control used cannot obtain the image name through the interface. |

The JSON example of the above controls is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "attachmentV2",
    "ext": "'Item 1 name','Item 2 name'",
    "value": ["Item 1", "Item 2"]
}
```

| Type | Description |
|-|-|
| connect | Link approvals control. The value contains the associated approval instance code. You can call the [get single approval instance details](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get) interface to get instance details based on the approval instance code. |
| attachment | Attachment control. The value is the attachment address. |
| checkbox/checkboxV2 | Multiple select control. The value corresponds to the option text. If [linked to external options](https://open.feishu.cn/document/ukTMukTMukTM/uADM4QjLwADO04CMwgDN), it corresponds to the option ID. |

The JSON example of the above controls is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "checkbox",
    "value": ["Item 1"]
}
```

| Type | Description |
|-|-|
| dateInterval | Date range control. `start` and `end` represent the start and end of the interval, following RFC3339 format; `interval` represents the duration (in days). |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "dateInterval",
    "value": {
         "start": "2019-10-01T08:12:01+08:00",
         "end": "2019-10-02T08:12:01+08:00",
         "interval": 2.0
     }
}
```

| Type | Description |
|-|-|
| fieldList | Detail/Table control. The value is a two-dimensional array, consisting of control JSON values according to the details/table included in the approval definition. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "Item application",
    "type": "fieldList",
    "value": [
         [   
            {
                "id": "widget1",
                "type": "checkbox",
                "value": ["jxpsebqp-0"]
            }
         ]
     ]
}
```

| Type | Description |
|-|-|
| document | Document control. The token returns the document `document_id`. For detailed information, refer to [document](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-overview#e18a49a1); `type` is the document type; `title` is the document title; and `url` is the document link. |

The JSON example of the above control is as follows:

```json
{
    "id":"widget1",
    "type":"document",
    "value":
        {
          "token": "doxcx7B8OzLFHExkiwYuPGAwf",
          "type": "doc",
          "title": "title",
          "url": "https://xxx.xxx.xxx/docx/doxcx7B8OzLFHExkiwYuPGAwf"
       }
}
```

The JSON example of the above control is as follows:

| Type | Description |
|-|-|
| department | Department control. The `open_id` returns the department `open_department_id`. For more information on `open_department_id`, refer to [department ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#9c02ed7a). |

```json
{
    "id":"widget1",
    "type":"department",
    "value":[
        {
            "open_id":"od-xxx"
        }
    ]
}
```
| Type | Description |
|-|-|
| leaveGroup | Leave control group. In the value, `name` is the leave name; `start` and `end` are the leave start and end times in RFC3339 format; `interval` is the duration (days), and certain leave types require the user to manually input the leave duration. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "leave",
    "type": "leaveGroup",
    "value": {
         "name": "annual leave"
         "start": "2019-10-01T00:00:00+08:00",
         "end": "2019-10-02T00:0:00+08:00",
         "interval": 2.0
     }
}
```

| Type | Description |
|-|-|
| leaveGroupV2 | Leave control group. In the value, `name` is the leave name; `start` and `end` are the leave start and end times in RFC3339 format; `interval` is the duration (days), and certain leave types require the user to manually input the leave duration; `unit` is the duration unit, either DAY or HOUR; `reason` is the leave reason. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "leave",
    "type": "widgetLeaveGroupV2",
    "value": {
         "name": "annual leave"
         "start": "2019-10-01T00:00:00+08:00",
         "end": "2019-10-02T00:0:00+08:00",
         "interval": 2.0,
         "unit": "DAY",
         "reason": "out going"
     }
}
```

| Type | Description |
|-|-|
| remedyGroup | Clock-in/out Correction control group. The value contains `time` for remedy time in RFC3339 format; `reason` is the remedy reason. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "remedy",
    "type": "remedyGroup",
    "value": {
         "time": "2019-10-01T08:12:01+08:00",
         "reason": "forgot"
     }
}
```

| Type | Description |
|-|-|
| shiftGroup | Shift swap control group. The value contains `shiftTime` for shift time and `returnTime` for return date, both in RFC3339 format; `reason` is the shift change reason. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "shift",
    "type": "shiftGroup",
    "value": {
         "shiftTime": "2019-10-01T08:12:01+08:00",
         "returnTime": "2019-10-02T08:12:01+08:00",
         "reason": "ask for leave"
     }
}
```

| Type | Description |
|-|-|
| workGroup | Overtime control group. The value contains `name` for the overtime name; `start` and `end` for the overtime start and end times in RFC3339 format; `interval` for the overtime duration (days); `reason` for the overtime reason. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "work",
    "type": "workGroup",
    "value": {
         "name": "Overtime pay"
         "start": "2019-10-01T08:12:01+08:00",
         "end": "2019-10-02T08:12:01+08:00",
         "interval": 2.0,
         "reason": "ask for leave"
     }
}
```

| Type | Description |
|-|-|
| tripGroup | Business trip control group. The parameters are described in the code comments below. |

The JSON example of the above control is as follows:

```json
{
    "id": "widget1",
    "name": "trip",
    "type": "tripGroup",
    "value": {
         "schedule": [{
                "start": "2019-10-0T00:00:00Z+08:00", // Start time of the trip in RFC3339 format.
                "end": "2019-10-01T00:00:00Z+08:00", // End time of the trip in RFC3339 format.
                "interval": 123.45, // Duration of the trip in days.
                "departure": "China/Beijing/Beijing", // Departure place.
                "destination": "China/Shanghai/Shanghai", // Destination place.
                "transport": "Airplane", // Mode of transport.
                "oneRound": "One Way", // One way or Round trip.
                "remark": "business" // Remarks.
         }],
         "interval": 2.0, // Total duration of the trip in days.
         "reason": "business", // Reason for the trip.
         "peer": ["f7cb567e"] // User IDs of peers.
    }
}
```

| Type | Description |
|-|-|
| telephone | Contact no. control. The value contains `country_code` for the country code and `national_number` for the phone number. |

The JSON example of the above control is as follows:

```json
{
    "id":"widget1",
    "type":"telephone",
    "value": {
        "country_code":"+86",
        "national_number":"13122222222"
    }
}
```

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "approval_name": "Payment",
        "start_time": "1564590532967",
        "end_time": "1564590532967",
        "user_id": "f3ta757q",
        "open_id": "ou_3cda9c969f737aaa05e6915dce306cb9",
        "serial_number": "202102060002",
        "department_id": "od-8ec33ffec336c3a39a278bc25e931676",
        "status": "PENDING",
        "uuid": "1234567",
        "form": "[{\"id\": \"widget1\",\"custom_id\": \"user_info\",\"name\": \"Item application\",\"type\": \"textarea\"}]",
        "task_list": [
            {
                "id": "1234",
                "user_id": "f7cb567e",
                "open_id": "ou_123457",
                "status": "PENDING",
                "node_id": "46e6d96cfa756980907209209ec03b64",
                "node_name": "start",
                "custom_node_id": "manager",
                "type": "AND",
                "start_time": "1564590532967",
                "end_time": "0"
            }
        ],
        "comment_list": [
            {
                "id": "1234",
                "user_id": "f7cb567e",
                "open_id": "ou_123456",
                "comment": "ok",
                "create_time": "1564590532967",
                "files": [
                    {
                        "url": "https://p3-approval-sign.byteimg.com/lark-approval-attachment/image/20220714/1/332f3596-0845-4746-a4bc-818d54ad435b.png~tplv-ottatrvjsm-image.image?x-expires=1659033558&x-signature=6edF3k%2BaHeAuvfcBRGOkbckoUl4%3D#.png",
                        "file_size": 186823,
                        "title": "e018906140ed9388234bd03b0.png",
                        "type": "image"
                    }
                ]
            }
        ],
        "timeline": [
            {
                "type": "PASS",
                "create_time": "1564590532967",
                "user_id": "f7cb567e",
                "open_id": "ou_123456",
                "user_id_list": [
                    "f7cb567e"
                ],
                "open_id_list": [
                    "ou_123456"
                ],
                "task_id": "1234",
                "comment": "ok",
                "cc_user_list": [
                    {
                        "user_id": "eea5gefe",
                        "cc_id": "123445",
                        "open_id": "ou_12345"
                    }
                ],
                "ext": "{\"user_id\":\"62d4a44c\",\"open_id\":\"ou_123456\"}",
                "node_key": "APPROVAL_240330_4058663",
                "files": [
                    {
                        "url": "https://p3-approval-sign.byteimg.com/lark-approval-attachment/image/20220714/1/332f3596-0845-4746-a4bc-818d54ad435b.png~tplv-ottatrvjsm-image.image?x-expires=1659033558&x-signature=6edF3k%2BaHeAuvfcBRGOkbckoUl4%3D#.png",
                        "file_size": 186823,
                        "title": "e018906140ed9388234bd03b0.png",
                        "type": "image"
                    }
                ]
            }
        ],
        "modified_instance_code": "81D31358-93AF-92D6-7425-01A5D67C4E71",
        "reverted_instance_code": "81D31358-93AF-92D6-7425-01A5D67C4E71",
        "approval_code": "7C468A54-8745-2245-9675-08B7C63E7A85",
        "reverted": false,
        "instance_code": "81D31358-93AF-92D6-7425-01A5D67C4E71"
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1390001 | param is invalid | Parameter error. Troubleshooting steps:<br>- Check the parameters passed during the request according to the parameter descriptions in the API documentation.<br>- If form parameters are passed, verify whether the form control data within the parameters is correct. If the error message includes a control ID (e.g., `Control= widget17261088448220001`), you can call the [View specific approval definition](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) or [Get single approval instance details](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/get) API to retrieve the response parameter form value, search for the problematic control ID, and check whether the configuration of the control is correct.
400 | 1395001 | There have been some errors. Please try again later | Service error encountered. Troubleshooting steps:<br>1. Refer to the parameter descriptions in the API documentation and check whether the parameters passed in the request are correct. If form parameters are passed (form), ensure the form control data is correct.<br>2. Lower the request frequency and retry. If the error persists after retrying, please contact [Technical Support](https://applink.feishu.cn/TLJpeNdW).
400 | 1390003 | instance code not found | Cannot find approval instance code. Check whether the passed approval instance code is correct.<br>Methods to obtain the approval instance code:<br>- After calling the [Create approval instance](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/create) API, get it from the response parameter instance_code.<br>- Call the [Batch Get approval instance ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/list) API to obtain the required approval instance codes.<br>- Call the [Query instance list](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/instance/query) API, set the filter conditions to query the specified approval instance codes.
403 | 1390009 | no operation permission | No operation permissions. Please go to [Feishu Approval Admin](https://www.feishu.cn/approval/admin/approvalList), enter the specified approval definition editing page, and check whether the operation permissions are correctly configured in the approval operation permissions within the process design.
400 | 1390004 | user_id or open_id not found | Check whether the incoming `user_id` parameter is correct. The type of `user_id` needs to be consistent with `user_id_type`, and ensure that the ID value is correct.

For more error code information, see [General error codes](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN).

