To onboard devices programmatically, use the nRF Cloud bulk onboarding endpoint. It accepts a CSV with as few as one data row (a deviceId and attestationToken column) and is authenticated with an organization auth token. See Onboarding devices in bulk for the CSV format, endpoint, and required credentials.