v1

latestOpenAPI 3.0.32026-07-17214860.6 KB
Tokens

Create APNs Token

Create an Apple Push Notification service (APNs) token.

Lives under the /device/ API module (not /database/). CloudKit's archived REST reference documents this under /database/..., but the live service routes only OPTIONS to that path and returns 405 Method Not Allowed for POST. The working path is the one CloudKit JS uses (setApiModuleName("device")).

post/device/{version}/{container}/{environment}/tokens/create

Path parameters

versionstring required

Protocol version

containerstring required

Container ID (begins with "iCloud.")

environment'development' | 'production' required

Container environment

Request body

apnsEnvironment'development' | 'production' required
clientIdstring required

Logical CloudKit client identifier. CloudKit JS persists this across sessions for push de-dup; for server-side callers a fresh UUID per request is fine unless continuity matters.

Response

Token created successfully

apnsEnvironment'development' | 'production' required

The APNs environment the token targets (echoes the request).

apnsTokenstring required

The CloudKit-minted APNs token to use as a push destination.

webcourierURLstring uri required

Long-poll endpoint URL that browser / Service-Worker clients use to receive push notifications. Not relevant for server callers, which receive pushes via APNs proper.