nimeet 文档中心
English

REST API 总览与调用约定

鉴权、信封、分页、错误、幂等、请求追踪与各产品端点索引(构建时从 openapi.json 生成)。

由公开 REST 接口定义生成

版本 v1.1.0 · 更新于 2026-10-26 · 修订 1

本页是 REST API Reference 的入口。所有接口表都在构建时从公开 REST 接口定义生成:下面的产品分组、后续每个分组页里的方法/路径/参数/请求体/响应/curl,都由脚本读接口定义直接渲染,不存在手抄的接口清单。

调用前提与请求示例

  • 基址:https://api.your-domain.example(占位符,替换为你的控制面地址)。
  • 鉴权:服务端调用使用 Authorization: Basic base64(customerId:customerSecret);控制台调用使用 Authorization: Bearer <session>。
  • 请求头:写操作必须带 Content-Type: application/json;建议带 X-Request-Id 便于排障。
  • 响应:成功返回资源对象;失败返回统一错误信封 { code, message, reason, sdkCode, details? }。
bash
curl -s https://api.your-domain.example/v1/tokens \
  -u "$CUSTOMER_ID:$CUSTOMER_SECRET" \
  -H 'Content-Type: application/json' \
  -d '{"channelName":"weekly-sync","uid":10001,"role":"host","ttlSeconds":3600}'

什么时候用 REST、什么时候用 SDK

场景用什么说明
客户端要入会、发布、订阅客户端 SDK见 SDK 平台总览;Token 由你的后端签发
服务端签发/续期 TokenPOST /v1/tokens必须用项目 Basic 凭证(customerId:customerSecret)
服务端查询频道/踢人/禁言/v1/channels/*语义化路径;声网等价路径见 声网兼容频道
服务端发起录制/推流/拉流/转码对应产品分组都是「任务」模型:创建 → 查询 → 停止/销毁
拿质量与用量数据/v1/analytics/*水晶球口径见 水晶球
控制台页面自身用/console/*控制台 BFF,浏览器持 Bearer 会话

权限与凭证边界

凭证出现位置谁能看到
appId客户端 SDK 初始化公开(可下发到浏览器/App)
customerId / customerSecretAuthorization: Basic base64(...)仅服务端,泄露须立刻轮换
appCertificate只用于签发 Token仅服务端,绝不下发
控制台会话Authorization: Bearer <session>控制台前端

每个分组页里有什么

  • 该分组的操作索引(方法 / 路径 / 摘要,可点击跳转);
  • 每个操作:参数表(名称/位置/必填/类型/约束)、请求体字段表 + 示例、响应表、可直接复制的 curl;
  • 该分组用到的 components.schemas(字段表由接口定义展开)。

与其他页面的关系

下一步

鉴权

凭证家族用法说明
projectBasicbasic请求头 Authorization: Basic base64(customerId:customerSecret),与声网 RESTful API 一致。
consoleBearerbearer请求头 Authorization: Bearer <session>,先调用 POST /console/auth/login。
opsTokenbeareroperator token (NIMEET_OPS_TOKEN), required by the /internal/ops/** surface; when the token is unset that surface is closed
sfuWebhookSignatureapiKeySFU webhook signature verified by the media adapter (see verifyAndParseWebhook); a bad or missing signature is rejected with invalid_token

项目凭证(Basic)只应存在于服务端;浏览器/移动端只持有 { appId, rtcToken, rtcUid }。

通用约定

  • 写操作(POST/PUT/PATCH)必须带 Content-Type: application/json,否则返回 415 unsupported_media_type。
  • 列表分页使用 page_no(0 起)与 page_size(1..500,默认 100)。
  • 失败响应用统一信封 { code, message, reason, sdkCode, details? },完整错误码见 错误码。
  • 每个响应都回显 X-Request-Id,排障时优先提供它。
  • 声网兼容路径以 /dev/v1/*、/v1/apps/{appid}/cloud_recording/*、/v1/projects/{appid}/fls/* 为前缀,响应使用声网的 success/data、{resourceId,sid,serverResponse} 等信封。
  • 幂等:创建类接口重复提交可能返回同一资源;写操作失败后先查询再重试(见 错误码 的 409 说明)。

产品分组与操作索引

共 189 个操作,分 15 个产品分组,每个分组一个独立页面:

标签(页面)说明操作数
tokensToken issuance, renewal, verification and uid mapping (IM integration).5
channelsChannel and participant queries plus moderation.7
ban-rulesKicking rules (Agora `kicking-rule` semantics).4
agora-channelAgora-compatible RTC REST surface (`/dev/v1`).8
recordingsCloud recording tasks and Agora-compatible cloud_recording flow.13
streamingBypass RTMP/HLS streaming tasks.10
webhooksCallback endpoint configuration, delivery log and ingest.1
analyticsCrystal Ball: real-time monitoring, usage, quality, call search and data insights.7
consoleConsole BFF: sessions, projects, keys, services, collaborators, audit.80
media-pushMedia Push: converters that push one RTC channel to a CDN address.5
media-gatewayMedia Gateway: RTMP ingress streaming keys, flow configuration templates and online streams.12
media-pullMedia Pull: cloud players that pull an online media stream into an RTC channel.6
cloud-transcodingCloud Transcoding: builder tokens, transcoding tasks and adaptive-bitrate templates.7
notificationsMessage-notification service addresses (firewall allow-list).2
whiteboardInteractive Whiteboard rooms, scenes, content, replay and tokens.22

Schema 字典

components.schemas 声明与引用统计:

  • 被操作引用:68
  • 声明总数(含别名):58

各分组页面内也会展开该分组用到的 schema。

AgoraRecordingFile — object{ fileName, duration, size }
字段类型必填说明
fileNamestring是
durationnumber是seconds; 0 while the file is still being written
sizenumber是bytes; 0 while the file is still being written
AgoraRecordingLayout — object{ resourceId, sid, serverResponse }
字段类型必填说明
resourceIdstring是
sidstring是
serverResponseobject{ taskId, layout }是
AgoraRecordingQuery — object{ resourceId, sid, serverResponse }
字段类型必填说明
resourceIdstring是
sidstring是
serverResponseobject{ taskId, status, fileList, error }是
AgoraRecordingResource — object{ resourceId }
字段类型必填说明
resourceIdstring是single-use marker valid for 30 s; pass it to start
AgoraRecordingStart — object{ resourceId, sid, serverResponse }
字段类型必填说明
resourceIdstring是
sidstring是our recording task id (Agora calls it sid)
serverResponseobject{ taskId, state }是
AgoraRecordingStop — object{ resourceId, sid, serverResponse }
字段类型必填说明
resourceIdstring是
sidstring是
serverResponseobject{ taskId, status, fileList }是
AnalyticsCallEvent — object{ ts, kind, uid, detail }
字段类型必填说明
tsstring是format date-time
kindenum(join | leave | network | video-send | audio-send)是
uidinteger是
detailstring
AnalyticsCallSession — object
字段类型必填说明
projectIdstring是
channelNamestring是
startedAtstring是format date-time
endedAtstring | null是format date-time
peakUsersinteger是
usersarray<object>是
eventsarray<object{ ts, kind, uid, detail }>是
AnalyticsCallUser — object
字段类型必填说明
uidinteger是
userIdstring | null是
roleenum(host | audience)是
platforminteger是Agora platform code (0 iOS, 1 Android, 2 Windows, 5 Web, 6 macOS, 7 Linux, 8 Other)
joinedAtstring是format date-time
leftAtstring | null是format date-time
durationSecondsnumber是
audioFreezeRatenumber是
videoFreezeRatenumber是
networkDelayRatenumber是
AnalyticsDiagnosis — object{ video, audio, network }
字段类型必填说明
videoenum(good | warn | bad)是
audioenum(good | warn | bad)是
networkenum(good | warn | bad)是
AnalyticsQualityBucket — object
字段类型必填说明
bucketStartstring是format date-time
averageLoginTimeMsnumber是
audioFreezeRatenumber是
videoFreezeRatenumber是
networkDelayRatenumber是
inCallUsersinteger是
inCallChannelsinteger是
joinAttemptsinteger是
joinSuccessesinteger是
joinWithin5sinteger是
AnalyticsUsageBucket — object{ bucket, type, minutes, channels, users }
字段类型必填说明
bucketstring是
typeenum(audio | video | recording | streaming | transcoding)是
minutesnumber是
channelsinteger是
usersinteger是
BanRule — object
字段类型必填说明
idinteger
channelNamestring | null
uidinteger | null
ipstring | null
privilegesarray<enum(join_channel | publish_audio | publish_video)>
expireAtstring | nullformat date-time
createdAtstringformat date-time
BillingOverview — object
字段类型必填说明
providerobject是
plansarray<object>是
subscriptionany是
invoicesarray<object>是
topUpsarray<object>是
chargesarray<object>是
taxProfileany是
totalsobject{ outstanding, paid, credit, currency }是
generatedAtstring是format date-time
BillingPlan — object
字段类型必填说明
idstring是
namestring是
pricePerMonthnumber是monthly list price in major units (see x-money-scale)
currencystringISO-4217 currency code;pattern ^[A-Z]{3}$
includedMinutesnumber是metered minutes included before overage
descriptionstring是
featuresarray<string>是
BillingProvider — object
字段类型必填说明
kindenum(sandbox | live)是
liveboolean是
configuredboolean是
currencystring是ISO-4217 currency code;pattern ^[A-Z]{3}$
taxRatePercentnumber是
disclaimerstring是
capabilitiesobject{ payInvoice, topUp, subscribe }是
BillingTotals — object{ outstanding, paid, credit, currency }
字段类型必填说明
outstandingnumber是invoiced but unpaid amount
paidnumber是settled amount
creditnumber是unconsumed top-up credit
currencystring是ISO-4217 currency code;pattern ^[A-Z]{3}$
ChannelSummary — object{ channelName, userCount, profile, createdAt }
字段类型必填说明
channelNamestring
userCountinteger
profileenum(communication | live)
createdAtstring | nullformat date-time
Error — object{ code, message, reason, sdkCode, details }
字段类型必填说明
codestring是stable machine code, see errors.json
messagestring是
reasonstring
sdkCodeintegerAgora-aligned client error number
detailsobject
FlsEntryPoint — object{ entryPoint, entryPoints }
字段类型必填说明
entryPointstring是
entryPointsarray<string>是
FlsEntryPointDelete — object{ deleted, entryPoint }
字段类型必填说明
deletedboolean是
entryPointstring是
FlsEntryPointList — object{ entryPoints }
字段类型必填说明
entryPointsarray<string>是
FlsTaskAccepted — object{ streamName, taskId, state, region }
字段类型必填说明
streamNamestring是
taskIdstring是
stateenum(starting | running | stopping | stopped | failed | expired)是
regionstring是
FlsTaskStop — object{ streamName, taskId, state }
字段类型必填说明
streamNamestring是
taskIdstring是
stateenum(starting | running | stopping | stopped | failed | expired)是
Invoice — object
字段类型必填说明
idstring是
projectIdstring | null是
projectNamestring是
periodstring是billing period label, e.g. 2026-10
currencystring是ISO-4217 currency code;pattern ^[A-Z]{3}$
subtotalnumber是amount before tax
taxnumber是tax amount
totalnumber是amount due
statusenum(open | paid | void)是
issuedAtstring是format date-time
paidAtstring | null是format date-time
chargeIdstring | null是
linesarray<object{ type, minutes, amount }>是
InvoiceLine — object{ type, minutes, amount }
字段类型必填说明
typestring是
minutesnumber是
amountnumber是line amount
PaymentCharge — object
字段类型必填说明
idstring是
kindenum(invoice | topup)是
referenceIdstring是
amountnumber是charged amount
currencystring是ISO-4217 currency code;pattern ^[A-Z]{3}$
providerenum(sandbox)是
statusenum(succeeded)是
simulatedboolean是
createdAtstring是format date-time
Point — object{ x, y }
字段类型必填说明
xnumber是
ynumber是
Project — object
字段类型必填说明
idstring是
appIdstring是
customerIdstring是
namestring是
authModeenum(token | appid)是
statusenum(active | suspended)是
tokenTtlSecondsinteger是
privilegeTtlSecondsinteger是
servicesobject{ recording, streaming, analytics }是
quotasobject{ recordingConcurrent, streamingConcurrent, maxChannels }是
createdAtstring是format date-time
updatedAtstring是format date-time
Quotas — object{ recordingConcurrent, streamingConcurrent, maxChannels }
字段类型必填说明
recordingConcurrentinteger是
streamingConcurrentinteger是
maxChannelsinteger是0 = unlimited
RecordingTaskBody — object
字段类型必填说明
idstring
channelNamestring
modeenum(composite | individual | web)
stateenum(starting | running | stopping | stopped | failed | expired)
layoutobject{ preset, canvasWidth, canvasHeight, backgroundColor }
filesarray<object{ objectKey, url, format, durationSeconds, sizeBytes }>
usageSecondsnumber
errorstring | null
startedAtstring | null
endedAtstring | null
RecordingTaskList — object{ total, tasks }
字段类型必填说明
totalinteger是
tasksarray<object>是
ScenePpt — object{ src, width, height }
字段类型必填说明
srcstring是Image URL (http(s) or object-storage path).
widthinteger是>= 1
heightinteger是>= 1
Services — object{ recording, streaming, analytics }
字段类型必填说明
recordingboolean是
streamingboolean是
analyticsboolean是
StreamingTask — object
字段类型必填说明
idstring
channelNamestring
entryPointstring
streamNamestring
rtmpUrlstring
hlsUrlstring
stateenum(starting | running | stopping | stopped | failed | expired)
idleTimeoutSecondsinteger
lastActiveAtstringformat date-time
errorstring | null
StreamingTaskList — object{ total, streams }
字段类型必填说明
totalinteger是
streamsarray<object>是
Subscription — object{ planId, status, startedAt, currentPeriodEnd, pricePerMonth, includedMinutes }
字段类型必填说明
planIdstring是
statusenum(active | cancelled)是
startedAtstring是format date-time
currentPeriodEndstring是format date-time
pricePerMonthnumber是subscription price in major units
includedMinutesnumber是
TaxProfile — object{ legalName, country, taxId, address, updatedAt, status }
字段类型必填说明
legalNamestring是
countrystring是ISO-3166 alpha-2
taxIdstring是
addressstring是
updatedAtstring是format date-time
statusenum(unverified)是this deployment never validates the tax id against an authority
TokenIssueResponse — object
字段类型必填说明
appIdstring是
channelNamestring是
rtcTokenstring是
rtcUidinteger是1..2147483647
roleenum(host | audience)是
privilegesarray<string>是
controlTokenstringOpaque control-plane token for REST diagnostics/renewal. TokenIssueResult.controlToken is optional; toResult() always sets it.
mediaRoomstringSFU room name when the media adapter namespaces by App ID (TokenIssueResult.mediaRoom).
expireAtstring是format date-time
privilegeExpireAtstring是format date-time
TopUp — object
字段类型必填说明
idstring是
amountnumber是credited amount
currencystring是ISO-4217 currency code;pattern ^[A-Z]{3}$
statusenum(succeeded)是
providerenum(sandbox)是
chargeIdstring是
notestring是
createdAtstring是format date-time
UserView — object
字段类型必填说明
uidinteger
userIdstring | null
roleenum(host | audience)
platforminteger
joinedAtstringformat date-time
audioMutedboolean
videoMutedboolean
publishingobject{ audio, video, screen }
WebhookDelivery — object
字段类型必填说明
idstring是
projectIdstring是
envelopeobject{ noticeId, productId, eventType, notifyMs, sid, payload }是
urlstring是
stateenum(pending | delivering | delivered | failed | dropped)是
attemptsinteger是
maxAttemptsinteger是
nextAttemptAtstring | null是format date-time
lastStatusCodeinteger | null是
lastErrorstring | null是
createdAtstring是format date-time
updatedAtstring是format date-time
WhiteboardImage — object
字段类型必填说明
idstring是
scenePathstring是
srcstring是
widthnumber是
heightnumber是
xnumber是
ynumber是
lockedboolean是
memberIdstring是
createdAtstring是format date-time
WhiteboardMemberState — object
字段类型必填说明
memberIdstring是
roleenum(admin | writer | reader)是
appliancestring是canvas appliance name, e.g. pencil / pencilEraser / rectangle
strokeColorstring是
strokeWidthnumber是
canUndointeger是
canRedointeger是
WhiteboardOperation — object
字段类型必填说明
seqinteger是
typeenum(scene.add | scene.switch | scene.clear | stroke.append | stroke.erase | stroke.undo | stroke.redo | image.insert | viewport.set | room.ban | room.close | member.join | member.leave)是
memberIdstring是
scenePathstring | null是
strokeIdstring | null是
roomVersioninteger是
payloadobject是operation-specific payload, already validated by the service
createdAtstring是format date-time
WhiteboardPpt — object{ src, width, height }
字段类型必填说明
srcstring是
widthnumber是
heightnumber是
WhiteboardReplay — object{ roomUUID, duration, from, to, frames }
字段类型必填说明
roomUUIDstring是
durationnumber是milliseconds between the first and the last frame
fromstring | null是
tostring | null是
framesarray<object{ offset, operation }>是
WhiteboardRoom — object
字段类型必填说明
uuidstring是
teamUUIDstring是
appUUIDstring是
isRecordboolean是
isBanboolean是
phaseenum(active | banned | closed)是
limitinteger是
versioninteger是
createdAtstring是format date-time
updatedAtstring是format date-time
closedAtstring | null是format date-time
WhiteboardRoomState — object
字段类型必填说明
roomobject是
currentScenePathstring是
viewportobject{ x, y, width, height, scale, updatedAt }是
scenesarray<object>是
memberStatesobject是member id → current drawing state
canUndoStepsinteger是
canRedoStepsinteger是
WhiteboardSceneSummary — object
字段类型必填说明
pathstring是
namestring是
pptany是
strokeCountinteger是
imageCountinteger是
createdAtstring是format date-time
updatedAtstring是format date-time
WhiteboardSnapshot — object
字段类型必填说明
roomUUIDstring是
appUUIDstring是
roomVersioninteger是
exportedAtstring是format date-time
currentScenePathstring是
viewportobject{ x, y, width, height, scale, updatedAt }是
scenesarray<object{ path, name, ppt, strokes, images }>是
operationsarray<object>
WhiteboardStroke — object
字段类型必填说明
idstring是
scenePathstring是
appliancestring是canvas appliance name, e.g. pencil / pencilEraser / rectangle
colorstring是
widthnumber是
pointsarray<array<number>>是flat [x, y, ...] point list
memberIdstring是
seqinteger是
undoneboolean是
erasedboolean是
createdAtstring是format date-time
WhiteboardViewport — object{ x, y, width, height, scale, updatedAt }
字段类型必填说明
xnumber是
ynumber是
widthnumber是
heightnumber是
scalenumber是
updatedAtstring是format date-time
XlaMetricSet — object
字段类型必填说明
samplesinteger是
joinAttemptsinteger是
joinSuccessRatenumber | null是joinSuccess / joinAttempt samples; null when there is no sample
joinWithin5sRatenumber | null是
videoFreezeRatenumber | null是
audioFreezeRatenumber | null是
networkDelayMsnumber | null是
availabilitynumber | null是telemetry availability: observed 5-minute buckets / buckets in the month
observedBucketsinteger是
expectedBucketsinteger是
XlaMonthReport — object
字段类型必填说明
monthstring是YYYY-MM
fromstring是format date-time
tostring是format date-time
scopeobject{ kind, projectId, projectName }是
metricsobject是
projectsarray<any>是
insufficientboolean是
reasonstring | null是
notestring是how each metric is computed (no modelled percentages)
generatedAtstring是format date-time
XlaProjectRow — any

无字段声明。

本页由文档构建流水线生成 · 2026-10-31 01:24:02 UTC · 文档中心 v1.1.0.

内容依据公开 API 定义.

ni-meet 是自建 RTC PaaS,媒体面基于 LiveKit(Apache-2.0),并与声网 API 兼容。