---
title: "Store or replace an APNs auth key"
method: PUT
path: "/appsec/7.0/apple/apns-keys"
tags: ["APNs Keys"]
---

# Store or replace an APNs auth key

`PUT /appsec/7.0/apple/apns-keys`

## Request

- Base URL: `https://cloud.codenameone.com`
- URL: `https://cloud.codenameone.com/appsec/7.0/apple/apns-keys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/codenameone/apis/codename-one-apple-signing-service/docs/appsec/7.0/apple/apns-keys/put.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- ApnsKeyRequest: Write-only. A token-based APNs auth key.
  - `keyId` string, required: The 10-char APNs Key ID.
  - `teamId` string, required
  - `privateKeyP8` string, required: The .p8 auth key
  - `displayName` string, nullable

## Response `204`

Stored

## Other responses

- `400`: Missing or invalid parameters (plain-text reason in the body).
- `403`: Caller is anonymous / not authenticated.
- `503`: Secrets vault is not configured on this deployment (no master key), so credentials cannot be stored.

---

[API](https://skmtc.dev/codenameone/apis/codename-one-apple-signing-service.md) - [All operations](https://skmtc.dev/codenameone/apis/codename-one-apple-signing-service/llms.txt) - [OpenAPI document](https://skmtc.dev/codenameone/apis/codename-one-apple-signing-service/revisions/f0b48d0af96f?raw)
