Skip to content

Update

/marketing_permissions/update

Target audience: Developers

Update marketing permissions

Introduction

This endpoint is used to update marketing permissions for an account.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/marketing_permissions/update
Production https://backend.worldoftulo.com/external/api/v1/marketing_permissions/update

Requirements

Identity Scope
No /external/marketing_permission/w

Parameters

Field Required Type Description
account_id Required String The id of the account to update marketing permissions for.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
marketing_permissions Required Array The marketing permissions to update
id Required String The id of the marketing permission to update
enabled Required Boolean Accept or reject marketing permission

Curl Example

curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/marketing_permissions/update \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "account_id": "585a4768edce2c5e6f000001",
            "marketing_permissions": [
              {
                "id": "5b9707e317c0f859830000c3",
                "enabled": true
              },
              {
                "id": "5b9707e317c0f859830000c7",
                "enabled": true
              },
              {
                "id": "5b9707e317c0f859830000cb",
                "enabled": false
              }
            ]
          }'

Response

Field Description
id id of the updated account

Example Response

HTTP 200 Updated
{
    "id": "50f3ac249f6aef294d000007"
}

Errors

Example error response

HTTP 400 Bad Request
{
  "code": "json_parser_error",
  "message": "Invalid json in request body"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the posted json
json_parser_error Object The request body could not be parsed as valid json
invalid_content_type_error Object The requests Content-Type header isn't set to application/json
unknown_parameter Object One or more of the fields in the posted json was not recognized

HTTP 404 Not Found

Name Type Description
not_found Object The package could not be found

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side