Skip to content

Create Entry Access Link

Create a private access link for a feed entry with expiration and usage limits.

POST/v1/feeds/{feed_id}/entries/{entry_id}/access-link

Overview

Creates a time-limited, usage-restricted access link for a specific entry. Useful for sharing paid content with specific users or creating temporary preview links.

Authentication: Required (wallet signature)
Payment: No x402 payment required

Path Parameters

ParameterTypeRequiredDescription
feed_idstring (UUID)YesFeed identifier
entry_idstring (UUID)YesEntry identifier

Request Headers

HeaderTypeRequiredDescription
x-wallet-addressstringYesEthereum wallet address (0x prefixed)
x-signaturestringYesCryptographic signature (hex format)
x-messagestringYesThe signed message (base64 encoded if contains newlines)
x-timestampstringYesUnix timestamp in seconds
x-chain-idstringNoChain ID for network detection. Supported: 8453 (base), 84532 (base-sepolia), 1 (ethereum), 11155111 (ethereum-sepolia), 137 (polygon), 80002 (polygon-amoy)

Request Body

ParameterTypeRequiredDescription
expires_atnumberNoUnix timestamp when link expires (default: 24 hours)
max_usesnumberNoMaximum number of times link can be used (default: unlimited)
descriptionstringNoDescription of the access link purpose

Request Body Example

{
  "expires_at": 1704085200,
  "max_uses": 5,
  "description": "Preview link for beta testers"
}

Response

{
  "id": "link-uuid",
  "entry_id": "entry-uuid", 
  "feed_id": "feed-uuid",
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "access_url": "https://api.grapevine.fyi/v1/access/eyJhbGciOiJIUzI1NiIs...",
  "expires_at": 1704085200,
  "max_uses": 5,
  "current_uses": 0,
  "description": "Preview link for beta testers",
  "created_at": 1703998800,
  "is_active": true
}

Response Fields

FieldTypeDescription
idstringUnique identifier for the access link
entry_idstringEntry this link provides access to
feed_idstringFeed containing the entry
access_tokenstringJWT token for accessing the entry
access_urlstringComplete URL that can be shared
expires_atnumberUnix timestamp when link expires
max_usesnumberMaximum allowed uses
current_usesnumberCurrent usage count
descriptionstringLink description
created_atnumberLink creation timestamp
is_activebooleanWhether link is currently active

Usage Examples

cURL
curl -X POST https://api.grapevine.fyi/v1/feeds/{feed_id}/entries/{entry_id}/access-link \
  -H "Content-Type: application/json" \
  -H "x-wallet-address: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" \
  -H "x-signature: 0x..." \
  -H "x-message: Sign this message..." \
  -H "x-timestamp: 1234567890" \
  -H "x-chain-id: 8453" \
  -d '{
    "expires_at": 1704085200,
    "max_uses": 10,
    "description": "Reviewer access link"
  }'

Use Cases

1. Preview Links

{
  "expires_at": 1704085200,
  "max_uses": 1,
  "description": "24-hour preview for potential subscribers"
}

2. Review Access

{
  "expires_at": 1704171600,
  "max_uses": 3,
  "description": "Access for content reviewers"
}

3. Limited Sharing

{
  "expires_at": 1704258000,
  "max_uses": 10,
  "description": "Share with team members"
}

Error Responses

404 Not Found

{
  "error": "Entry not found",
  "code": "ENTRY_NOT_FOUND"
}

403 Forbidden

{
  "error": "Not authorized to create access link for this entry",
  "code": "UNAUTHORIZED"
}

400 Bad Request

{
  "error": "Invalid expiration time",
  "code": "INVALID_EXPIRES_AT",
  "details": "Expiration time must be in the future"
}

Notes

  • Ownership: Only entry/feed owner can create access links
  • Free Entries: Can create access links for free entries (useful for analytics)
  • Paid Entries: Access links bypass payment requirement
  • Token Format: Access tokens are JWT with entry access claims
  • URL Format: Access URLs can be used directly in browsers
  • Analytics: Link usage is tracked and reported

Security Considerations

  • Access links should be treated as sensitive URLs
  • Links with unlimited uses should have short expiration times
  • Consider using single-use links for sensitive content
  • Access tokens contain entry metadata - treat as confidential

Related Endpoints