Skip to main content
読者作成
curl --request POST \
  --url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/readers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "opt_in_confirmed": true,
  "scenario_fields": {},
  "common_fields": {},
  "has_step_immediately": true,
  "has_step_scheduled": true,
  "has_reminder": true,
  "allow_duplicates": true
}
'
import requests

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

payload = {
"opt_in_confirmed": True,
"scenario_fields": {},
"common_fields": {},
"has_step_immediately": True,
"has_step_scheduled": True,
"has_reminder": True,
"allow_duplicates": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
opt_in_confirmed: true,
scenario_fields: {},
common_fields: {},
has_step_immediately: true,
has_step_scheduled: true,
has_reminder: true,
allow_duplicates: true
})
};

fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/readers', 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}/readers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'opt_in_confirmed' => true,
'scenario_fields' => [

],
'common_fields' => [

],
'has_step_immediately' => true,
'has_step_scheduled' => true,
'has_reminder' => true,
'allow_duplicates' => true
]),
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}/readers"

payload := strings.NewReader("{\n \"opt_in_confirmed\": true,\n \"scenario_fields\": {},\n \"common_fields\": {},\n \"has_step_immediately\": true,\n \"has_step_scheduled\": true,\n \"has_reminder\": true,\n \"allow_duplicates\": true\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/readers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"opt_in_confirmed\": true,\n \"scenario_fields\": {},\n \"common_fields\": {},\n \"has_step_immediately\": true,\n \"has_step_scheduled\": true,\n \"has_reminder\": true,\n \"allow_duplicates\": true\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"opt_in_confirmed\": true,\n \"scenario_fields\": {},\n \"common_fields\": {},\n \"has_step_immediately\": true,\n \"has_step_scheduled\": true,\n \"has_reminder\": true,\n \"allow_duplicates\": true\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "common_reader_id": "<string>",
    "scenario_id": "<string>",
    "ip": "<string>",
    "line_display_name": "<string>",
    "line_picture_url": "<string>",
    "line_friend_id": "<string>",
    "base_date": "<string>",
    "is_blocked": true,
    "is_line_blocked": true,
    "is_mail_error": true,
    "is_sms_blocked": true,
    "block_datetime": "<string>",
    "partner": {
      "project_name": "<string>",
      "name": "<string>",
      "reward": 123
    },
    "has_step_scheduled": true,
    "has_reminder": true,
    "message_tracking_id": "<string>",
    "message_tracking_name": "<string>",
    "funnel_tracking_id": "<string>",
    "funnel_tracking_name": "<string>",
    "referrer": "<string>",
    "labels": [
      {
        "id": "<string>",
        "name": "<string>",
        "assigned_at": "<string>"
      }
    ],
    "scenario_fields": {},
    "common_fields": {},
    "memo": "<string>",
    "created_at": "<string>"
  }
}
{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}
{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}
{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}
{
"error": {
"code": "monthly_limit_exceeded",
"message": "月間の作成上限に達しました",
"details": {
"resource_type": "reader",
"retry_after": "2026-06-20 00:00:00"
}
}
}
POST
https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/readers
この機能はプレビュー版です。仕様が変更される場合があります。

Authorizations

Authorization
string
header
required

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

Path Parameters

account_id
string
required

アカウントID

scenario_id
string
required

シナリオID

Body

application/json
opt_in_confirmed
boolean
required

オプトイン取得済みの確認(true のみ受付・必須)。オプトインを取得済みのアドレスのみ登録すること

scenario_fields
object

シナリオ固有の読者項目(キー=項目名、値=文字列)。メールアドレスはここに指定(scenario_fields.mail)。 mail はメール/メール・LINE併用アカウントでは必須で、RFC・DNS検証あり(最大255文字)。

common_fields
object

全シナリオ共通の読者項目(キー=項目名、値=文字列)

has_step_immediately
boolean

登録直後のステップ配信の対象にする(デフォルトfalse。作成時のみ指定可能)

has_step_scheduled
boolean

ステップ配信の対象にする(デフォルトfalse)

has_reminder
boolean

リマインダ配信の対象にする(デフォルトfalse)

allow_duplicates
boolean

重複登録を許可する(デフォルトfalse)。falseのとき、同一シナリオ内に配信解除されていない同一メールアドレスの読者が既に存在すると422になります

Response

作成された読者

data
object

読者の詳細情報。読者項目はトップレベルではなく scenario_fields(シナリオ固有)/ common_fields(全シナリオ共通)の2グループで返る。トップレベルはシステム情報のみ。