Donutwork Docs

Share Secrets

Generate secure one-time links for sensitive data transmission with automated content purging and access tracking.

Share Secrets API

The Share Secrets API provides a secure mechanism for transmitting sensitive information (such as passwords, private keys, or PII) without leaving a persistent digital footprint. Secrets are encrypted and associated with a unique, short-lived URL. To ensure maximum security, content is purged immediately after the first successful access, rendering the link permanently invalid.


Secret Management

Audit Secret Inventory

Retrieve a paginated directory of all active (unread) or recently expired share secret entries. This allows for administrative tracking of shared links and their current consumption status.

GET
/2026-02-01/share-secrets.json
Required permissionshare_secrets:readApiAccessPermission::SHARE_SECRETS_READ

Query Parameters

sizeinteger
Maximum records per page (max 100).
pageinteger
Target page index.

Responses

Secret directory successfully retrieved.

{
  "entities": "ShareSecret",
  "count": 5,
  "per_page": 100,
  "pages": {
    "current": 1,
    "max": 1
  },
  "elements": [
    {
      "id": "6739782b...",
      "name": "Database Migration Credentials",
      "url": "https://hub.donutwork.com/ss/b6a9532aa4a06...",
      "readed": false
    }
  ]
}

Generate a new ephemeral secret link. The content provided is encrypted at rest and will be revealed only once. You can optionally trigger an automated email notification to the recipient.

POST
/2026-02-01/share-secrets.json
Required permissionshare_secrets:writeApiAccessPermission::SHARE_SECRETS_WRITE

Query Parameters

No query parameters required.

Request Body

JSON
{
  "shareSecret": {
    "name": "Deployment API Token",
    "content": "secret_value_redacted",
    "sendTo": {
      "email": "engineer@partner-company.com",
      "message": "The requested production API token is now available for one-time retrieval."
    }
  }
}
shareSecret.namestringRequired
Descriptive label for internal tracking.
shareSecret.contentstringRequired
The sensitive payload to be shared (OTV).
shareSecret.sendTo.emailstring
Recipient email for automated notification.
shareSecret.sendTo.messagestring
Optional custom message included in notification email.

Responses

Secret link successfully provisioned.

{
  "id": "67397a4c...",
  "name": "Deployment API Token",
  "url": "https://hub.donutwork.com/ss/fb89f610...",
  "readed": false,
  "readerInfo": {
    "ip": null,
    "ua": null,
    "isoDate": null,
    "ts": null
  },
  "sendTo": {
    "status": true,
    "messageId": "msg_9921"
  }
}

Technical Implementation

const secretPayload = {
  shareSecret: {
    name: "Inter-Service Auth Key",
    content: "PRIVATE_KEY_CONTENT_HERE",
    sendTo: { email: "security-ops@acme.com", message: "Key Rotation: 2026-Q1" }
  }
};

try {
  const response = await sdk.tools.createShareSecret(secretPayload);
  console.log(`Secret Link Generated: ${response.url}`);
} catch (error) {
  console.error(`Provisioning Failed: ${error.message}`);
}

Access & Revocation

Audit Access Metadata

Retrieve the access status and reader telemetry for a specific secret link. This endpoint provides audit trails (IP, User-Agent, Timestamp) once the secret has been consumed.

GET
/2026-02-01/share-secrets/{secretId}.json
Required permissionshare_secrets:readApiAccessPermission::SHARE_SECRETS_READ

Query Parameters

secretIdstringRequired
The unique identifier of the secret entry.

Responses

Access metadata successfully retrieved.

{
  "id": "6739782b...",
  "name": "Database Migration Credentials",
  "readed": true,
  "readerInfo": {
    "ip": "82.1.4.22",
    "ua": "Mozilla/5.0...",
    "isoDate": "03/03/2026 11:20:00",
    "ts": 1772536800
  }
}

Manually revoke a secret link before it is consumed, or purge the audit record of an already read secret.

DELETE
/2026-02-01/share-secrets/{secretId}.json
Required permissionshare_secrets:writeApiAccessPermission::SHARE_SECRETS_WRITE

Query Parameters

secretIdstringRequired
The unique identifier to revoke.

Responses

Secret link successfully revoked and record purged.

{
  "id": "67397a4c...",
  "deleted": true
}

Security Policy: Content retrieval is handled via the specific url field returned during provisioning. Once the readed flag is set to true, the content is physically deleted from the database and cannot be recovered.

On this page