Skip to content

Send a work report again

POST
/work-reports/{id}/resend
curl --request POST \
--url https://example.com/work-reports/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/resend \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "to": [ "example" ] }'

Emails the report’s PDF again, on its own, to the addresses given: each address once, compared without case or spaces. The report, its number and its email status do not change; the resend is recorded with who sent it, when and to whom, and listed in the report’s resends. Only a numbered report the first email has dealt with (sent, failed or no_recipient) can be sent again: an incomplete report, a cancelled one, one still waiting to send and one whose customer was erased are refused with 409. A report can be resent 10 times a day, and a business can resend to 100 addresses an hour; past either, 429. The same addresses again within a minute return the first resend with 200 and send nothing more; a new resend returns 201. Send an Idempotency-Key to make a retry safe.

id
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

Media typeapplication/json
object
to
required

The email addresses to send the report to, 1 to 20. Each address gets one email, compared without case or spaces. They are not saved to the customer.

Array<string>
>= 1 items <= 20 items

Example generated

{
"to": [
"example"
]
}

Already sent again to these addresses a moment ago; nothing more is sent

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
sentByName
required
string | null
to
required
Array<string>
status
required

Sending: queued to go. sent: the email went to at least one address. failed: the email could not be sent; Bottle does not try again.

string
Allowed values: sending sent failed
createdAt
required
string format: date-time

Example

{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"status": "sending"
}

Sending

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
sentByName
required
string | null
to
required
Array<string>
status
required

Sending: queued to go. sent: the email went to at least one address. failed: the email could not be sent; Bottle does not try again.

string
Allowed values: sending sent failed
createdAt
required
string format: date-time

Example

{
"id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f",
"status": "sending"
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not an owner or admin, or the plan does not open Assets

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not found, or Assets is not available to this business

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Assets is switched off, or the report is incomplete, cancelled, still waiting to send or its customer’s details were erased

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}

Resent too often: 10 times a day for one report, 100 addresses an hour for the business

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}