Skip to main content
API v2 is available to Enterprise and Business organizations. API v1 keeps working for every other account. Team endpoints follow what the organization’s plan includes: budgets and credit limits, groups, tool permissions and audit logs are Enterprise features, and answer 403 for a Business organization.
API v2 lives under https://api.magnific.com/v2. It covers projects and folders, uploads, image, video and audio generation and edits, flows, brand kits, your creations and the library, plus your team’s members, groups, API keys, credit limits, tool permissions, credit usage and Enterprise audit logs. Every request acts as the user or the organization the credentials belong to.

Authentication

Send one of:
  • API key (Enterprise and Business organizations): x-magnific-api-key: <your-api-key>. Generations are charged to the key, and the key’s own permissions decide which tools and models it may use.
  • Personal access token: Authorization: Bearer <token>, with these scopes:
A dry run (?dry_run=true) needs the scope of the call it prices: api:write to price a generation. A call without the scope it needs returns 403 with code: insufficient_scope and details.required_scope. A credential that belongs to another Magnific deployment returns 421 wrong_deployment.

Get a personal access token

A personal access token acts as you, with your projects, your permissions and your credits. There is no token to copy from the web: you get one by signing in with your Magnific account through the OAuth 2.0 device flow (RFC 8628), with the public client magnific-api-cli. No client secret is needed: any tool that can make HTTP requests can follow these steps.
1

Start the device flow

Ask for the scopes you need. Add offline_access to get a refresh token that keeps working while you use it.
The answer carries device_code, user_code, verification_uri_complete, expires_in (600 seconds) and interval (5 seconds).
2

Approve it in the browser

Open verification_uri_complete, sign in with your Magnific account and approve the scopes. The code expires after 10 minutes.
3

Exchange the device code for tokens

Poll every interval seconds until the answer stops being authorization_pending:
The answer carries access_token, refresh_token, expires_in and the granted scope.
4

Call the API

Lifetimes Refresh the access token before it expires; the refresh token stays the same:
Revoke it when you are done:
Revoking stops new access tokens; one already issued keeps working until it expires, at most one hour. The issuer is https://auth.magnific.com/realms/api (discovery at /.well-known/openid-configuration) and the token’s audience is https://api.magnific.com/v2. GET https://api.magnific.com/.well-known/oauth-protected-resource/v2 lists the authorization server and the scopes. A token for an account that has never signed in to Magnific on the web returns 404.

Projects and folders as a destination

Uploads, generations, edits and flow runs land in the project or folder you name with folder_reference in the request body. It takes either: a project’s reference or a folder’s reference. To find a reference:
  • In Magnific: open the project or folder; the reference is the last part of the URL, …/projects/<reference>.
  • By API: GET /v2/projects lists your projects with their reference (filter with ?name=), and GET /v2/projects/{project_reference}/folders the folders inside a project or folder. POST /v2/projects and POST /v2/folders return the reference of what they create.
A project or folder you can’t add to returns 403 forbidden, and a malformed reference returns 422 invalid_folder_reference. Without folder_reference, the result lands in your Personal project. The X-Folder-Reference header of the web is not accepted: it returns 422 invalid_folder_reference.

Rate limits

Exceeding a limit returns 429 with code: rate_limited and a Retry-After header. Limits can be raised per customer on request.

Errors

Errors from projects, creations, generation, edits, flows, brand kits, the library, stock and audio share one body:
Every error on /v2 has at least code, message and request_id; errors from the gateway itself (400 team_required, 401, 403, 404, 421, 429, 503) have no details.

Webhooks

Instead of polling a generation, send webhook_url with an API key on any call that queues creations (generation, audio, edits and tools): Magnific calls it, signed as on API v1, when each creation completes or fails, and retries for about a day while your endpoint is down. See Webhooks.

Pagination

Lists take ?cursor= (and limit where a list allows it) and answer { "data": [...], "meta": { "pagination": { "has_more": true, "next_cursor": "…" } } }. Follow meta.pagination.next_cursor while has_more is true; it is absent on the last page. Stock, team and audit log lists work the same way. Catalogs (GET /v2/audio/voices, GET /v2/videos/vfx, GET /v2/videos/upscale/models) answer all at once: the items under data. GET /v2/projects lists the projects your credentials can reach. To list every project of the organization, owners and admins use GET /v2/team/project-budgets, which also gives each project’s budget.

Models

API v2 offers the models API v1 sells. Name the model in the URL (POST /v2/images/generate/{model}, POST /v2/videos/generate/{model}, POST /v2/videos/speak/{model} and the audio endpoints), by its slug or its API v1 name; any other model returns 422. Each model has its own page under Image generation API, Video generation API and Audio generation API, with the values it takes and an example. Add ?dry_run=true to any call that spends credits to get its cost first (Price a call).

Brand kits

A brand kit stores your brand once (colours, imagery style, tone of voice and typography rules) so the images you generate start from it. Create a kit with POST /v2/brand-kits, feed it from your own creations, PDF, markdown or text files you upload (POST /v2/brand-kits/{brand_kit_id}/documents/uploads), a website or your social profiles, follow the extraction with GET /v2/brand-kits/runs/{run_id} and edit it (rules, templates, sections, assets and fonts). List the kits you can use with GET /v2/brand-kits and read one, with its templates and logos (content.templates, content.logo_marks), with GET /v2/brand-kits/{brand_kit_id}. Test a ready kit with a validation round (POST /v2/brand-kits/{brand_kit_id}/validation/runs): generate its planned samples, record them, turn the user’s feedback into a patch and apply it. Only a kit’s owner edits it, and a kit out of your reach answers 404. Step by step, with examples: Brand kits. Generate with a kit on Magnific One, POST /v2/images/generate/magnific-one:
  • brand_kit_id: the kit’s id. Only a kit whose status is ready.
  • brand_kit_template_slug (optional): one of the kit’s templates, by its slug.
  • brand_kit_logo (optional): one of the kit’s logo_marks, by its sqid.
  • brand_kit_variant_ids (optional): up to three of the kit’s content.variants, such as a market or a campaign, at most one per kind.
Another model (auto, the default, included), a kit you cannot read or that is still being built, a template or logo the kit does not have, or references Magnific One does not take return 422 on the field, before anything is charged. With an API key, only the kits of the key’s organization are reachable. A flow with a brand kit input takes {"brand_kit_id": "…", "brand_kit_template_slug": "…"}. A brand kit does not guarantee exact fonts, exact colour values or pixel-identical placement.

Creations

Everything a generation, an edit or an upload produces is a creation. Read where one stands with GET /v2/creations/{creation_id} and its files with GET /v2/creations/{creation_id}/download; rename, move, duplicate (POST /v2/creations/duplicate, into a project or folder you may edit) or trash it. Search the user’s creations with GET /v2/search/creations: pick a source (history, all assets, favorites, downloads, trash or uploads) and filter by type, tool, model, date, comments or hearts, and by review status and tags as GET /v2/tags/filters names them. Heart one with PUT /v2/creations/{creation_id}/like. For an editor, POST /v2/creations/{creation_id}/deliveries renders a completed creation in an editor-native format (ProRes, DNxHR or hvc1 video, 16-bit PNG or TIFF or layered PSD images, WAV or MP3 audio): free, rendered once, counted as a download, and carrying the source’s Content Credentials where the container can hold them. When you save creations outside Magnific yourself, record it first with POST /v2/creations/downloads: it records the download for the audit and the usage accounting, and answers the file to save where url is only a re-encode.

Endpoints

Account

Image generation

Image editing

Video generation

Video editing

Motion graphics (Magnific Move)

Lip sync

Audio generation

Flows

Creations

Tags

Projects and folders

Uploads

Stock

Library

Brand kits

Team, budgets, permissions and audit logs

With a personal token, send x-magnific-team-id to pick the team; an API key always acts on its own team. Writes answer 200 with the resource as it is after the change. Credit limits, groups, tool permissions and audit logs are available only to Enterprise teams.