> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.middesk.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.middesk.com/_mcp/server.

# Get a document

GET https://api.middesk.com/v1/documents/{id}

Reference: https://docs.middesk.com/api-reference/documents/get-document

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — Document ID

## Response

### 200

document found

- `object` (enum, required)
  - Allowed values: `document`
- `id` (string, required)
- `document_type` (string, required) — Type of document. Common values include: Initial_Filing, Certificate of Good Standing, Articles of Incorporation, Initial Filing (UCC1), Amendment (UCC3)
- `filename` (string, required) — Name of the document file
- `content_type` (string, required) — MIME type of the document
- `size` (integer, required) — File size in bytes
- `download_url` (string, required) — URL to download the document
- `created_at` (datetime, required)
- `source` (DocumentSource, optional)
- `filing_date` (datetime, optional, nullable)
- `metadata` (map from string to any, optional) — Additional document metadata

## Errors

### 404 Get Document Request Not Found Error

document not found

- `errors` (list of ErrorResponseErrorsItem, required)

## Types

### DocumentSource

- `type` (string, optional) — Source type (e.g., registration)
- `id` (string, optional) — Source record ID
- `metadata` (map from string to any, optional) — Additional source metadata

### ErrorResponseErrorsItem

- `message` (string, required)
- `parameter` (string, optional) — Request parameter associated with the error, when applicable

## Examples

**Response**

```json
{
  "object": "document",
  "id": "00000000-0000-0000-0000-000000000000",
  "document_type": "Initial filing",
  "filename": "certificate_of_good_standing.pdf",
  "content_type": "application/pdf",
  "size": 1234,
  "download_url": "https://middesk.test/document.pdf?expires_in=10&special=false",
  "created_at": "2024-01-15T12:00:00Z",
  "source": {
    "type": "registration",
    "id": "00000000-0000-0000-0000-000000000001",
    "metadata": {
      "state": "CA",
      "status": "active"
    }
  },
  "metadata": {
    "file_number": "12345"
  }
}
```

**SDK Code**

```python Document
import requests

url = "https://api.middesk.com/v1/documents/id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Document
const url = 'https://api.middesk.com/v1/documents/id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Document
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.middesk.com/v1/documents/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Document
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/documents/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Document
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.middesk.com/v1/documents/id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Document
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.middesk.com/v1/documents/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Document
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/documents/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Document
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/documents/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```