> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snipp.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Preferences

> Change any subset of your preferences.

Change any of your notification, email, upload and sharing preferences.

## Behavior

* Send a JSON body with only the sections and keys you want to change. Anything you leave out keeps its value.
* `notifications` accepts `follows`, `likes` and `comments`. `emails` accepts `sign_ins`. `uploads` accepts `default_privacy`, `adaptive_streaming`, `auto_compress`, `include_metadata` and `auto_copy_url`. `sharing` accepts `share_policy`.
* Every toggle must be a boolean. `uploads.default_privacy` must be `public`, `unlisted` or `private`. `sharing.share_policy` must be `everyone`, `following` or `nobody`.
* An unknown key or a wrong value returns `400` and nothing is saved.
* The response is the full set of preferences after the change. See [Get Preferences](/relay-reference/endpoint/preferences/get) for what each one does.
* Shares a rate limit bucket with Get Preferences: 20 requests per minute.

## Examples

```bash theme={null}
curl -X PATCH "https://relay.snipp.gg/preferences" \
  -H "relay-key: YOUR_RELAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"notifications": {"likes": false}, "uploads": {"default_privacy": "private"}}'
```

## Responses

```json theme={null}
{
  "notifications": {
    "follows": true,
    "likes": false,
    "comments": true
  },
  "emails": {
    "sign_ins": true
  },
  "uploads": {
    "default_privacy": "private",
    "adaptive_streaming": true,
    "auto_compress": false,
    "include_metadata": false,
    "auto_copy_url": false
  },
  "sharing": {
    "share_policy": "everyone"
  }
}
```

## Errors

| Status | Type | When |
| - | - | - |
| `400` | `invalid_request` | An unknown key or an invalid value |
| `401` | `unauthorized` | Missing or invalid key |
| `403` | `suspended` | Your account is suspended |
| `429` | `rate_limited` | More than 20 requests per minute |


## OpenAPI

````yaml relay-reference/openapi.json PATCH /preferences
openapi: 3.0.0
info:
  title: Snipp.gg Relay API
  description: >-
    First-party Snipp API for the full user experience: uploads, posts,
    discover, likes, comments, notifications, blocks and profile management.
  version: 3.0.0
servers:
  - url: https://relay.snipp.gg
    description: Default. Load-balanced across regions. No upload cap.
  - url: https://eu-west-1.relay.snipp.gg
    description: EU West regional endpoint. Pins uploads and storage to EU West.
  - url: https://us-west-1.relay.snipp.gg
    description: US West regional endpoint. Pins uploads and storage to US West.
  - url: https://pulsar.snipp.gg
    description: Alternative host. Capped at 100 MB per upload.
security:
  - relayKeyAuth: []
paths:
  /preferences:
    patch:
      summary: Update Preferences
      description: Change any subset of your preferences.
      operationId: updatePreferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                notifications:
                  type: object
                  properties:
                    follows:
                      type: boolean
                    likes:
                      type: boolean
                    comments:
                      type: boolean
                emails:
                  type: object
                  properties:
                    sign_ins:
                      type: boolean
                uploads:
                  type: object
                  properties:
                    default_privacy:
                      type: string
                      enum:
                        - public
                        - unlisted
                        - private
                    adaptive_streaming:
                      type: boolean
                    auto_compress:
                      type: boolean
                    include_metadata:
                      type: boolean
                    auto_copy_url:
                      type: boolean
                sharing:
                  type: object
                  properties:
                    share_policy:
                      type: string
                      enum:
                        - everyone
                        - following
                        - nobody
            example:
              notifications:
                likes: false
              uploads:
                default_privacy: private
      responses:
        '200':
          description: Success
          headers:
            request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Preferences'
              example:
                notifications:
                  follows: true
                  likes: false
                  comments: true
                emails:
                  sign_ins: true
                uploads:
                  default_privacy: private
                  adaptive_streaming: true
                  auto_compress: false
                  include_metadata: false
                  auto_copy_url: false
                sharing:
                  share_policy: everyone
        '400':
          $ref: '#/components/responses/E400'
        '401':
          $ref: '#/components/responses/E401'
        '403':
          $ref: '#/components/responses/E403'
        '405':
          $ref: '#/components/responses/E405'
        '429':
          $ref: '#/components/responses/E429'
        '500':
          $ref: '#/components/responses/E500'
components:
  headers:
    RequestId:
      description: Unique ID for the request. Include it when contacting support.
      schema:
        type: string
        format: uuid
  schemas:
    Preferences:
      type: object
      properties:
        notifications:
          type: object
          properties:
            follows:
              type: boolean
            likes:
              type: boolean
            comments:
              type: boolean
          required:
            - follows
            - likes
            - comments
        emails:
          type: object
          properties:
            sign_ins:
              type: boolean
          required:
            - sign_ins
        uploads:
          type: object
          properties:
            default_privacy:
              type: string
              enum:
                - public
                - unlisted
                - private
            adaptive_streaming:
              type: boolean
            auto_compress:
              type: boolean
            include_metadata:
              type: boolean
            auto_copy_url:
              type: boolean
          required:
            - default_privacy
            - adaptive_streaming
            - auto_compress
            - include_metadata
            - auto_copy_url
        sharing:
          type: object
          properties:
            share_policy:
              type: string
              enum:
                - everyone
                - following
                - nobody
              description: >-
                Who can give you access to their private posts. `following`
                means only accounts you follow. Changing it does not remove
                access you already have.
          required:
            - share_policy
      required:
        - notifications
        - emails
        - uploads
        - sharing
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      description: Every non-2xx response has this body.
    ErrorDetail:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        message:
          type: string
          description: Human-readable sentence. Do not match on it; use `type`.
        username:
          type: string
          description: >-
            `suspended` on `GET /users/{id}` only: the suspended user's
            username.
        quota:
          type: integer
          description: >-
            `quota_exceeded` only: the limit, in bytes for the weekly quota or
            minutes for priority minutes.
        used:
          type: integer
          description: >-
            `quota_exceeded` only: usage in the current window, in the same unit
            as `quota`.
        resets_at:
          type: string
          format: date-time
          description: '`quota_exceeded` only: when the window resets.'
          nullable: true
        failed:
          type: array
          items:
            $ref: '#/components/schemas/FailedFile'
          description: '`upload_failed` only: one entry per file.'
      required:
        - type
        - message
    ErrorType:
      type: string
      enum:
        - invalid_request
        - unauthorized
        - forbidden
        - suspended
        - blocked
        - moderated
        - plan_required
        - not_found
        - method_not_allowed
        - file_too_large
        - unsupported_type
        - quota_exceeded
        - rate_limited
        - upload_failed
        - internal
        - unavailable
      description: Machine-readable error category. See [Errors](/concepts/errors).
    FailedFile:
      type: object
      properties:
        index:
          type: integer
          description: Zero-based position of the file in the request.
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - index
        - error
      description: >-
        A file that was not stored. `error` has the same shape as a top-level
        error.
  responses:
    E400:
      description: Invalid request
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    E401:
      description: Missing or invalid key
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    E403:
      description: Not allowed
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    E405:
      description: Method not allowed
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
        Allow:
          description: Methods this path accepts.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    E429:
      description: Rate limited
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    E500:
      description: Internal error
      headers:
        request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    relayKeyAuth:
      type: apiKey
      in: header
      name: relay-key
      description: Your relay key from snipp.gg/settings/relay

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.