# Export a project as a .vvbundle

> POST /api/v1/projects/{id}/bundle: Export a project as a .vvbundle

Source: https://stuarty.com/docs/api/projects.bundle.export/

Heavy call: shares the limit of 10 a minute per credential (E_RATE_LIMITED with Retry-After).

## Authentication

Send the secret in the header `Authorization: Bearer <secret>`: the local token in local mode, an [API key](/docs/self-hosting/api-keys) in network mode. An API key needs the `render` scope; the local token has every scope. See the [API overview](/docs/api/overview) for both modes.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | min length 1 |

## Request body

Content type `application/json`.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `include_log` | `boolean` or `null` | no | false leaves the history out, to share a project without it. Default true. |
| `timeline_id` | `string` | no | One timeline only (the format of releases up to 0.29.0); without it, the whole project. |
| `wait_ms` | `integer` | no | 0 to 25000: hold the call until the job is final. |

## Responses

### 200 OK

Accepted

Content type `application/json`. Schema: [`Job`](/docs/api/schemas#job).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `actor` | `string` | no |  |
| `approval_id` | `string` | no |  |
| `created_at` | `string (date-time)` | no |  |
| `dry_run` | `boolean` | no |  |
| `error` | [`Error`](/docs/api/schemas#error) or `any` or `null` or `null` | no |  |
| `estimate` | [`Money`](/docs/api/schemas#money) or `any` or `null` or `null` | no |  |
| `finished_at` | `string (date-time)` or `null` | no |  |
| `job_id` | `string` | no |  |
| `kind` | `string` | no |  |
| `lint` | [`LintTotals`](/docs/api/schemas#linttotals) or `any` or `null` or `null` | no |  |
| `message` | `string` | no |  |
| `progress` | `number (double)` | no |  |
| `project_id` | `string` or `null` | no |  |
| `result` | [`JobResult`](/docs/api/schemas#jobresult) or `any` or `null` or `null` | no |  |
| `started_at` | `string (date-time)` or `null` | no |  |
| `state` | `string` | no |  |
| `text` | `string` | no |  |
| `warnings` | array of `string` | no |  |

### 202 Accepted

Content type `application/json`. Schema: [`Job`](/docs/api/schemas#job).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `actor` | `string` | no |  |
| `approval_id` | `string` | no |  |
| `created_at` | `string (date-time)` | no |  |
| `dry_run` | `boolean` | no |  |
| `error` | [`Error`](/docs/api/schemas#error) or `any` or `null` or `null` | no |  |
| `estimate` | [`Money`](/docs/api/schemas#money) or `any` or `null` or `null` | no |  |
| `finished_at` | `string (date-time)` or `null` | no |  |
| `job_id` | `string` | no |  |
| `kind` | `string` | no |  |
| `lint` | [`LintTotals`](/docs/api/schemas#linttotals) or `any` or `null` or `null` | no |  |
| `message` | `string` | no |  |
| `progress` | `number (double)` | no |  |
| `project_id` | `string` or `null` | no |  |
| `result` | [`JobResult`](/docs/api/schemas#jobresult) or `any` or `null` or `null` | no |  |
| `started_at` | `string (date-time)` or `null` | no |  |
| `state` | `string` | no |  |
| `text` | `string` | no |  |
| `warnings` | array of `string` | no |  |

### 400

Validation failed; errors maps each field to its messages and issues lists each problem with its code, key and params

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 401 Unauthorized

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 403

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 404

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 409

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 422 Unprocessable Content

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 429

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### Any other status

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

```bash
curl -X POST "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```python
import os

import requests

response = requests.post(
    "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle",
    headers={"Authorization": f"Bearer {os.environ['STUARTY_KEY']}"},
    json={},
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

```javascript
const response = await fetch("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STUARTY_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

```go
package main

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

func main() {
	body := strings.NewReader(`{}`)
	url := "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle"
	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("STUARTY_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(out))
}
```

```php
<?php

$ch = curl_init("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("STUARTY_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => '{}',
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle"))
            .header("Authorization", "Bearer " + System.getenv("STUARTY_KEY"))
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString("""
                {}
                """))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```

```csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(
    HttpMethod.Post, "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("STUARTY_KEY"));
request.Content = new StringContent("""
{}
""", Encoding.UTF8, "application/json");

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```

```ruby
require "net/http"
require "uri"

uri = URI("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/bundle")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch('STUARTY_KEY')}"
request["Content-Type"] = "application/json"
request.body = '{}'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
```

**Response examples**

```json
{
  "actor": "string",
  "approval_id": "string",
  "created_at": "2006-01-02T15:04:05Z",
  "dry_run": false,
  "error": {
    "code": "string",
    "details": {},
    "hint": "string",
    "message": "string",
    "op_index": 0,
    "path": "string",
    "retryable": false
  },
  "estimate": {
    "currency": "string",
    "micros": 0
  },
  "finished_at": "2006-01-02T15:04:05Z",
  "job_id": "string",
  "kind": "string",
  "lint": {
    "errors": 0,
    "lint_scope": "string",
    "warnings": 0
  },
  "message": "string",
  "progress": 0,
  "project_id": "string",
  "result": {
    "batch": {
      "cancelled": 0,
      "failed": 0,
      "items": [],
      "succeeded": 0,
      "total": 0
    },
    "export": {
      "audio_codec": "string",
      "bytes": 0,
      "checks": [],
      "codec_fallback": "string",
      "download_url": "string",
      "duration": {},
      "format": "string",
      "fps": "string",
      "height": 0,
      "loudness_lufs": 0,
      "notes": [],
      "path": "string",
      "preset": "string",
      "revision": 0,
      "sha256": "string",
      "video_codec": "string",
      "width": 0
    },
    "face_track": {
      "asset_id": "string",
      "faces": 0,
      "fps": 0,
      "provider": "string",
      "samples": 0
    },
    "generated": {
      "cost": {},
      "delivered": 0,
      "image": {},
      "items": [],
      "model": "string",
      "notes": [],
      "provider": "string",
      "requested": 0
    },
    "image": {
      "bytes": 0,
      "format": "string",
      "height": 0,
      "image_id": "string",
      "job_id": "string",
      "path": "string",
      "revision": 0,
      "sha256": "string",
      "text": "string",
      "width": 0
    },
    "publish": {
      "connection_id": "string",
      "network": "string",
      "remote_id": "string",
      "state": "string",
      "thumbnail_error": "string",
      "url": "string"
    },
    "text": {
      "cost": {},
      "finish_reason": "string",
      "input_tokens": 0,
      "item_id": "string",
      "model": "string",
      "output_tokens": 0,
      "provider": "string",
      "revision": 0,
      "text": "string"
    },
    "transcribe": {
      "asset_id": "string",
      "language": "string",
      "words": 0
    }
  },
  "started_at": "2006-01-02T15:04:05Z",
  "state": "string",
  "text": "string",
  "warnings": [
    "string"
  ]
}
```

```json
{
  "actor": "string",
  "approval_id": "string",
  "created_at": "2006-01-02T15:04:05Z",
  "dry_run": false,
  "error": {
    "code": "string",
    "details": {},
    "hint": "string",
    "message": "string",
    "op_index": 0,
    "path": "string",
    "retryable": false
  },
  "estimate": {
    "currency": "string",
    "micros": 0
  },
  "finished_at": "2006-01-02T15:04:05Z",
  "job_id": "string",
  "kind": "string",
  "lint": {
    "errors": 0,
    "lint_scope": "string",
    "warnings": 0
  },
  "message": "string",
  "progress": 0,
  "project_id": "string",
  "result": {
    "batch": {
      "cancelled": 0,
      "failed": 0,
      "items": [],
      "succeeded": 0,
      "total": 0
    },
    "export": {
      "audio_codec": "string",
      "bytes": 0,
      "checks": [],
      "codec_fallback": "string",
      "download_url": "string",
      "duration": {},
      "format": "string",
      "fps": "string",
      "height": 0,
      "loudness_lufs": 0,
      "notes": [],
      "path": "string",
      "preset": "string",
      "revision": 0,
      "sha256": "string",
      "video_codec": "string",
      "width": 0
    },
    "face_track": {
      "asset_id": "string",
      "faces": 0,
      "fps": 0,
      "provider": "string",
      "samples": 0
    },
    "generated": {
      "cost": {},
      "delivered": 0,
      "image": {},
      "items": [],
      "model": "string",
      "notes": [],
      "provider": "string",
      "requested": 0
    },
    "image": {
      "bytes": 0,
      "format": "string",
      "height": 0,
      "image_id": "string",
      "job_id": "string",
      "path": "string",
      "revision": 0,
      "sha256": "string",
      "text": "string",
      "width": 0
    },
    "publish": {
      "connection_id": "string",
      "network": "string",
      "remote_id": "string",
      "state": "string",
      "thumbnail_error": "string",
      "url": "string"
    },
    "text": {
      "cost": {},
      "finish_reason": "string",
      "input_tokens": 0,
      "item_id": "string",
      "model": "string",
      "output_tokens": 0,
      "provider": "string",
      "revision": 0,
      "text": "string"
    },
    "transcribe": {
      "asset_id": "string",
      "language": "string",
      "words": 0
    }
  },
  "started_at": "2006-01-02T15:04:05Z",
  "state": "string",
  "text": "string",
  "warnings": [
    "string"
  ]
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "E_UNAUTHORIZED",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "send the local token as Authorization: Bearer <token>, or run `stuarty open` to open the editor in a browser",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "the request carries no credentials.",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 401,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "E_VALIDATION",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 422,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

The examples are built from the schemas of the OpenAPI document, so a value is a placeholder of its type. The fields that carry the real values are in the tables.
