Veriframe

API guide: build Veriframe into your system

How to connect a case system, an evidence store or a claims pipeline to Veriframe, so that a CCTV export goes in at one end and playable MP4 lands against the right matter at the other. The requests first, in any language, then the decisions that are yours.

This is the guide; the API reference is the detail. The reference lists every call, field and error code. Read this page to see how they fit together, then keep the reference open while you build.

What you are building

  1. Create a job for one recording, labelled with your own reference.
  2. Give it the footage: upload the export, or hand us a link to fetch.
  3. Find out when it is done: ask, or be told.
  4. Put the result where it belongs: download it, send it to a storage folder, or give someone a link to watch it.
  5. Let it be deleted: straight away if you are finished, or on the timer if not.

That is the whole integration. There is no SDK to install and nothing to host: every step is an HTTPS call with JSON in and out.

Before you start

A complete conversion, request by request

These are the requests in the order they happen. They are plain HTTPS, so they work from any language, an integration platform, or a tool such as Postman or curl.

1. Create the job

POST https://veriframe.co.uk/job
Authorization: Bearer <your API key>
Content-Type: application/json

{"label": "claim 4471"}
201 Created

{"job_token": "<long secret>", "url": "https://veriframe.co.uk/job/<job token>",
 "ref": "a1b2c3d4e5f6", "expires_after_hours": 24}

Save job_token. It is shown once, and it is the address of everything that follows.

2. Give it the footage

Either point us at a link:

POST https://veriframe.co.uk/job/<job token>/source
Content-Type: application/json

{"source_url": "https://your-storage.example/export.zip"}

or upload the file, in pieces of up to 64 MB, each with the position of its first byte, and then say how big the whole file was:

PUT https://veriframe.co.uk/job/<job token>/upload
X-Upload-Offset: 0
X-Upload-Name: export.zip

<the first 64 MB of the file>
POST https://veriframe.co.uk/job/<job token>/upload/done
Content-Type: application/json

{"total": 129934409}

3. Wait until it is ready

GET https://veriframe.co.uk/job/<job token>/status
Accept: application/json
200 OK

{"ref": "a1b2c3d4e5f6", "state": "ready", "cameras": 16, "error": null, …}

Repeat until state is ready, or failed with the reason in error.

4. Collect the result

GET https://veriframe.co.uk/job/<job token>/download
Accept: application/json

202 means the zip is still being packed, so ask again in a few seconds. 200 is the zip. The certificate is a separate PDF:

GET https://veriframe.co.uk/job/<job token>/certificate

5. Delete it when you are finished

POST https://veriframe.co.uk/job/<job token>/delete
Accept: application/json

Try it in Postman. Download the Veriframe Postman collection and import it. Paste your API key into the collection's api_key variable, then send the requests from the top. Creating the job saves its token for you, so every later request already points at your job.

Postman sends a file as one piece, which covers exports up to 64 MB. For a larger export, use the link request in Postman, or split the upload in your own code.

The rest of this page is about choosing the version of each step that suits your system.

Two secrets, and what each is for

SecretWhat it doesHow to treat it
API key (vfk_…)Creates jobs, lists them and reads your balance. It cannot open a job's footage.One per system. Rotate it from your account whenever you like; revoke it there at once if it leaks.
Job tokenIs the job: upload, status, download, watch, delete. Returned once, when the job is created.Store it like a password, against the matter. We keep only a hash, so we cannot give it to you again.

Log the ref, never the token. The ref is a short identifier that is safe in logs, emails and support requests. A job token in a log file is the footage in a log file.

Getting the footage in

RouteUse it whenNotes
UploadThe export is on your own disk or arrives through your own upload form.Chunks of up to 64 MB, each sent with its offset, in any order and in parallel if you like. A failed chunk is simply sent again. upload/done refuses a gap instead of converting half a recording.
LinkThe export already sits in cloud storage, or the sender gave you a share link.One call: POST /job/<token>/source with source_url. The link must download without a sign-in or a password. Share links from WeTransfer, Box, Dropbox, Google Drive and OneDrive are understood.

The largest export we accept is 35 GB. If a job fails you can give the same job another source, up to five attempts in all, so a wrong link does not cost you the job.

Knowing when it is done

Polling is step 3 above, and it is enough for a batch job. Ask /status every five to ten seconds, not faster; if you are ever answered 429, wait for the number of seconds in Retry-After.

Callbacks suit a server. Add a callback_url when you create the job and we POST an event to it when the job is ready, has failed, has been sent to storage or has been deleted. The response to creating the job then includes a callback_secret: save it with the job token, because it is how you tell a genuine event from a forged one.

To check an event, in whatever language your server is written in:

  1. Take the raw body of the request, byte for byte as it arrived.
  2. Take the value of the X-Veriframe-Timestamp header.
  3. Join them with a full stop between: timestamp, ., body.
  4. Compute the HMAC-SHA256 of that, using the job's callback_secret as the key, and write it as lower-case hexadecimal.
  5. Put sha256= in front. The result must equal the X-Veriframe-Signature header. Compare with your language's constant-time comparison if it has one.
  6. Reject the event if the timestamp is more than five minutes from your own clock, so an old event cannot be replayed.

Known values to test your code against. With this secret, timestamp and body, your code must produce this signature:

ItemValue
Secretwhsec_example_secret_do_not_use
Timestamp1793058000
Body{"event":"job.ready","ref":"a1b2c3d4e5f6","label":"claim 4471","state":"ready","cameras":16,"bytes_out":3919000000,"error":null,"at":1793058000}
Signaturesha256=95ae8e98a7fc29413ddce834c03c8ce49c332283658f16339737942ba8d40d65

Putting the result where it belongs

OptionWhat happensGood for
DownloadOne zip: an MP4 per camera, a self-contained player.html and the conversion certificate. The first request answers 202 while the zip is packed; ask again.Filing the footage in your own document or evidence store.
Send to storagePOST /job/<token>/send with a Box or Dropbox upload link (a “File Request”). We put the files straight into that folder and check each one as it arrives.Delivering to a third party who has asked for the footage in their own storage.
Share the job pageThe url returned when the job was created opens the footage in a browser, all cameras on one timeline. The viewer needs no account and nothing installed.Letting a fee earner, handler or investigator watch it today.

The job page link contains the job token, so anyone holding it can watch, download and delete. Send it only to people who should have all three.

Deletion is part of the design

So collect the result as part of the same workflow that started the job. An integration that converts overnight and collects “when someone opens the matter” will find the footage gone. If that happens, start a new job from the original export, which you should still hold.

When something goes wrong

You seeIt meansDo this
401The key is missing, wrong or revoked, or the account is suspended.Do not retry. Check the key in your account.
402 on creating a jobThe data balance is empty.Top up. GET /account tells you in advance with can_start_job.
409 on upload/doneA chunk is missing. The body lists the byte ranges we hold.Send the missing ranges and call it again.
429Too many requests.Wait for Retry-After seconds, then carry on.
503 on creating a jobThe service is at capacity. Try again in a few minutes. Nothing was charged.
State failedThe conversion did not complete. error is a sentence a person can read. Credits are returned.Show the sentence to your user. If it says the format was not recognised, tell us: that is how formats get added.
404 on a job callThe token is wrong, or the job has been deleted.Check GET /jobs for its state; start a new job if the footage is still needed.

A program that sends JSON is answered in JSON. For calls with no body, send Accept: application/json, because the same addresses also serve a web page to a person.

Keeping your records straight

GET /jobs lists your organisation's jobs with their state, times, sizes and your labels, and GET /account gives your data balance. Use the first to reconcile what you sent against what was converted and deleted, and the second to top up before a batch is refused. Put your matter or claim number in label when you create the job and you can find it again with GET /jobs?label=….

Before you go live

Building this for a product other people will use? Tell us what you are connecting and which recorders your customers meet. We will check the formats convert before you write any code.

Open the API reference   or email enquiries@veriframe.co.uk