Skip to main content
配信メッセージ更新
curl --request PATCH \
  --url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "use_ab_test": true,
  "send_type": "<string>",
  "send_date": "2023-12-25",
  "send_day": 123,
  "send_hour": 11,
  "send_min": 29,
  "base_date": "<string>",
  "mail": {},
  "line": {
    "sender_id": "<string>",
    "messages": [
      {}
    ]
  },
  "sms": {
    "message": "<string>"
  },
  "action_id": "<string>",
  "shorten_domain": "<string>",
  "conditions": [
    {}
  ],
  "url_actions": [
    {}
  ]
}
'
import requests

url = "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}"

payload = {
"title": "<string>",
"use_ab_test": True,
"send_type": "<string>",
"send_date": "2023-12-25",
"send_day": 123,
"send_hour": 11,
"send_min": 29,
"base_date": "<string>",
"mail": {},
"line": {
"sender_id": "<string>",
"messages": [{}]
},
"sms": { "message": "<string>" },
"action_id": "<string>",
"shorten_domain": "<string>",
"conditions": [{}],
"url_actions": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
use_ab_test: true,
send_type: '<string>',
send_date: '2023-12-25',
send_day: 123,
send_hour: 11,
send_min: 29,
base_date: '<string>',
mail: {},
line: {sender_id: '<string>', messages: [{}]},
sms: {message: '<string>'},
action_id: '<string>',
shorten_domain: '<string>',
conditions: [{}],
url_actions: [{}]
})
};

fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'use_ab_test' => true,
'send_type' => '<string>',
'send_date' => '2023-12-25',
'send_day' => 123,
'send_hour' => 11,
'send_min' => 29,
'base_date' => '<string>',
'mail' => [

],
'line' => [
'sender_id' => '<string>',
'messages' => [
[

]
]
],
'sms' => [
'message' => '<string>'
],
'action_id' => '<string>',
'shorten_domain' => '<string>',
'conditions' => [
[

]
],
'url_actions' => [
[

]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"mail\": {},\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"mail\": {},\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"mail\": {},\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "title": "<string>",
    "mail": {},
    "line": {
      "sender_id": "<string>",
      "messages": [
        {}
      ]
    },
    "sms": {},
    "url_actions": [
      {}
    ]
  },
  "warnings": [
    "<string>"
  ]
}
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}
{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}
{
"error": {
"code": "conflict",
"message": "送信中または完了済みのメッセージは更新できません。"
}
}
{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}
{
"error": {
"code": "cooldown_active",
"message": "キュー作成後5分間は再作成できません",
"details": {
"retry_after": "2026-06-19 12:39:56"
}
}
}
PATCH
https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages/{message_id}
この機能はプレビュー版です。仕様が変更される場合があります。

Authorizations

Authorization
string
header
required

APIキーをBearerトークンとして指定

Path Parameters

account_id
string
required

アカウントID

scenario_id
string
required

シナリオID

message_id
string
required

メッセージID

Body

application/json

配信メッセージ更新リクエスト(部分更新)。指定したフィールドのみ変更され、省略した フィールドは既存値を維持します。channel / type は変更できません(異なる値を指定すると 422)。conditions / url_actions / line.messages は指定すると全件置換されます。

status
enum<string>

ステータス。draftreserved で予約実行(配信予約作成)、reserveddraft で予約解除(配信予約削除)。

Available options:
draft,
reserved
title
string | null

管理名称

Maximum string length: 255
use_ab_test
boolean | null

A/Bテスト使用

send_type
string

送信タイプ(message_create と同じ)

send_date
string<date>

送信日(broadcast用、YYYY-MM-DD)

send_day
integer

送信日数(step / reminder 用)

send_hour
integer

送信時(0-23)

Required range: 0 <= x <= 23
send_min
integer

送信分(0-59)

Required range: 0 <= x <= 59
send_timing
enum<string>

送信タイミング(reminder用)

Available options:
before,
after,
today,
addition_before,
addition_after
base_date
string

基準日の読者項目名(reminder用)

step_send_type
enum<string>

ステップ送信タイプ(step用)

Available options:
none,
immediately
mail
object

メール原稿(省略時は既存維持)。type は変更不可のため指定不要。

line
object

LINE原稿(省略時は既存維持)。messages 指定時は全件置換。sender_id のみの指定も可。

sms
object

SMS原稿(省略時は既存維持)

action_id
string | null

配信後に実行するアクションID。null で解除。

shorten_type
enum<string>

URL置換方法

Available options:
shorten_url,
original_url
shorten_domain
string | null

URL置換ドメイン。null で解除。

conditions
object[]

配信条件(指定時は全件置換、空配列で条件解除)

url_actions
object[]

URLアクション(指定時は全件置換、空配列でクリア)

Response

更新された配信メッセージ

data
object

配信メッセージの詳細。共通フィールドに加え、type に応じた送信タイミング系フィールド (send_type / send_date / send_day / send_hour / send_min / base_date / send_timing / step_send_type 等)と、channel に応じた原稿(mail / line / sms)、 url_actions を含みます。

warnings
string[]

reserved 状態でメールを変更した場合に、配信解除URL欠如・DKIM未設定などが検出されると返されることがあります。