# File API

Upload, download and delete files attached to tickets or held generally.

Type: reference · Mode: develop · Status: unverified

---
File endpoints upload, download and delete files, attachments on a
[Service Ticket](/reference/rest-api/service-ticket/) or [Fallout Ticket](/reference/rest-api/fallout-ticket/),
or general storage.

See [REST API reference](/reference/rest-api/) for the base URL and authentication header
every request below needs.

## GET /v1/file/{id}

**Download File:** download a file's content by ID.

<div class="sym-spec-table">

| Parameter | Type | Need | Notes |
| --- | --- | --- | --- |
| `id` | string | Required | The file's unique identifier. |

</div>

**Example request:**

```
curl --location 'https://app.symphona.ai/dashboard/api/v1/file/5cda1d48-2378-4f8f-bd5c-131e7a7c70c0' \
--header 'apiKey: xxxxxx'
```

**Sample response (200 OK):** the raw file content.

## POST /v1/file

**Upload File:** upload one or more files, optionally associated with an issue (a
Service Ticket or Fallout Ticket). Supports multipart form data as well as JSON base64
payloads.

**Request body:**

<div class="sym-spec-table">

| Field | Type | Need | Notes |
| --- | --- | --- | --- |
| `issueId` | string | Required if attaching to a ticket | The issue/ticket this file belongs to. |
| `file` | string (binary)[] | Optional | Binary file content; repeatable for multiple files. |
| `fileInfo` | string | Optional | JSON metadata (e.g. per-file description). |

</div>

**Example request:**

```
curl --location 'https://app.symphona.ai/dashboard/api/v1/file' \
--header 'apiKey: xxxxxx' \
--form 'file=@"/path/to/Hello World.txt"' \
--form 'fileInfo="[{\"description\": \"Demo\"}]"'
```

**Sample response (200 OK):**

```json
[
  {
    "id": "5cda1d48-2378-4f8f-bd5c-131e7a7c70c0",
    "name": "Hello World.txt",
    "description": "Demo",
    "type": "FILE",
    "mediaLink": "https://storage.googleapis.com/download/storage/v1/b/symphona-st/o/..."
  }
]
```

## DELETE /v1/file/{id}

**Delete File:** remove a file from the system.

<div class="sym-spec-table">

| Parameter | Type | Need | Notes |
| --- | --- | --- | --- |
| `id` | string | Required | The file's unique identifier. |

</div>

**Example request:**

```
curl --location --request DELETE 'https://app.symphona.ai/dashboard/api/v1/file/5cda1d48-2378-4f8f-bd5c-131e7a7c70c0' \
--header 'apiKey: xxxxxx'
```

**Sample response:** `200 OK`, "File deleted successfully".