/v1/workspaces/{workspace_id}/channels/apns/credentialsAuthUpload an APNs key
Uploads an APNs authentication key (`.p8`, token auth) for one bundle id. You still create the key in your Apple developer account; Notify validates it with Apple before activating it (a background push to a placeholder token that reaches no device), stores it encrypted and never returns it. An upload replaces the active or invalid key of the same bundle id whose environment overlaps (`replaced_credential_ids`), and resumes push for that bundle id if Apple had refused the previous key. Uploading the active key again unchanged only re-validates it. Nothing is stored when Apple refuses the key or cannot be reached.
Path parameters
workspace_id*string · uuidId of the workspace.
Headers
Idempotency-KeystringA key (1..256 chars, [A-Za-z0-9._:-]) makes retries safe: a replay returns the original response for 24 h.
Request body
key_id*stringThe 10-character key id Apple shows next to the key (Certificates, Identifiers & Profiles > Keys).
Example: "ABC123DEFG"
team_id*stringThe 10-character team id of the Apple developer account the key belongs to.
Example: "DEF123GHIJ"
bundle_id*stringThe app bundle id the key sends to (the `apns-topic`). Devices register with the same value as `app_id`.
Example: "com.example.app"
environment*objectWhich APNs environment the key serves. Token-auth keys work in both; `both` lets debug builds (`sandbox` device tokens) and TestFlight/App Store builds (`production`) share one key.
p8*stringThe full contents of the `.p8` file, including the `-----BEGIN PRIVATE KEY-----` lines (`\n` escapes are accepted). Write-only: validated with Apple, stored encrypted and never returned; responses show a fingerprint.
Response · 200 The active key for the bundle id (metadata only).
credential_id*string · uuidThe credential id.
key_id*stringAPNs key id.
team_id*stringApple team id.
bundle_id*stringThe bundle id the key sends to.
environment*objectThe environments the key serves.
fingerprint*stringFirst 16 hex characters of the SHA-256 of the key; the key itself is never returned.
status*object`active` after a successful upload; `invalid` once Apple refused it while sending.
last_verified_at*string · date-timeWhen Apple last accepted the key (the upload validation).
last_error_code*stringThe Apple reason that made the key `invalid` (e.g. `InvalidProviderToken`).
created_at*string · date-timeWhen the credential was created.
replaced_credential_ids*arrayAPNs credentials of the same bundle id with an overlapping environment that this upload replaced (now `superseded`; their key is erased after 24 h). Empty on a first upload or a no-op re-upload.
Example
Request
PUT https://api.notify.productcraft.co/v1/workspaces/{workspace_id}/channels/apns/credentials
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"key_id": "ABC123DEFG",
"team_id": "DEF123GHIJ",
"bundle_id": "com.example.app",
"environment": {},
"p8": "string"
}Response
{
"credential_id": "00000000-0000-0000-0000-000000000000",
"key_id": "string",
"team_id": "string",
"bundle_id": "string",
"environment": {},
"fingerprint": "string",
"status": {},
"last_verified_at": "2026-01-01T00:00:00.000Z",
"last_error_code": "string",
"created_at": "2026-01-01T00:00:00.000Z",
"replaced_credential_ids": [
"00000000-0000-0000-0000-000000000000"
]
}