Limit an API key to selected protocol surfaces

Limit one API key to selected REST, WebDAV, SFTP, or S3 surfaces, test an allowed and refused door, and avoid combinations the server cannot enforce.

Last reviewed

Protocol controls decide which network doors accept a secret. They operate alongside permission, workspace reach, role checks, origin conditions, and usage limits.

Four panels show selecting required protocol doors, preparing separate S3 credentials and role access, testing an allowed door, and checking the unchecked door’s JSON, DAV, S3, or client refusal.
Four panels show selecting required protocol doors, preparing separate S3 credentials and role access, testing an allowed door, and checking the unchecked door’s JSON, DAV, S3, or client refusal. Open full-size screenshot.

Available surfaces

Inside Restrictions and expiry → Where can it reach?, choose All protocols or Only the ones I pick. The selectable surfaces are WebDAV, SFTP, S3 gateway, and REST API.

When selecting individual protocols, tick at least one. The create model sends no restriction for an empty selected set, which the server stores as unrestricted access to all surfaces.

Steps

  1. Determine the actual door used by the client rather than inferring it from the tool’s product name.
  2. Open New API key, choose the smallest operation permission, and expand Restrictions and expiry.
  3. Select Only the ones I pick and tick each required surface, leaving unrelated doors unchecked.
  4. Review workspace reach and do not mix a folder anchor with REST or SFTP; an anchored credential is usable only through WebDAV and S3 even if other boxes were selected.
  5. Generate and store the key. For S3, separately choose Enable under S3 credentials and copy its one-time Access key ID and secret with the endpoint and region.
  6. Complete a harmless request through one checked door, then test an unchecked door and require that protocol’s refusal rather than a successful operation.

Compatibility rules

Selecting a surface does not grant read or write capability. A Read only key cannot mutate through an enabled protocol, and Upload only does not gain listing rights. The current role also needs access_webdav, access_sftp, or access_s3 for those gateways; REST routes apply their own role permissions.

Folder anchors are enforced only at WebDAV and S3; adding REST or SFTP does not make that combination usable. S3 never authenticates with the displayed dos_… value: it needs the separately enabled Access key ID and Secret access key. A key with Allowed IP ranges cannot use SFTP because the SFTP server connects on the user’s behalf. Its refusal explains that the source address cannot be verified and directs the operator to another protocol or removal of the IP restriction.

Refusal bodies follow each door. REST returns JSON such as This API key is not permitted to use the api surface; WebDAV returns a DAV XML error carrying its text message; S3 returns XML AccessDenied; and SFTP exposes an authentication or operation failure through the client rather than REST JSON.

Changing protocol access requires a replacement key because saved credentials are immutable. Validate the new door before irrevocably revoking the old row.

Expected result

Authentication succeeds through every selected surface needed by the client, an excluded door returns its protocol-specific 403 response or client failure, and no selection widens the credential’s operation permission.

Dosya API-key restrictions panel with selectable protocol surfaces and location controls.
A selected-surface key reduces the impact of accidental reuse. Open full-size screenshot.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.