> ## Documentation Index
> Fetch the complete documentation index at: https://docs.docinject.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List and retrieve documents via the API

> Fetch your document library with GET /documents, get per-status counts with GET /documents/counts, and retrieve a single document with its full node tree.

Use these endpoints to read documents from your DocInject organization. You can list all documents you own or that have been shared with you, get a breakdown of document counts by status, or fetch a single document with its complete section and step hierarchy.

## List documents

```text theme={null}
GET https://api.docinject.com/{org_slug}/inbox
```

Returns an array of documents.

### Example request

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.docinject.com/{org_slug}/inbox" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    'https://api.docinject.com/{org_slug}/inbox',
    {
      headers: {
        Authorization: `Bearer ${process.env.DOCINJECT_API_KEY}`,
      },
    }
  );
  const documents = await res.json();
  ```

  ```python Python theme={null}
  import os, requests

  res = requests.get(
      'https://api.docinject.com/{org_slug}/inbox',
      headers={'Authorization': f'Bearer {os.environ["DOCINJECT_API_KEY"]}'},
  )
  documents = res.json()
  ```
</CodeGroup>

### Response

Returns `200 OK` with an array of document objects.

<ResponseField name="id" type="string" required>
  Unique identifier for the document.
</ResponseField>

***

## Get a single document

```text theme={null}
GET https://api.docinject.com/{org_slug}/inbox/{doc_id}
```

Returns a single document.

### Example request

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.docinject.com/{org_slug}/inbox/doc_01hxyz1a2b3c4d5e6f7g8h9j" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const docId = 'doc_01hxyz1a2b3c4d5e6f7g8h9j';
  const res = await fetch(
    `https://api.docinject.com/{org_slug}/inbox/${docId}`,
    {
      headers: { Authorization: `Bearer ${process.env.DOCINJECT_API_KEY}` },
    }
  );
  const doc = await res.json();
  ```

  ```python Python theme={null}
  import os, requests

  doc_id = 'doc_01hxyz1a2b3c4d5e6f7g8h9j'
  res = requests.get(
      f'https://api.docinject.com/{org_slug}/inbox/{doc_id}',
      headers={'Authorization': f'Bearer {os.environ["DOCINJECT_API_KEY"]}'},
  )
  doc = res.json()
  ```
</CodeGroup>

### Response

Returns `200 OK` with a document object.

<Note>
  The API returns `404 Not Found` if the document does not exist or belongs to a different organization than your API key.
</Note>
