Skip to content

Update Share Link

PUT
/api/v1/workspaces/{workspace_id}/emails/{email_id}/share_link
curl --request PUT \
--url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1/share_link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "expires_at": "2020-01-31T00:00:00Z" }'

Turns link sharing on or off for the email, creating its share link the first time. While sharing is on, expires_at must be in the future.

workspace_id
required
integer

Workspace ID

email_id
required
integer

Email ID

Media typeapplication/json
object
enabled

Whether anyone with the link can view and comment on the email.

boolean
Example
true
expires_at

When the link stops working. Must be in the future. Anything more than 30 days from now is saved as 30 days from now.

string format: date-time
Example
2020-01-31T00:00:00Z

Successful

Media typeapplication/json
object
id
required
integer
email_id
required
integer
url
required

The public link to send to guests.

string
expires_at
required
string format: date-time
enabled
required

Whether link sharing is on. The link only works while this is true and it hasn’t expired.

boolean
active
required

Whether the link works right now, i.e. sharing is on and the link hasn’t expired.

boolean
invitations
required

People the share link has been emailed to.

Array<object>
object
id
required
integer
email
required
string
invited_by
required
One of:
One of:
object
type
required
string
Allowed values: User
id
required
integer
first_name
required
string
last_name
required
string
profile_image_url
required
string | null
created_at
required
string format: date-time
created_by
required
One of:
One of:
object
type
required
string
Allowed values: User
id
required
integer
first_name
required
string
last_name
required
string
profile_image_url
required
string | null
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"id": 12345,
"email_id": 12345,
"url": "https://app.emailshepherd.com/share/pQ9sN3vXk2mB7tR4wY8zA1cD5fG6hJ0e",
"expires_at": "2020-01-31T00:00:00Z",
"enabled": true,
"active": true,
"invitations": [
{
"id": 12345,
"email": "client@example.com",
"invited_by": {
"type": "User",
"id": 12345,
"first_name": "John",
"last_name": "Smith",
"profile_image_url": "https://example.com/profile.jpg"
},
"created_at": "2020-01-01T00:00:00Z"
}
],
"created_by": {
"type": "User",
"id": 12345,
"first_name": "John",
"last_name": "Smith",
"profile_image_url": "https://example.com/profile.jpg"
},
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z"
}

Unauthorized

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Forbidden

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Not Found

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Unprocessable Entity

Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{
"errors": {
"username": [
"Username is required.",
"Username must be unique."
],
"email": [
"Invalid email format."
]
}
}