Update Share Link
PUT
/api/v1/workspaces/{workspace_id}/emails/{email_id}/share_link
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/emails/1/share_link';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"expires_at":"2020-01-31T00:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
email_id
required
integer
Email ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
enabled
Whether anyone with the link can view and comment on the email.
boolean
Example
trueexpires_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:00ZResponses
Section titled “ Responses ”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
created_at
required
string format: date-time
created_by
required
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." ] }}