Edit a partner email report

Overview

Change a scheduled report's frequency or the accounts it covers.

Use this when the team or needs change.

You'll need the report_id and the changes.

The schedule is updated.

Prerequisites

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/partner/reports/edit

Authentication

Partner token

  • Only Partner tokens can call it. Any other token gets 403 (This action is unauthorized.).
  • The report and every id in account must be inside your own tree; anything else is rejected with 422.
  • The report type and recipient can't be changed here.

Rate limit

This endpoint has no rate limit.

Request parameters

None.

Request body

FieldTypeRequiredDescription
report_idintegerYesThe report to change. Must exist and be inside your tree. Sending it is what makes this an edit.
reportPeriodTypestringYesHow often to send it: day, week or month. It must fit the report's type, as when you scheduled it (for example month for an activity report).
all_accountintegerYes1 to cover every account under your partner, 0 to cover only the accounts in account.
accountarray of integersWhen all_account is 0Account ids to cover. Required when all_account is 0. Each must exist and be inside your tree. Replaces the accounts the report covered before.

Request payload

{
  "report_id": 5,
  "reportPeriodType": "month",
  "all_account": 0,
  "account": [
    5994
  ]
}

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
responsestringThe confirmation message, Report has been updated successfully!.

Response payload

{
  "data": {
    "status": "success",
    "response": "Report has been updated successfully!"
  }
}

Examples

Success payload

See Response payload.

Error payload

403 Not a Partner token

{
  "message": "This action is unauthorized."
}

422 Report doesn't exist

{
  "message": "The selected report id is invalid. (and 1 more error)",
  "errors": {
    "report_id": [
      "The selected report id is invalid.",
      "The selected report id does not belong to your company hierarchy."
    ]
  }
}
StatusMeaning
200The schedule is updated.
401The token is missing, expired or invalid.
403The token isn't a Partner token.
422A required field is missing, the report or an account doesn't exist or is outside your tree, or reportPeriodType isn't day, week or month.
500Unexpected server error.

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/partner/reports/edit" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"report_id": 5, "reportPeriodType": "month", "all_account": 0, "account": [5994]}'

Did this page help you?