tread.io UserDevicePermission API

The UserDevicePermission API from tread.io — 1 operation(s) for userdevicepermission.

OpenAPI Specification

treadio-userdevicepermission-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Horizon API V1 AccountExternalTruckIdentifier UserDevicePermission API
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: 'This is the Version 1 implementation.


    When in doubt we default to the practices outlined [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)'
  license:
    name: Private
    url: https://tread.io
servers:
- description: production
  url: https://api.tread-horizon.com
security:
- bearerAuth: []
tags:
- name: UserDevicePermission
paths:
  /v1/users/me/user_device_permissions:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    put:
      summary: Update UserDevicePermissions
      tags:
      - UserDevicePermission
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    x-stoplight:
                      id: hj6esbdtqp5ps
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
      operationId: put-v1-user_device_permissions
      x-stoplight:
        id: pxqntykou9mmn
      description: This endpoint will be used by the mobile app to update the user's permissions given in the app.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDevicePermission-Update'
components:
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            $ref: '#/components/schemas/Error-Response'
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            $ref: '#/components/schemas/UnauthenticatedError-Response'
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: 'The Accept-Language request HTTP header indicates the natural language and locale that the client prefers. '
  schemas:
    UserDevicePermission-Update:
      title: UserDevicePermission-Update
      x-stoplight:
        id: tjt78iltqu7mp
      type: object
      description: This model will be used by the app to update array of user device permissions
      required:
      - device_id
      - device_permissions
      properties:
        device_id:
          type: string
          x-stoplight:
            id: hoyojk7ugnk3l
        device_permissions:
          type: array
          x-stoplight:
            id: kr5ocmelozr37
          items:
            $ref: '#/components/schemas/UserDevicePermissionCombined'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    DevicePermission:
      title: DevicePermission
      x-stoplight:
        id: fog1bzwo59bxy
      description: These are the list of permissions an app user can set
      enum:
      - location_while_using
      - location_always
      - notifications
      - motion_and_fitness
      - physical_activity
      - ignore_battery_optimizations
      - background_refresh
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
      - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    DevicePermissionState:
      title: DevicePermissionState
      x-stoplight:
        id: 3c1p4ft9qi1uj
      description: These are the list of permission states a permission can have
      enum:
      - denied
      - granted
      - restricted
      - limited
      - permanently_denied
      - provisional
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        x-stoplight:
          id: tg10dt7s0l6bw
        properties:
          error_type:
            type: string
            x-stoplight:
              id: wvq8c0qsym4hz
        required:
        - error_type
    UserDevicePermissionCombined:
      title: UserDevicePermissionCombined
      x-stoplight:
        id: e3ix6tpc21ms7
      type: object
      description: This is an object which combines the permission name and state
      required:
      - user_device_permission
      - user_device_permission_state
      properties:
        user_device_permission:
          $ref: '#/components/schemas/DevicePermission'
        user_device_permission_state:
          $ref: '#/components/schemas/DevicePermissionState'
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
x-stoplight:
  id: 75rfxjepk4523