Skip to content

Get started with the API

Dew’s API lets another system send files, collect files from people, follow what happens to them and manage users, using a token you create in System → Integrations. The API is part of every plan; reading the full audit log needs Enterprise.

You need:

  • An admin account on Dew.
  • The web address people open Dew on, such as files.example.com. It’s listed in Settings → Domains.

1. Create a service account for the system

Section titled “1. Create a service account for the system”

A service account is the identity another system uses in Dew. It sends and collects files under its own name, doesn’t count as a user on the license, and can’t sign in to the web app.

  1. Open System → Integrations and click New service account.
  2. Enter a Name, such as Billing system. People who get files from this account see this name as the sender.
  3. Optionally enter a Contact email, such as billing@example.com. Replies to Dew’s emails go there, along with download receipts and emails about files people send. Without one, those emails aren’t sent.
  4. Under Domains, choose the web addresses from Settings → Domains it may use. Its links and file requests go on these addresses, the activity feed shows what happens on them, and it can act for users who have one of them.
  5. Under Permissions, choose only what the system needs. The guide for each job below lists the permissions it uses, and Permissions lists them all.
  6. Click Create service account.

New service account dialog in System → Integrations with Name, Contact email, one domain checked and a few permissions checked

Give each system its own service account, so you can see and revoke each one separately.

A token is the password the system sends with every request.

  1. On the service account’s page, click New token and name it, for example Production.
  2. Choose when it expires, or Never expires. Dew alerts admins a week before a token expires.
  3. Click Create token and copy the token, which starts with dewsa_. Dew shows it only once.

Token created dialog on the service account’s page with the token value (redacted after dewsa_) and the Copy button highlighted

Store the token where the system keeps its secrets. To replace it without a gap, create a second token, switch the system over, then click ⋮ next to the old one and choose Revoke. If a token leaks, click ⋮ next to it and choose Regenerate: the token keeps its name, gets a new value and expiry date, and the old value stops working at once.

Every request sends the token in the Authorization header:

curl -H "Authorization: Bearer dewsa_<token>" https://files.example.com/api/files

This lists the service account’s files: {"success":true,"data":[]} before it has sent any. Every response has this shape: success, data, and on failure error and a readable message. On a server error the response also has a ref, such as REF-a3f8b2c1, which your admin can look up in System → System → Error logs.

Dew doesn’t push events to your system; it keeps an activity feed your system reads every minute or so. Each guide covers one job from start to finish:

The API reference lists every endpoint a token can call. The same reference is available as an OpenAPI file for Postman and code generators.