# List team documents

{% get /%}
{% path text="/v1/document/teamlist" /%}

The team admin can view all the documents that are sent and received by the team members. In contrast, the account admin can view all the documents that are sent and received by all the team members. These documents are available in the `Team Documents` section in the BoldSign application. For more informtaion, please refer to the {% customlink href="/teams/create-team/" text="Create team" /%} article.

The team documents can be fetched based on their status, user id, team id, document details, etc. You can also limit the number of documents to be fetched and their position. After a successful retrieval, the details of all the queried documents will be returned. If the user is not an account admin or team admin, then the unauthorized response will be returned.

## Code snippet

{% codetab %}

cURL

```shell
 curl -X 'GET' \ 'https://api.boldsign.com/v1/document/teamlist?status=WaitingForOthers&userId=&pageSize=10&page=1&transmitType=%20Both' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {your API key}' 
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

var documentClient = new DocumentClient(apiClient);
var teamDocumentRecords = documentClient.ListTeamDocuments(1);
```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)
    team_document_records = document_api.team_documents(page=1)
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$document_api = new DocumentApi($config);
$team_document_records = $document_api->teamDocuments($page=1);
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
        
DocumentApi documentApi = new DocumentApi(client);

int page=1;
TeamDocumentRecords teamDocumentRecords = documentApi.teamDocuments(page, null, null, null, null, null, null, null, null, null, null, null);
```

NodeJS

```js
import { DocumentApi } from "boldsign";

const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");

const teamDocumentRecords = documentApi.teamDocuments(1);
```

{% /codetab %}

## Query parameters

{% nestedtable %}

- {% arguments name="status" /%}{% batch datatype="array" /%}
- Current status of the team document. You can set `None` if you don't want to filter based on the document status. Other values are `WaitingForMe,` `WaitingForOthers,` `NeedAttention,` `Completed,` `Declined,` `Revoked,` `Expired,` and `Draft.`

---

- {% arguments name="userId" /%}{% batch datatype="array" /%}
- ID of the user in the team. One or more user IDs can be specified.

---

- {% arguments name="teamId" /%}{% batch datatype="array" /%}
- ID of the team. One or more team IDs can be specified.

---

- {% arguments name="searchKey" /%}{% batch datatype="string" /%}
- Query based on the details of the documents like document title, document ID, sender or recipient(s) name, etc.

---

- {% arguments name="pageSize" /%}{% batch datatype="integer" /%}
- The maximum number of team documents to be listed on a page. Defaults to `10.`

---

- {% arguments name="page" /%}{% batch datatype="integer" /%}{% required /%}
- The page number that you would like to view. Defaults to `1.`

---

- {% arguments name="endDate" /%}{% batch datatype="string" /%}
- End transmit date range of the document. The string should be in date-time format.

---

- {% arguments name="startDate" /%}{% batch datatype="string" /%}
- Start transmit date range of the document. The string should be in date-time format.

---

- {% arguments name="labels" /%}{% batch datatype="array" /%}
- Labels (tags) specified in the document.

---

- {% arguments name="transmitType" /%}{% batch datatype="string" /%}
- Type of transmission such as `Sent,` `Received,` and `Both.`

---

- {% arguments name="nextCursor" /%}{% batch datatype="int" /%}
- To facilitate pagination and fetch the next set of documents beyond 10,000 records, it is necessary to set the `nextCursor` value. This should be the `cursor` value of the last document retrieved. e.g:nextCursor: 1689815402493

---

- {% arguments name="brandIds" /%}{% batch datatype="array" /%}
- Filters documents based on their associated brand IDs.

---

- {% arguments name="dateFilterType" /%}{% batch datatype="string" /%}
- Type of date filter such as `SentBetween`, and `Expiring`.

{% /nestedtable %}

## Example response

***200 Success***

```json
{
  "pageDetails": {
    "pageSize": 10,
    "page": 1,
    "totalRecordsCount": 28,
    "totalPages": 3,
    "sortedColumn": "activityDate",
    "sortDirection": "DESC"
  },
  "result": [
    {
      "documentId": "755195d8-xxxx-xxxx-xxxx-88ff77d35419",
      "senderDetail": {
        "name": "Richard",
        "privateMessage": null,
        "emailAddress": "richard@cubeflakes.com",
        "isViewed": false
      },
      "ccDetails": [
        {
          "emailAddress": "alexgayle@cubeflakes.com",
          "isViewed": false
        }
      ],
      "createdDate": 1664961706,
      "activityDate": 1665989290,
      "activityBy": "alexgayle@cubeflakes.com",
      "messageTitle": "565",
      "status": "InProgress",
      "signerDetails": [
        {
          "signerName": "Richard",
          "signerRole": "",
          "signerEmail": "",
          "status": "NotCompleted",
          "enableAccessCode": false,
          "isAuthenticationFailed": null,
          "enableEmailOTP": false,
          "authenticationType": "None",
          "isDeliveryFailed": false,
          "isViewed": false,
          "order": 1,
          "signerType": "Signer",
          "signType": "Single",
          "groupId": "",
          "hostEmail": "",
          "hostName": "",
          "isReassigned": true,
          "privateMessage": "",
          "formFields": [],
          "language": 0
        }
      ],
      "expiryDate": 1670178599,
      "enableSigningOrder": false,
      "isDeleted": false,
      "labels": [],
      "nextCursor": 1665989290
    },
    {
      "documentId": "655195d8-xxxx-xxxx-xxxx-88ff77d35531",
      "senderDetail": {
        "name": "Alex Gayle",
        "privateMessage": null,
        "emailAddress": "alexgayle@cubeflakes.com",
        "isViewed": false
      },
      "ccDetails": [
        {
          "emailAddress": "richard@cubeflakes.com",
          "isViewed": false
        }
      ],
      "createdDate": 1665988967,
      "activityDate": 1665988967,
      "activityBy": "alexgayle@cubeflakes.com",
      "messageTitle": "Agreement",
      "status": "InProgress",
      "signerDetails": [
        {
          "signerName": "Richard",
          "signerRole": "",
          "signerEmail": "richard@cubeflakes.com",
          "status": "NotCompleted",
          "enableAccessCode": false,
          "isAuthenticationFailed": null,
          "enableEmailOTP": false,
          "authenticationType": "None",
          "isDeliveryFailed": false,
          "isViewed": false,
          "order": 1,
          "signerType": "Signer",
          "signType": "Single",
          "groupId": "",
          "hostEmail": "",
          "hostName": "",
          "isReassigned": false,
          "privateMessage": "",
          "formFields": [],
          "language": 0
        },
        {
          "signerName": "Alex Gayle",
          "signerRole": "",
          "signerEmail": "alexgayle@cubeflakes.com",
          "status": "NotCompleted",
          "enableAccessCode": false,
          "isAuthenticationFailed": null,
          "enableEmailOTP": false,
          "authenticationType": "None",
          "isDeliveryFailed": false,
          "isViewed": false,
          "order": 2,
          "signerType": "Signer",
          "signType": "Single",
          "groupId": "",
          "hostEmail": "",
          "hostName": "",
          "isReassigned": false,
          "privateMessage": "",
          "formFields": [],
          "language": 0
        }
      ],
      "expiryDate": 1671820199,
      "enableSigningOrder": false,
      "isDeleted": false,
      "labels": [
        "Agreement"
      ],
      "nextCursor": 1689815402493
    }
  ]
}
```
