Skip to content

Create a document link (public or recipient-only, with expiration and download limit)

POST
/v1/drive/files/{file}/links
curl --request POST \
--url https://api.replifier.com/v1/drive/files/dfl_01hx0000000000000000000000/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "policy": "pinned", "audience": "public", "title": "example", "expiresAt": "2026-04-15T12:00:00Z", "maxDownloads": 1 }'

It is never an attachment: the email carries this link. The file must be active and clean. recipient requires full tracking: the sending engine signs ?r= with each recipient’s send; in anonymous mode events are stored without send or contact.

file
required
string
/^dfl_[a-z0-9]{26}$/

Example

dfl_01hx0000000000000000000000
Media typeapplication/json
object
policy

Defaults to pinned to the current version: replacing the file does not change what has already gone out.

string
Allowed values: pinned latest
audience

Defaults to public. recipient requires the 6-digit code sent to the recipient’s email.

string
Allowed values: public recipient
title
string
>= 1 characters <= 200 characters /^[^\x00-\x1f\x7f]*$/
expiresAt
string format: date-time
nullable
maxDownloads
integer
nullable >= 1 <= 1000000

Link

Media typeapplication/json
object
id
required
string
fileId
required
string
brandId
required
string
policy
required

pinned: always that version; latest: the file’s current version.

string
Allowed values: pinned latest
versionId
required
string
nullable
audience
required
string
Allowed values: public recipient
url
required

Public link. With audience: recipient, the sending engine appends ?r=<recipient signature>.

string
title
required
string
nullable
expiresAt
required
string
nullable
maxDownloads
required
number
nullable
status
required
string
Allowed values: active expired revoked
views
required
number
downloads
required

Totals for people; machines (security scanners) do not count.

number
createdAt
required
string

Example

{
"policy": "pinned",
"audience": "public",
"status": "active"
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

No session, expired session, or invalid, expired or revoked API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Does not exist or is not visible to you

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Conflict

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}