Authentication

A key opens your agency to your scripts, with no account and no sign-in. It belongs to the agency: what it makes, every member sees in ValidFile, marked with the key’s name.

Every call carries the key in the Authorization: Bearer vf_live_… header, never in the address, which logs keep whole. A key always starts with vf_live_, or vf_test_ for a test key, which makes it recognisable in a code repository where it was published.

curl https://validfile.ca/api/v1/balance \
  -H "Authorization: Bearer $VALIDFILE_KEY"

Scopes

ScopeWhat it allows
deliveries:writeMakes deliveries, sends files, chooses placements, and reads everything. Read and write in ValidFile.
deliveries:readReads deliveries, verdicts and the balance, and nothing else: for a dashboard. Read only in ValidFile.
drop-links:writeOn top of deliveries:write: makes the drop link of a campaign, receives its address and cuts it. Read, write and drop links in ValidFile. Never a test key.

A scope is chosen when the key is made and never changes. The drop links are apart from writing because a link is not one more file: its address takes files on the agency’s account, from whoever holds it, and making a new one cuts the one your client received. A key made before this scope existed does not have it.

From a server only

The API answers no web page of another site: it sends no CORS headers, and a browser refuses to talk to it. A key put in a page would be readable by anyone who opens it anyway. Call the API from your server, your automation tool or a script.

A key’s life

A key works as long as the person who made it is part of the agency, and as long as the agency has a plan with the API. Otherwise it answers:

StatuserrorWhy
401key_missing, key_invalidNo key in Authorization, or no key matches.
401key_revokedAn owner cut it.
401key_maker_leftThe person who made it left the agency.
403agency_suspendedValidFile suspended the agency; the key answers again once it is lifted.
403plan_requiredThe agency no longer has the API: Solo, Team, or a plan that ended.
403scopeThe key does not have the scope the route asks for.
  • A key cut is cut for good. So is one whose maker left, even if they come back: invited again, they make a new one. Someone who leaves may have kept a copy of the key; plan to make a new one at each departure.
  • On a plan without the API, Your agency › API lists the keys that were not cut: they would work again back on a plan with the API. Cut the ones that must not come back.
  • To change keys without a stop: make the new one, deploy it, then cut the old one. Up to 5 active keys on Agency, 20 on Volume.

A key’s ceiling

When it is made, a key can be given a ceiling of files per plan period, per calendar month during the trial. Each file announced counts, even one never sent; giving it up gives its place back. Once reached, the key answers 402 key_ceiling until the next period, without touching the other keys: a script that runs away does not empty the agency’s plan. The files your clients drop through a drop link a key made do not count under this ceiling: each link has its own, and the agency sets one for all its links.

Test keys

To wire your tool without spending credits, make a key in Test mode in Your agency › API. It starts with vf_test_ and is used like any other: its files are measured and judged for real, with your catalogue and your formats, and cost nothing. Each delivery it makes carries "test": true.

  • 10 test files per 24 h for the whole agency, all its test keys together. Beyond that, 429 test_limit, with Retry-After until the oldest is erased. Giving up a file never sent gives its place back.
  • Each file is erased 24 h after it was announced, bytes included, and a test delivery once it is empty and 24 h old. It then answers 404.
  • A test key sees only test deliveries, and a live key never those. ValidFile shows them nowhere: no review (reviewUrl is null), no export, no drop link.
  • No webhook goes out for a test delivery. To try your receiver, Send a test beside the address sends a signed event.
  • The mode is chosen when the key is made and never changes: a key that should spend credits is a new key. It counts among the plan’s active keys.

A key published by mistake

Cut it at once in Your agency › API: it can spend the agency’s credits and read its campaigns’ names. It cannot download any creative: the API never returns a file’s bytes. If its scope includes the drop links, it can also make and cut your campaigns’ links: once it is cut, look at Your agency › Drop links, whose activity names the key. The list of keys shows when each was last used.