# Create a complete event via the Audiobly API

This guide walks an integrator through building an entire event **end to end over the API** — event details, programme, speakers, sponsors, attendees, keyterms, source audio and transcription — with nothing done in the dashboard. Every step below is callable with an **API key**; no browser session is required.

- **Base URL (production):** `https://api.audiobly.com`
- **API reference:** the dashboard's **API Docs** page (sidebar → API Docs) renders the full OpenAPI reference for signed-in users. The machine-readable spec is at `GET /v1/openapi.json` (authenticated — send your API key).
- **All paths are under `/v1`.**

---

## 1. Authentication

Create an API key in the dashboard under **Organisation → API Keys**, or over the API with `POST /v1/api-keys`. The secret (`sk_live_…`) is shown **once**, in the create response. Send it as a bearer token on every request:

```
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx
```

An unscoped key is tied to one organisation and carries full management access to that organisation's data (everything an organisation admin can do, except creating/deleting organisations and editing the built-in roles). All data you create is automatically isolated to your organisation.

### Scopes, expiry and rotation

`POST /v1/api-keys` accepts:

| Field | Type | Notes |
|---|---|---|
| `name` | string | **required** — a label you'll recognise later |
| `scopes` | string[] | optional. Omit for an unrestricted key. When set, the key can only do what these permissions allow, e.g. `["read", "asset_view"]` for a read-only reporting key. Valid values include `read`, `event_create`, `event_edit`, `prep_manage`, `capture_upload`, `asset_view`, `asset_manage`, `analytics_view`, `sponsor_view`, `content_edit`, `org_manage` (the full list is in the API reference). An unknown scope is rejected with `422`. |
| `expires_in_days` | int | optional, > 0 — convenience for `expires_at` |
| `expires_at` | datetime | optional — the key stops working after this moment |

```bash
curl -sX POST https://api.audiobly.com/v1/api-keys \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name": "CMS sync (read-only)", "scopes": ["read", "asset_view"], "expires_in_days": 90}'
# → 201 { "id": "…", "name": "…", "key_prefix": "sk_live_", "key": "sk_live_…", "scopes": [...], "expires_at": "…" }
```

- `GET /v1/api-keys` lists your active keys (prefix, name, scopes, expiry, `last_used_at`) — secrets are never returned again.
- `POST /v1/api-keys/{key_id}/rotate` mints a new secret for the same key (same id, scopes and expiry). The old secret stops working immediately.
- `DELETE /v1/api-keys/{key_id}` revokes a key.

Managing keys needs the `org_manage` permission. A request with an expired or revoked key gets `401`; a scoped key calling something outside its scopes gets `403 FORBIDDEN`.

**Rate limiting:** API-key requests are rate-limited per organisation (Enterprise: 3,000 a minute, bursts of 60 a second). Over the limit you get `429` with a `Retry-After` header — back off and retry. See *Rate limits and plans*.

## Conventions

- **Content type:** JSON bodies use `Content-Type: application/json`. The bulk CSV importers take a **raw CSV body** with `Content-Type: text/csv` (not multipart form uploads). Image uploads (headshots, logos) are `multipart/form-data` with a `file` field.
- **IDs** are UUIDs returned by each create call — capture them to reference in later steps.
- **Idempotency:** send an `Idempotency-Key: <unique-string>` header on `POST /v1/events` to make retries safe (a repeat returns the original event instead of creating a duplicate). Other create calls are not idempotent — check before retrying them.
- **Errors** are normalised: `{"error": {"code": "...", "message": "...", "request_id": "..."}}` with an `X-Request-ID` response header. Quote the `request_id` in any support request. Validation failures return `422`.

---

## Step 1 — Create the event

`POST /v1/events`

| Field | Type | Notes |
|---|---|---|
| `title` | string | **required** |
| `event_date` | datetime | defaults from `starts_at` if omitted |
| `starts_at`, `ends_at` | datetime | ISO-8601 (`2026-09-05T09:00:00Z`) |
| `venue` | string | venue name |
| `city`, `country` | string | location |
| `theme` | string | the event's theme or strapline |
| `timezone` | string | IANA name, e.g. `Europe/London` |
| `languages` | string[] | language codes, e.g. `["en"]` or `["en-GB"]` — the language(s) spoken |
| `expected_attendees` | int | expected audience size |
| `keyterms` | string[] | optional — the event's keyterms (see Step 6) |
| `external_reference` | string | your own ID for the event (e.g. your CMS or ticketing ID), echoed back on reads |
| `event_type_id`, `industry_id` | uuid | optional taxonomy — see note below |
| `description` | string | |
| `org_unit_id` | uuid | Brand/Product this event lives under (omit for Customer level) |

```bash
curl -sX POST https://api.audiobly.com/v1/events \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: evt-2026-summit-001" \
  -d '{
    "title": "The Global Content Summit 2026",
    "starts_at": "2026-09-05T09:00:00Z",
    "ends_at":   "2026-09-06T17:00:00Z",
    "venue": "ExCeL London",
    "city": "London",
    "country": "United Kingdom",
    "theme": "Content in the age of AI",
    "timezone": "Europe/London",
    "languages": ["en"],
    "expected_attendees": 1200,
    "external_reference": "CMS-4471"
  }'
# → 201 { "id": "<EVENT_ID>", "status": "PENDING", ... }
```

> **Event type / vertical (optional):** `event_type_id` and `industry_id` reference taxonomy rows owned by your organisation. Create them first with `POST /v1/organizations/current/event-types` and `POST /v1/organizations/current/industries` (`{"name": "..."}`), then pass the returned IDs here. Skip both if you don't categorise events.

Capture `EVENT_ID` from the response for every step that follows.

> **Dates from the programme:** you can leave `event_date`, `starts_at` and `ends_at` out and add the programme first. An event with no dates takes them from its sessions: the date and start from the earliest session start, the end from the latest session end. This happens when sessions are created (`POST /v1/events/{EVENT_ID}/sessions`), imported (agenda text, reviewed agenda, website import) or re-timed (`PUT /v1/events/{EVENT_ID}/sessions/{SESSION_ID}` with new times), and dates filled this way keep following the programme as it changes. Dates you set yourself are never overwritten.

### Shortcut — import from the event's website

If the event already has a public website, Audiobly can read the programme, speakers and sponsors from it for you. It is a two-stage flow: a **preview** (nothing written) and an **apply**.

1. `POST /v1/site-import/preview` with `{"url": "https://summit.example.com", "scope": "programme"}` → `202 {"job_id": "…"}`. `scope` is one of `programme` (event details + sessions, the default), `summaries` (session abstracts), `speakers` or `sponsors` — run them one after another for a full import.
2. Poll `GET /v1/site-import/preview/{job_id}` until `status` is `ready` (the `preview` object is populated), `empty` (nothing extractable — see `message`) or `error`. Crawling a large site can take a minute or two.
3. Review the preview, then apply it: `POST /v1/events/{EVENT_ID}/import/website` with the `preview` object as the body → `{"counts": {...}}`. Sessions, speakers, tracks and sponsors are created or updated by name/title, and only blank event fields are filled.

Extra calls:

- `POST /v1/events/{EVENT_ID}/import/website/session-summaries` — write the abstracts from a `summaries` preview (`{"sessions": [...], "overwrite": false}`) onto the event's **existing** sessions, matched by title. It never creates or re-times sessions, so it is safe on an event that has already been recorded. Returns `updated`, `unchanged`, `kept` and `unmatched`.
- `GET /v1/events/{EVENT_ID}/import/website/summary` — counts of what the website import created.
- `DELETE /v1/events/{EVENT_ID}/import/website` — remove only what the website import created (manual and other rows are untouched), to start over.

The extracted text is grounded in the site: fields the site does not state are left empty, never guessed.

---

## Step 2 — Add the programme (sessions)

Create sessions one at a time, or bulk-load an agenda. In the API a talk, panel or keynote is a **session**.

**Per session** — `POST /v1/events/{EVENT_ID}/sessions`

| Field | Notes |
|---|---|
| `title` | **required** |
| `starts_at`, `ends_at` | ISO-8601 |
| `session_type` | e.g. `keynote`, `panel` |
| `description` | the session abstract |
| `language` | language code of this talk when it differs from the event's (e.g. `"fr"` for one French talk at an English event) — it is transcribed in its own language |
| `track_id`, `location_id` | optional — create with `POST /v1/events/{EVENT_ID}/tracks` and `POST /v1/events/{EVENT_ID}/locations` first |

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/sessions \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"title": "Opening Keynote", "starts_at": "2026-09-05T09:15:00Z", "ends_at": "2026-09-05T10:00:00Z", "session_type": "keynote"}'
# → 201 { "id": "<SESSION_ID>", ... }
```

**Bulk agenda** — `POST /v1/events/{EVENT_ID}/sessions/agenda` with a raw programme text body (`Content-Type: text/plain`). Audiobly parses it into ordered sessions and a speaker/moderator roster. A multi-day programme marks each day with a heading line starting `Day N` (`Day 2`, `Day 2 · Thursday, March 12, 2026`); its sessions go on the event's first date plus N−1 days. A time line may be a range (`09:00 - 10:15`, `9.00–10.15`, `9am to 10.15am`): the second time is the session's end. A line starting `Summary:` under a session's title is that session's summary (stored as its `description`); a second `Summary:` line under the same session adds another paragraph. A file that gives a session a summary replaces the summary it has; a session with no `Summary:` line keeps its own. Re-posting an updated programme updates the existing sessions instead of duplicating them: each line is matched to a session with the same title on the same day, at the same time when a title repeats. Add `?replace=true` to overwrite an existing programme.

```text
Day 1

09:00 - 09:30
Opening keynote: The year ahead
Jane Smith, CEO, Example Media
Summary: A look at the twelve months ahead for publishers.

09:30
Panel: What audiences want next
Alex Brown, Editor, Daily Example
Moderator: Sam Lee, Founder, Example Labs
Summary: Three leaders compare what their audiences ask for.
Summary: The session ends with questions from the room.

Day 2

09:00 - 09:45
Keynote: What comes next
Ada Lovelace, CTO, Example Ltd
```

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/sessions/agenda \
  -H "Authorization: Bearer $KEY" -H "Content-Type: text/plain" --data-binary @agenda.txt
# → { "sessions": [ … ], "speakers_created": 4, "links_created": 4 }
```

A file with no agenda lines returns `400 INVALID_AGENDA` (also for a file over 2 MiB or one that is not UTF-8 text).

**Preview first** — `POST /v1/events/{EVENT_ID}/sessions/agenda:preview` takes the same text (and the same `?replace=true`) and returns what the upload would do, saving nothing: each session with its `day`, `start`, `end`, `title`, `session_type` and `speakers`, and `existing: true` when it would re-time a session the event already has. With `?replace=true`, `removed` lists the titles of the sessions the upload would delete. When the preview looks right, send the same text to `/sessions/agenda`.

```bash
curl -sX POST "https://api.audiobly.com/v1/events/$EVENT_ID/sessions/agenda:preview?replace=true" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: text/plain" --data-binary @agenda.txt
# → { "sessions": [ { "day": 1, "start": "09:00", "end": "09:45", "title": "Opening keynote",
#                     "session_type": null, "speakers": ["Ada Lovelace"], "existing": false }, … ],
#     "removed": ["Old panel"], "speakers_created": 4 }
```

For a review-before-commit flow use `POST /v1/events/{EVENT_ID}/sessions/agenda:ai-extract` (reads a programme in any layout and returns it without saving: tracks, sessions with `day`, `start`, `end`, `title`, `session_type`, `summary` and speakers) and then `POST /v1/events/{EVENT_ID}/sessions/agenda:ai-apply` with the reviewed result. A session's `summary` is copied from the text, never written by Audiobly, and is `null` when the text has none; on apply it becomes the session's `description`.

**Move the whole programme to other days** — `POST /v1/events/{EVENT_ID}/sessions/shift` with `{"days": N}` moves every session by `N` whole days (negative: earlier, between −3660 and 3660), each keeping its time of day. Use it when the event moves to a new date: Day 1 moves to the new date. Sessions without a time are left alone, and the event's own dates are not changed by this call (update them with `PUT /v1/events/{EVENT_ID}`).

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/sessions/shift \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"days": 7}'
# → { "moved": 12 }
```

`days: 0` changes nothing and returns `{"moved": 0}`.

Assign roster speakers to a session at any time with `PUT /v1/events/{EVENT_ID}/sessions/{SESSION_ID}/speakers`.

---

## Step 3 — Add speakers

**Per speaker** — `POST /v1/events/{EVENT_ID}/speakers`

| Field | Notes |
|---|---|
| `name` | **required** — the display name, e.g. `"Ada Lovelace"` |
| `first_name`, `last_name` | optional extras for sorting and personalisation; they do **not** replace `name` |
| `honorific` | Dr, Lord, Sir … |
| `job_title`, `company`, `company_website` | a website links the speaker to an auto-enriched company profile |
| `country` | |
| `email` | the speaker's contact address; not shown on event websites |
| `bio` | |
| `headshot_url` | a URL from the headshot upload below, or a link to an image you host |
| `social_links` | object, e.g. `{"linkedin": "…", "twitter": "…", "website": "…"}` |
| `status` | for event websites: `confirmed`, `invited` or `tbc` |
| `tags` | string[] — your own labels |
| `voice_type` | `male` or `female` — the voice used for this speaker in live translation audio. Set it yourself; it is never guessed. |
| `session_ids` | uuid[] — the sessions this speaker is in (replaces the current set) |

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/speakers \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"Ada Lovelace","first_name":"Ada","last_name":"Lovelace","job_title":"Chief Engineer","company":"Analytical Engines","company_website":"analyticalengines.example","session_ids":["'$SESSION_ID'"]}'
# → 201 { "id": "<SPEAKER_ID>", ... }
```

Sending only `first_name` and `last_name` without `name` fails with `422`.

**Headshots** — upload the image first, then store the returned URL on the speaker:

```bash
curl -sX POST https://api.audiobly.com/v1/branding/headshot \
  -H "Authorization: Bearer $KEY" -F "file=@ada.jpg"
# → { "url": "/v1/media/branding/…" }   # put this in headshot_url
```

JPG, PNG or WEBP, under 10 MB. The returned URL is stable and publicly viewable, so it can be embedded on your event website.

**Framing (optional)** — to crop a headshot to a round icon, or fit a logo into a square, send the visible square to `POST /v1/branding/image/frame` and store the URL it returns. `source` is an uploaded image (`/v1/media/branding/…`) or a public `https://` image; `x`, `y`, `width` and `height` are fractions of the image's width and height (they may reach past its edges, e.g. a wide logo zoomed out); `shape` is `circular` (headshots, the default) or `rounded` (logos).

```bash
curl -sX POST https://api.audiobly.com/v1/branding/image/frame   -H "Authorization: Bearer $KEY" -H "Content-Type: application/json"   -d '{"source":"/v1/media/branding/…/ada.jpg","x":0.1,"y":0.05,"width":0.8,"height":0.6,"shape":"circular"}'
# → { "url": "/v1/media/branding/…" }   # put this in headshot_url
```

SVG images cannot be framed (`400`); use them as they are.

**Bulk (CSV)** — `POST /v1/events/{EVENT_ID}/speakers/import` with a raw CSV body (`Content-Type: text/csv`). Headers are matched flexibly (case/spacing/order tolerant; unknown columns ignored); in the CSV, **First name + Last name are required** and the display name is built from them. Supported columns:

```
Title,First name,Last name,Job title,Company,Company website,Headshot URL,Bio,Linkedin,Twitter,Website,Sessions
Dr,Ada,Lovelace,Chief Engineer,Analytical Engines,analyticalengines.example,,Pioneer of computing,,,,Opening Keynote
```

`Sessions` is a `|`-separated list of session titles to link the speaker to. Importing a file again updates the speakers already on the event (matched by first and last name) instead of adding them twice, and adds only the session links they do not have yet. Once transcription is done, you can also let Audiobly propose speakers from the transcript with `POST /v1/events/{EVENT_ID}/speakers/extract`.

---

## Step 4 — Add sponsors

**Per sponsor** — `POST /v1/events/{EVENT_ID}/sponsors`
Fields: `name` (**required**), `tier`, `country`, `website`, `logo_url`, `blurb`, `products[]`, `objectives`, `ctas[]`, `highlight_stats[]`, and the commercial fields `sponsorship_value`, `sponsorship_paid`, `sponsorship_currency`.

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/sponsors \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"Northwind","tier":"Lead partner","website":"https://northwind.example"}'
```

**Sponsor logos** — `POST /v1/branding/sponsor-logo` (multipart, `file` field; JPG, PNG or WEBP under 10 MB) returns `{"url": "…"}` to store in `logo_url`.

**Files on a sponsor's profile** (brochures, case studies) — `POST /v1/events/{EVENT_ID}/sponsors/{SPONSOR_ID}/attachments` (multipart with `file` and `label`). List with `GET`, rename or reorder with `PATCH …/attachments/{ATTACHMENT_ID}` (`label`, `sort_order`), remove with `DELETE`.

**Bulk** — `POST /v1/events/{EVENT_ID}/sponsors/import` with a raw body: either a columnar CSV (`Name,Website,Tier,…`) or a simple pasted list of names / URLs. Giving a website lets Audiobly auto-enrich each sponsor (summary, industry, products, logo) — you can also trigger enrichment later with `POST /v1/events/{EVENT_ID}/sponsors/refresh`.

---

## Step 5 — Add attendees

**Per attendee** — `POST /v1/events/{EVENT_ID}/attendees`

| Field | Notes |
|---|---|
| `name` | **required** — display name |
| `first_name`, `last_name` | optional extras (do not replace `name`) |
| `email` | |
| `honorific`, `job_title`, `company`, `company_website`, `country` | a company website enriches the linked company profile |
| `role` | delegate type, e.g. `Delegate`, `Speaker`, `VIP` |
| `seniority`, `function` | optional — sending them overrides the automatic classification |
| `marketing_consent` | lead-sharing opt-in; `null` = unknown (never shared) |
| `bio`, `headshot_url`, `social_links` | as for speakers; upload headshots with `POST /v1/branding/headshot` |

```bash
curl -sX POST https://api.audiobly.com/v1/events/$EVENT_ID/attendees \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"Dana Delegate","first_name":"Dana","last_name":"Delegate","email":"dana@acme.example","company":"Acme","job_title":"VP Marketing","marketing_consent":true}'
```

**Bulk (CSV)** — `POST /v1/events/{EVENT_ID}/attendees/import` with a raw CSV body (`Content-Type: text/csv`); headers are matched flexibly, **First name + Last name required**:

```
First name,Last name,Email,Company,Job title,Seniority,Function
Dana,Delegate,dana@acme.example,Acme,VP Marketing,VP,Marketing
```

Attendee companies are enriched and each attendee's seniority and function are classified in the background; track progress with `GET /v1/events/{EVENT_ID}/attendees/enrichment-status`. The result feeds audience intelligence (seniority mix, sectors) across insights and reports.

---

## Step 6 — Add keyterms & glossary

Keyterms bias transcription toward the correct spelling of names, brands and jargon.

**Set event keyterms** — `PUT /v1/events/{EVENT_ID}/keyterms`

| Field | Notes |
|---|---|
| `keyterms` | **required** — string[] of terms to recognise |
| `variants` | optional — explicit misspellings to rewrite to a keyterm, as `{"Ozempic": ["ozempick", "o zempic"]}`. Only needed for word-shaped terms: for a term containing a number (e.g. `GLP-1`), number-word and spacing variants such as `GLP one` are derived automatically. |

```bash
curl -sX PUT https://api.audiobly.com/v1/events/$EVENT_ID/keyterms \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"keyterms": ["GLP-1", "Nextida GC", "Palatinose"], "variants": {"Palatinose": ["palatinoes"]}}'
```

You can also learn terms from a website: `POST /v1/events/{EVENT_ID}/keyterms/extract` with `{"url": "https://…"}`; read the result with `GET /v1/events/{EVENT_ID}/keyterms`.

**Organisation glossary (optional, reusable across events):** `POST /v1/glossary` per term, or bulk `POST /v1/glossary/import` with a raw CSV body. Headers are case/order tolerant; only a `term` column is required:

```
term,expansion,category,context,variants
GLP-1,Glucagon-like peptide-1,acronym,Nutrition,GLP1|GLP one
```

---

## Step 7 — Upload the source audio/video

Attach audio to a **session** (per-session pipeline, recommended for multi-session events) or to the **event** (single stream). The flow is **request an upload → send the bytes → complete**. Accepted types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/mp4`, `audio/x-m4a`, `audio/flac`, `audio/aac`, `audio/ogg`, `audio/webm`, `video/mp4`, `video/quicktime`, `video/x-matroska`, `video/webm`. Maximum file size 20 GB.

**7a. Request an upload** — `POST /v1/uploads`

| Field | Notes |
|---|---|
| `filename`, `file_size` (bytes), `content_type` | **required** |
| `session_id` / `event_id` / `metadata` | exactly one: attach to a session, attach to the event, or `metadata` (an event-create object) to create the event and attach in one call |
| `part_bytes` | optional — forces a multipart upload with parts of roughly this size |

```bash
curl -sX POST https://api.audiobly.com/v1/uploads \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"filename":"keynote.mp3","file_size":52428800,"content_type":"audio/mpeg","session_id":"'$SESSION_ID'"}'
```

The response depends on the file size:

| File | Response | What to do |
|---|---|---|
| **100 MB or smaller** (and no `part_bytes`) | `upload_url` is a presigned URL, `multipart` is `null` | single PUT (7b) |
| **Larger than 100 MB**, or `part_bytes` sent | `upload_url` is **empty** and `multipart` = `{upload_session_id, part_size, part_count}` | multipart (7b-multipart) |

```json
{ "upload_id": "…", "upload_url": "", "expires_in": 3600, "event_id": "…", "session_id": "…",
  "multipart": { "upload_session_id": "…", "part_size": 16777216, "part_count": 128 } }
```

**7b. Single PUT** — HTTP `PUT` the raw file to `upload_url`, with the same `Content-Type` you declared:

```bash
curl -sX PUT "$UPLOAD_URL" -H "Content-Type: audio/mpeg" --data-binary @keynote.mp3
```

**7b-multipart. Upload in parts** — slice the file into `part_count` chunks of `part_size` bytes (the last one may be shorter), numbered from 1.

1. Get presigned part URLs in batches (they expire after `expires_in` seconds, so ask for them as you go rather than all at once):
   `POST /v1/uploads/multipart/{upload_session_id}/part-urls` with `{"part_numbers": [1, 2, 3, 4]}` → `{"urls": [{"part_number": 1, "url": "…"}, …], "expires_in": 3600}`
2. `PUT` each chunk's raw bytes to its URL. Failed parts can simply be re-sent.
3. Assemble: `POST /v1/uploads/multipart/{upload_session_id}/complete` → `{"status": "completed", "parts": 128}`. You do not send ETags — Audiobly reads the part list back from storage. This only assembles the file; it does **not** start transcription (step 7c does).

To cancel, `POST /v1/uploads/multipart/{upload_session_id}/abort`.

**Resuming an interrupted multipart upload:** `GET /v1/uploads/in-progress?event_id={EVENT_ID}` lists open multipart uploads for the event and its sessions (`upload_session_id`, `session_id`, `filename`, `file_size`, `part_size`, `part_count`). `GET /v1/uploads/multipart/{upload_session_id}/parts` returns the parts already stored, so you PUT only the missing ones and then complete. An unfinished upload expires about a day after it starts; resuming one that has expired returns `409 UPLOAD_EXPIRED` — start a new upload.

**7c. Complete** — this finalises the upload **and starts transcription**. Call it after the single PUT, or after `multipart/…/complete`:

```bash
API=https://api.audiobly.com/v1
# session-level — POST /v1/uploads/sessions/{session_id}/complete:
curl -sX POST "$API/uploads/sessions/$SESSION_ID/complete" -H "Authorization: Bearer $KEY"
# or event-level — POST /v1/uploads/{event_id}/complete:
curl -sX POST "$API/uploads/$EVENT_ID/complete" -H "Authorization: Bearer $KEY"
# → 202 { "status": "queued" }
```

| Error | Meaning |
|---|---|
| `400 INVALID_REQUEST` | unsupported content type, or file over 20 GB |
| `409 UPLOAD_INCOMPLETE` | you called complete but the bytes never arrived in storage — upload the file again |
| `409 CONFLICT` | nothing to complete, or the session/event is already processing |

### Alternative — import an existing transcript

If you already have a transcript (from a previous provider, or a caption file), skip the audio: `POST /v1/events/{EVENT_ID}/sessions/{SESSION_ID}/transcript/import` with `{"text": "…", "run_analysis": true}`. Plain text with `Name: words` lines becomes speaker turns; a WebVTT or SubRip caption file keeps its timing. The text goes through the same clean-up as a transcribed one (house spelling from your keyterms, filler removal) and returns `201` with the transcript.

---

## Step 8 — Transcription & polling

Completing an upload (Step 7c) starts the pipeline automatically — there is no separate "transcribe" call. The item walks `UPLOADED → QUEUED → TRANSCRIBING → PII_DETECTING → PII_REDACTED → TRANSCRIPT_READY` on its own. Poll:

| What | Endpoint |
|---|---|
| Event status + per-stage progress | `GET /v1/events/{EVENT_ID}`, `GET /v1/events/{EVENT_ID}/timeline` |
| Per-session status | `GET /v1/events/{EVENT_ID}/sessions` (`status`, `has_audio`) |
| A session's transcript | `GET /v1/events/{EVENT_ID}/sessions/{SESSION_ID}/transcript` |

```bash
curl -s https://api.audiobly.com/v1/events/$EVENT_ID -H "Authorization: Bearer $KEY" | jq .status
```

**What is running now** — `GET /v1/events/{EVENT_ID}/activity` lists the event's work in progress, and what finished in the last few hours: file imports, transcriptions, video jobs and attendee enrichment. The admin's Activity panel shows the same list. `running` counts the items still moving, processing or waiting. Each item has a `kind` (`import`, `transcription`, `video` or `enrichment`), a `state` (`waiting`, `moving`, `processing`, `done`, `attention` or `failed`), counts and a one-line `detail` in plain words.

```bash
curl -s https://api.audiobly.com/v1/events/$EVENT_ID/activity -H "Authorization: Bearer $KEY"
# → { "running": 1,
#     "items": [ { "id": "transcription:…", "kind": "transcription", "title": "Opening keynote",
#                  "place": "source:files", "state": "processing", "done": 0, "total": 0,
#                  "detail": "Transcribing", "bytes_done": null, "bytes_total": null,
#                  "updated_at": "2026-11-12T09:58:02Z" } ] }
```

To regenerate a session's transcript later (e.g. after replacing audio), call `POST /v1/events/{EVENT_ID}/sessions/{SESSION_ID}/retranscribe`. A re-run replaces every transcript version of the session, so once editors have started reviewing it you must add `?confirm_discard_edits=true` (otherwise `409`).

Downstream (transcripts, analysis, reports, content assets) is available once a transcript is ready — see *Fetch a complete event via the API*.

---

## End-to-end example

```bash
KEY="sk_live_xxx"; API="https://api.audiobly.com/v1"
H=(-H "Authorization: Bearer $KEY" -H "Content-Type: application/json")

# 1. Event
EVENT_ID=$(curl -s "${H[@]}" -X POST $API/events \
  -d '{"title":"Global Content Summit","starts_at":"2026-09-05T09:00:00Z","venue":"ExCeL London","city":"London","expected_attendees":1200,"languages":["en"]}' | jq -r .id)

# 2. Session
SESSION_ID=$(curl -s "${H[@]}" -X POST $API/events/$EVENT_ID/sessions \
  -d '{"title":"Opening Keynote","session_type":"keynote"}' | jq -r .id)

# 3. Speaker (name is required) + a CSV import
curl -s "${H[@]}" -X POST $API/events/$EVENT_ID/speakers \
  -d '{"name":"Ada Lovelace","company":"Analytical Engines","session_ids":["'$SESSION_ID'"]}'
curl -s -H "Authorization: Bearer $KEY" -H "Content-Type: text/csv" \
  -X POST $API/events/$EVENT_ID/speakers/import \
  --data-binary $'First name,Last name,Company\nCharles,Babbage,Analytical Engines\n'

# 4–5. Sponsor and attendee
curl -s "${H[@]}" -X POST $API/events/$EVENT_ID/sponsors \
  -d '{"name":"Northwind","tier":"Lead partner","website":"https://northwind.example"}'
curl -s "${H[@]}" -X POST $API/events/$EVENT_ID/attendees \
  -d '{"name":"Dana Delegate","email":"dana@acme.example","company":"Acme"}'

# 6. Keyterms
curl -s "${H[@]}" -X PUT $API/events/$EVENT_ID/keyterms -d '{"keyterms":["GLP-1"]}'

# 7. Upload (file ≤ 100 MB → single PUT), then complete (starts transcription)
UP=$(curl -s "${H[@]}" -X POST $API/uploads \
  -d '{"filename":"keynote.mp3","file_size":52428800,"content_type":"audio/mpeg","session_id":"'$SESSION_ID'"}')
curl -s -X PUT "$(echo "$UP" | jq -r .upload_url)" -H "Content-Type: audio/mpeg" --data-binary @keynote.mp3
curl -s -H "Authorization: Bearer $KEY" -X POST $API/uploads/sessions/$SESSION_ID/complete

# 8. Poll
watch -n 10 "curl -s $API/events/$EVENT_ID/sessions -H 'Authorization: Bearer $KEY' | jq '.data[] | {title,status}'"
```

For a file over 100 MB, replace the single PUT with the multipart loop in Step 7.

That's a complete event — details, programme, roster, keyterms, audio and transcription — created entirely through the API.
