> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.postnuvia.com/llms.txt.

# Get Draft

GET https://api.postnuvia.com/v0/drafts/{draft_id}

**CLI:**

```bash
postnuvia drafts get --draft-id <draft_id>
```

Reference: https://docs.postnuvia.com/api-reference/drafts/get

## Authentication

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

## Servers

- `https://api.postnuvia.com` (prod, default)
- `https://x402.api.postnuvia.com` (prod-x402)
- `https://mpp.api.postnuvia.com` (prod-mpp)
- `https://api.postnuvia.eu` (eu-prod)

## Request

### Path parameters

- `draft_id` (string, required) — ID of draft.

## Response

### 200

- `inbox_id` (string, required) — The ID of the inbox.
- `draft_id` (string, required) — ID of draft.
- `labels` (list of string, required) — Labels of draft.
- `updated_at` (datetime, required) — Time at which draft was last updated.
- `created_at` (datetime, required) — Time at which draft was created.
- `client_id` (string, optional) — Client ID of draft.
- `reply_to` (list of string, optional) — Reply-to addresses. In format `username@domain.com` or `Display Name <username@domain.com>`.
- `to` (list of string, optional) — Addresses of recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
- `cc` (list of string, optional) — Addresses of CC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
- `bcc` (list of string, optional) — Addresses of BCC recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
- `subject` (string, optional) — Subject of draft.
- `preview` (string, optional) — Text preview of draft.
- `text` (string, optional) — Plain text body of draft.
- `html` (string, optional) — HTML body of draft.
- `attachments` (list of Attachment, optional) — Attachments in draft.
- `in_reply_to` (string, optional) — ID of message being replied to.
- `forward_of` (string, optional) — ID of message being forwarded.
- `references` (list of string, optional) — IDs of previous messages in thread.
- `send_status` (enum, optional) — Schedule send status of draft.
  - Allowed values: `scheduled`, `sending`, `failed`
- `send_at` (datetime, optional) — Time at which to schedule send draft.

## Errors

### 404 Not Found Error

- `name` (string, required) — Name of error.
- `message` (string, required) — Error message.
- `code` (string, optional) — Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
- `fix` (string, optional) — The concrete next action that resolves the error.
- `docs` (string, optional) — Link to the error reference entry for this code.

## Types

### Attachment

- `attachment_id` (string, required) — ID of attachment.
- `size` (integer, required) — Size of attachment in bytes.
- `filename` (string, optional) — Filename of attachment.
- `content_type` (string, optional) — Content type of attachment.
- `content_disposition` (enum, optional) — Content disposition of attachment.
  - Allowed values: `inline`, `attachment`
- `content_id` (string, optional) — Content ID of attachment.

## Examples

**Response**

```json
{
  "inbox_id": "inbox_id",
  "draft_id": "draft_id",
  "labels": [
    "labels",
    "labels"
  ],
  "updated_at": "2024-01-15T09:30:00Z",
  "created_at": "2024-01-15T09:30:00Z",
  "client_id": "client_id",
  "reply_to": [
    "reply_to",
    "reply_to"
  ],
  "to": [
    "to",
    "to"
  ],
  "cc": [
    "cc",
    "cc"
  ],
  "bcc": [
    "bcc",
    "bcc"
  ],
  "subject": "subject",
  "preview": "preview",
  "text": "text",
  "html": "html",
  "attachments": [
    {
      "attachment_id": "attachment_id",
      "size": 1,
      "filename": "filename",
      "content_type": "content_type",
      "content_disposition": "inline",
      "content_id": "content_id"
    },
    {
      "attachment_id": "attachment_id",
      "size": 1,
      "filename": "filename",
      "content_type": "content_type",
      "content_disposition": "inline",
      "content_id": "content_id"
    }
  ],
  "in_reply_to": "in_reply_to",
  "forward_of": "forward_of",
  "references": [
    "references",
    "references"
  ],
  "send_status": "scheduled",
  "send_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.postnuvia.com/v0/drafts/draft_id"

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

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

print(response.json())
```

```javascript
const url = 'https://api.postnuvia.com/v0/drafts/draft_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

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

```go
package main

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

func main() {

	url := "https://api.postnuvia.com/v0/drafts/draft_id"

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

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

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

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

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

}
```

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

url = URI("https://api.postnuvia.com/v0/drafts/draft_id")

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

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

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

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

HttpResponse<String> response = Unirest.get("https://api.postnuvia.com/v0/drafts/draft_id")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postnuvia.com/v0/drafts/draft_id', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.postnuvia.com/v0/drafts/draft_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postnuvia.com/v0/drafts/draft_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()
```