> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save APNs Credentials

> Connect iOS push with an APNs auth key

# Save APNs Credentials

Saves the APNs auth key (.p8) used for iOS push. The key is validated, encrypted at rest and never returned. Saving new credentials clears the last credential error.

`DELETE /api/v1/push/settings/ios` removes the credentials. iOS devices stop receiving push until you save a key again; registered devices are kept.

Both require the `integrations:manage` scope and edit access to the workspace.

## Request

<ParamField body="keyId" type="string" required>
  The 10-character APNs key ID.
</ParamField>

<ParamField body="teamId" type="string" required>
  Your 10-character Apple developer team ID.
</ParamField>

<ParamField body="bundleId" type="string" required>
  Your app's bundle ID, for example `com.example.app`.
</ParamField>

<ParamField body="privateKey" type="string" required>
  The full contents of the `AuthKey_XXXXXXXXXX.p8` file.
</ParamField>

<ParamField body="environment" type="string" default="production">
  `production` for App Store and TestFlight builds, `sandbox` for Xcode
  development builds.
</ParamField>

```bash theme={null}
curl -X PUT "https://api.sequenzy.com/api/v1/push/settings/ios" \
  --header "Authorization: Bearer $SEQUENZY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"keyId":"ABC123DEFG","teamId":"DEF123GHIJ","bundleId":"com.example.app","privateKey":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"}'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "push": {
      "web": {
        "enabled": true,
        "vapidPublicKey": "BH3tXU0JSzok9ND7DyeQRcEy..."
      },
      "ios": {
        "configured": true,
        "keyId": "ABC123DEFG",
        "teamId": "DEF123GHIJ",
        "bundleId": "com.example.app",
        "environment": "production",
        "lastError": null,
        "lastErrorAt": null
      },
      "android": {
        "configured": false,
        "projectId": null,
        "clientEmail": null,
        "lastError": null,
        "lastErrorAt": null
      },
      "defaultIconUrl": "https://cdn.example.com/icon-192.png"
    },
    "message": "APNs credentials saved."
  }
  ```

  ```json 400 theme={null}
  {
    "error": "The key could not be read. Paste the full contents of the .p8 file."
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Invalid API key"
  }
  ```

  ```json 403 theme={null}
  {
    "error": "API key is missing required scope: integrations:manage"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.