openapi: 3.0.3 info: title: Courier Audiences Device Tokens API description: 'Courier is notification infrastructure that orchestrates transactional and product messaging across email, SMS, push, chat, and an in-app inbox from a single REST API. This document models the primary public endpoints under the base URL https://api.courier.com: sending notifications (Send), inspecting sent messages, managing lists, user profiles, preferences, device tokens, notification templates, brands, automations, audiences, tenants, bulk jobs, audit events, and translations. All requests are authenticated with a Bearer API key. Endpoint paths are grounded in Courier''s published API reference; request and response bodies are modeled and simplified.' version: 2024-01 contact: name: Courier url: https://www.courier.com x-endpoint-confidence: Paths and methods are grounded in the Courier API reference (https://www.courier.com/docs/reference). Schemas are modeled, not exhaustive. servers: - url: https://api.courier.com description: Courier production API security: - bearerAuth: [] tags: - name: Device Tokens description: Push notification device tokens for a user. paths: /users/{user_id}/tokens: parameters: - $ref: '#/components/parameters/UserId' get: operationId: listUserTokens tags: - Device Tokens summary: List a user's device tokens responses: '200': description: The user's device tokens. content: application/json: schema: type: array items: $ref: '#/components/schemas/DeviceToken' /users/{user_id}/tokens/{token}: parameters: - $ref: '#/components/parameters/UserId' - name: token in: path required: true schema: type: string get: operationId: getUserToken tags: - Device Tokens summary: Get a device token responses: '200': description: The device token. content: application/json: schema: $ref: '#/components/schemas/DeviceToken' put: operationId: putUserToken tags: - Device Tokens summary: Add or update a device token requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DeviceToken' responses: '204': description: The token was stored. patch: operationId: patchUserToken tags: - Device Tokens summary: Patch a device token requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: '204': description: The token was patched. delete: operationId: deleteUserToken tags: - Device Tokens summary: Delete a device token responses: '204': description: The token was deleted. components: schemas: DeviceToken: type: object properties: token: type: string provider_key: type: string enum: - apn - firebase-fcm - expo - onesignal device: type: object additionalProperties: true status: type: string enum: - active - failed - revoked - unknown parameters: UserId: name: user_id in: path required: true description: Your application's user id for the recipient. schema: type: string securitySchemes: bearerAuth: type: http scheme: bearer description: 'Courier API key passed as `Authorization: Bearer `. Keys are found in the Courier settings under API Keys and are environment scoped (test vs production).'