Create, name and revoke a RoofStruct API key

Make a RoofStruct API key, test it with one call, store it where it belongs, and revoke or replace it without breaking your integration. The steps, the limits and the traps.

3 min read

To create a RoofStruct API key, go to Settings › Integrations › API & Webhooks, click Create Key on the API Keys card, give it a name, and copy it from Copy your new key. That's the only time it's shown. Test it with GET /v1/me, store it in your secret store, and revoke it with Revoke when the tool that uses it is retired.

Before you start

  • You need to be an account owner or admin, and the full API comes with the Pro and Enterprise plans. The Integrations tab doesn't show for other members.
  • A key belongs to the account, not to you: it reads every measurement and delivered report in it.
  • An account can have up to 10 active keys. Plan one per tool.

Create it

  1. Open Settings › Integrations and the API & Webhooks tab.
  2. On API Keys, click Create Key.
  3. Name it after the tool that will use it, for example "CRM sync". You'll see this name next to Last used later.
  4. Copy the key from Copy your new key and click Done.

Keys start with rs_live_. RoofStruct stores only a hash, so nobody, including RoofStruct, can show it again.

Test it

One call proves the key works and tells you which account it opens:

curl https://roofstruct.com/api/v1/me \
  -H "Authorization: Bearer rs_live_..."

A good answer names the account and the key:

{
  "data": {
    "account": { "id": "...", "reference": "...", "name": "Your company" },
    "key": { "name": "CRM sync", "prefix": "rs_live_..." }
  }
}

A 401 unauthorized means the key was mistyped, cut short when copying, or revoked.

Store it

Put it where the tool keeps secrets: an environment variable on the server, the platform's secret manager, or the integration's own settings field. Not in source code, a shared document, a ticket or a chat message.

Replace it

Keys don't rotate in place. To replace one:

  1. Create Key with the same name plus a date.
  2. Put the new key in the tool and check it works.
  3. Revoke the old one.

In that order there's no gap where the integration is down.

Revoke it

Click Revoke next to the key and confirm. It stops working right away, and anything registered with it, such as webhooks that a connected tool set up through the API, stops too. There's no undo; make a new key if you need one.

Limits that come with a key

Limit Value
Active keys per account 10
Requests per key 120 per minute
Expiry None, until revoked
Scopes None: a key reads the account's measurements and reports and can create measurements

Who should hold keys, and when to revoke them

  • The owner or office manager creates the key, even when a developer builds the integration. Hand it over once, privately, and let the developer keep it in their system's secret store. Don't share your own login so they can make keys themselves.
  • One key per tool, named after the tool, not the person: "CRM sync", "Nightly spreadsheet", "Lead form". You can then revoke one connection without breaking the rest.
  • Revoke a key the same day a tool is retired, a developer's or agency's work is done, the person who made it leaves the account, or the key turns up somewhere it shouldn't, such as an email, a chat or a screenshot.
  • Check the list once a quarter. Under API Keys, each key shows when it was created and last used. A key nobody has used in months is a key nobody will miss.

On the Enterprise plan a key can also order reports, paid from your prepaid balance, so guard those keys like a company card.

Where you trip

  • Copying a truncated key. Some terminals and chat tools wrap long strings. Copy with the Copy button.
  • The key's maker leaves the account. Reads keep working, but creating measurements answers 409 key_owner_missing. Make a new key from a current owner or admin.
  • Hitting 10 keys. "You have the maximum of 10 keys." Revoke the ones that show no recent Last used.
  • Testing with the wrong header. Authorization: Bearer rs_live_... or X-API-Key: rs_live_.... Anything else is a 401.

Developer docs: Getting started, Authentication and Errors in the RoofStruct API reference.

Keep reading