---
title: "Register Device"
method: POST
path: "/api/v1/devices"
tags: ["Devices"]
---

# Register Device

`POST /api/v1/devices`

## Request

- Base URL: `https://www.endlesstravelplans.com`
- URL: `https://www.endlesstravelplans.com/api/v1/devices`
- Auth: HTTP bearer

Register a device push token for the authenticated user.
If the token already exists, it will be reassigned to the current user.

## Request body

- object
  - `device_token` string, required: The push notification token.
  - `platform` string, required: The device platform.
  - `device_name` string, nullable: The device name.

## Response `201`

- union
  - object
    - `device` object
      - `id` integer
      - `device_token` string
      - `platform` string
  - object: Recorded shape (tests/Fixtures/api-shapes/devices-store.json)
    - `device` object
      - `device_token` string
      - `id` integer
      - `platform` string

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `422`: validation_failed: The request body failed validation; field messages are in `errors`.
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`: server_error: Unhandled failure; quote `request_id` to support.

---

[API](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api.md) · [All operations](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/llms.txt) · [OpenAPI document](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/revisions/ae82ed3e4a8f?raw)
