openapi: 3.2.0 info: title: LeafLink Notification Preferences API version: '2022-10-31' description: 'This reference specification outlines all the available HTTP operations of the LeafLink API. See the [LeafLink Developer Hub](/api) for guides, how-to, and general information of the API. ' termsOfService: https://www.leaflink.com/terms-and-conditions/ contact: email: support@leaflink.com servers: - url: https://api.leaflink.com description: LeafLink API production URL. - url: https://staging-api.leaflink.com description: LeafLink API staging URL. security: - bearerAuth: [] tags: - name: Notification Preferences paths: /notification/preferences: get: operationId: notification_preferences_list description: List Notification Preferences Groups. summary: List Notification Preferences Groups parameters: - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - name: search required: false in: query description: A search term. schema: type: string - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Notification Preferences security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedNotificationPreferencesList' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. /notification/preferences/user/{user_id}: get: summary: Get a user's notification preferences. description: Get a user's notification preferences. parameters: - in: path name: user_id schema: type: string required: true - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Notification Preferences responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/NotificationPreferences-unified-upstream-notification-service' description: List of objects with notification preferences from a user. headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '404': content: application/json: schema: $ref: '#/components/schemas/MultipleErrors' description: Preferences from User with ID not found. headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. patch: summary: Update a user's notification preferences. description: Update a user's notification preferences. requestBody: required: true content: application/json: schema: type: array items: $ref: '#/components/schemas/NotificationPreferencesPayloadSchema' parameters: - in: path name: user_id schema: type: string required: true - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Notification Preferences responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/NotificationPreferences-unified-upstream-notification-service' description: Updated notification preferences for the user. headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '404': content: application/json: schema: $ref: '#/components/schemas/MultipleErrors' description: Preferences from User with ID not found. headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. components: schemas: NotificationTopic: type: object description: Serializer for NotificationTopic model. properties: name: type: string maxLength: 255 default_value: type: boolean description: type: string maxLength: 255 available_medium: type: array items: type: string readOnly: true required: - available_medium - default_value - description - name PaginatedNotificationPreferencesList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/NotificationPreferences' Error: type: object properties: id: type: string status: type: string code: type: string title: type: string detail: type: string source: $ref: '#/components/schemas/ErrorSource' meta: {} required: - status NotificationPreferences-unified-upstream-notification-service: type: object properties: topic: type: string medium: type: string enabled_timestamp: type: - string - 'null' format: date-time required: - enabled_timestamp - medium - topic MultipleErrors: type: object properties: errors: type: array items: $ref: '#/components/schemas/Error' required: - errors NotificationPreferencesPayloadSchema: type: object properties: topic: type: string medium: type: string enabled_timestamp: type: boolean required: - enabled_timestamp - medium - topic NotificationPreferences: type: object description: Schema for notification preferences payload. properties: name: type: string maxLength: 255 display_description: type: string maxLength: 255 items: type: array items: $ref: '#/components/schemas/NotificationTopic' readOnly: true required: - display_description - items - name ErrorSource: type: object properties: pointer: type: string parameter: type: string securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'Authentication is done via access tokens (JWTs). See the [API authentication doc](/api/getting-started/#authentication) for more information. ' tokenAuth: type: apiKey in: header name: Authorization description: Token-based authentication with required prefix "Token"