cURL example

cURL example for file URL uploads

cURL is the fastest way to validate that your API key, multipart request, expiry value, and JSON response mapping work before adding application code.

curl file uploadmultipart/form-dataBearer authterminal test
When to use

Start with cURL when you need a clean baseline.

A terminal request removes browser, framework, and automation platform behavior from the first test.

01

Validate auth

Confirm the bearer key works before wiring it into an application or automation credential store.

02

Inspect JSON

Verify that `url`, `file_id`, `content_type`, and `expires_at` are present before mapping fields onward.

03

Reproduce errors

Use cURL to reproduce unsupported type, file size, expiry, and auth issues without hidden client code.

Next step

Move the same request shape into the runtime that owns the workflow.

After cURL works, keep the field names the same and move the request into a backend, worker, script, or automation HTTP module.

01

Keep key secret

Use environment variables, worker secrets, or automation credentials instead of hard-coded keys.

02

Pass only url onward

Most destination APIs need only the direct file URL, not the entire response object.

03

Store cleanup data

Keep `file_id` and `expires_at` near the job record for delete and retry branches.

Examples

Copy the same upload shape into code or workflow steps

Use the same endpoint from a shell, backend route, worker, or automation code step. Upload the file, set expiry, then map the returned URL.

cURL

upload example
curl -X POST https://api.getfileurl.com/v1/files \
  -H 'Authorization: Bearer $GETFILEURL_KEY' \
  -F 'file=@invoice.pdf' \
  -F 'expires_in=24h'
FAQ

Answers before the workflow breaks

What does the cURL example return?

It returns JSON fields including the direct public URL, file ID, content type, and expiry metadata when a retention window is set.

Where should I store the API key?

Store the key in a server environment variable, worker secret, script secret manager, or trusted automation credential store.

What should I do after getting the URL?

Pass `url` to the next API and store `file_id` if the workflow should delete or inspect the file later.

Next pages

Keep building the file URL path

Back to home