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

# Update context settings

> Edit any subset of the Context settings; only the fields you send change. Strings accept `null` to clear (style-guide overrides then revert to the generated guide). Arrays fully REPLACE the stored list: send every value the account should keep, `[]` clears. `voice.favorite_creators` takes X usernames (with or without @, as bare strings or as the { screen_name } objects GET returns); SuperX resolves names and avatars. Unlike most write endpoints, context writes accept `account_id` for any linked or shared account; on a share with `editor` permission they return `403 editor_restricted`, because only the account owner may change what the AI knows. These settings shape all future AI output for the account. Returns the full updated document.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /v1/context
openapi: 3.1.0
info:
  title: SuperX API
  version: 1.0.0
  description: >
    The SuperX public API: your Twitter/X content, analytics, audience and

    scheduling data over REST.


    All endpoints require an API key (`Authorization: Bearer sxk_...`) except

    `GET /v1/docs`. Keys are created in the SuperX app under Account > API / MCP
    / CLI

    and are server-side secrets.


    Timestamps are UTC ISO-8601 in both directions; inputs must carry an
    explicit

    `Z` or numeric offset. Every authenticated response carries

    `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`
    headers.
  contact:
    name: SuperX
    url: https://superx.so
servers:
  - url: https://api.superx.so
security:
  - apiKey: []
tags:
  - name: Identity
  - name: Content
  - name: Analytics
  - name: Inspiration
  - name: Audience
  - name: Contact Lists
  - name: Signals
  - name: Media
  - name: Scheduling
  - name: Tags
  - name: Context
  - name: Queue
  - name: Articles
  - name: Meta
paths:
  /v1/context:
    patch:
      tags:
        - Context
      summary: Update context settings
      description: >-
        Edit any subset of the Context settings; only the fields you send
        change. Strings accept `null` to clear (style-guide overrides then
        revert to the generated guide). Arrays fully REPLACE the stored list:
        send every value the account should keep, `[]` clears.
        `voice.favorite_creators` takes X usernames (with or without @, as bare
        strings or as the { screen_name } objects GET returns); SuperX resolves
        names and avatars. Unlike most write endpoints, context writes accept
        `account_id` for any linked or shared account; on a share with `editor`
        permission they return `403 editor_restricted`, because only the account
        owner may change what the AI knows. These settings shape all future AI
        output for the account. Returns the full updated document.
      operationId: updateContext
      parameters:
        - $ref: '#/components/parameters/AccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                profile_description:
                  type: object
                  properties:
                    text:
                      type: string
                      maxLength: 500
                      nullable: true
                    enabled:
                      type: boolean
                interests:
                  type: array
                  maxItems: 30
                  items:
                    type: string
                    maxLength: 50
                rules:
                  type: string
                  maxLength: 500
                  nullable: true
                reply:
                  type: object
                  properties:
                    custom_instructions:
                      type: string
                      maxLength: 500
                      nullable: true
                    include_author_name:
                      type: boolean
                voice:
                  type: object
                  properties:
                    favorite_creators:
                      type: array
                      maxItems: 3
                      items:
                        oneOf:
                          - type: string
                            description: X username, with or without the leading @.
                          - type: object
                            required:
                              - screen_name
                            properties:
                              screen_name:
                                type: string
                            description: >-
                              GET output round-trips; fields other than
                              screen_name are ignored and re-derived.
                    use_own_posts_as_examples:
                      type: boolean
                style_guide:
                  type: object
                  properties:
                    audience_override:
                      type: string
                      maxLength: 600
                      nullable: true
                    vocabulary_override:
                      type: string
                      maxLength: 1000
                      nullable: true
                account_id:
                  type: string
            example:
              rules: Never use hashtags. Keep posts under 200 characters.
              interests:
                - indie hacking
                - SaaS
                - AI agents
              style_guide:
                audience_override: null
      responses:
        '200':
          description: >-
            The full updated context document. If the save landed but the
            read-back failed, `data` is null and `note` says to fetch GET
            /v1/context for the updated document.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    oneOf:
                      - $ref: '#/components/schemas/Context'
                      - type: 'null'
                  note:
                    type: string
                    description: >-
                      Present only when data is null (save succeeded, read-back
                      failed).
        '400':
          $ref: '#/components/responses/InvalidParameter'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ContextWriteForbidden'
        '404':
          $ref: '#/components/responses/AccountNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/UpstreamUnavailable'
components:
  parameters:
    AccountId:
      name: account_id
      in: query
      required: false
      description: >-
        Account to act on, from `GET /v1/accounts`. Defaults to your main
        account. An id outside your accounts returns `404 account_not_found`.
      schema:
        type: string
  headers:
    X-RateLimit-Limit:
      description: The limit of the rate window closest to exhaustion.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in that window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp (seconds) when that window resets.
      schema:
        type: integer
  schemas:
    Context:
      type: object
      description: >-
        The account's Context settings - the background SuperX's AI uses when
        writing for the account. `style_guide.generated` is read-only.
      properties:
        profile_description:
          type: object
          properties:
            text:
              type: string
            enabled:
              type: boolean
        interests:
          type: array
          items:
            type: string
        rules:
          type: string
          description: Mandatory instructions applied on every AI surface.
        reply:
          type: object
          properties:
            custom_instructions:
              type: string
            include_author_name:
              type: boolean
        voice:
          type: object
          properties:
            favorite_creators:
              type: array
              items:
                $ref: '#/components/schemas/FavoriteCreator'
            use_own_posts_as_examples:
              type: boolean
        style_guide:
          type: object
          properties:
            audience_override:
              type: string
              nullable: true
              description: Manual override; outranks the generated guide until cleared.
            vocabulary_override:
              type: string
              nullable: true
            generated:
              type: object
              description: The app-generated style guide (read-only).
              properties:
                audience:
                  type: string
                  nullable: true
                vocabulary:
                  type: string
                  nullable: true
                generated_at:
                  type: string
                  format: date-time
                  nullable: true
        products:
          type: array
          items:
            $ref: '#/components/schemas/ContextProduct'
    FavoriteCreator:
      type: object
      properties:
        screen_name:
          type: string
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        profile_image_url_https:
          type: string
          nullable: true
    ContextProduct:
      type: object
      properties:
        id:
          type: integer
        url:
          type: string
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        positioning:
          type: string
          nullable: true
        features:
          type: string
          nullable: true
        updates:
          type: string
          nullable: true
        last_scraped_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When SuperX last refreshed the product's details from its url
            (read-only).
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
            retry_after:
              type: integer
              description: Seconds to wait before retrying (rate-limit errors only).
    LegacyErrorEnvelope:
      type: object
      required:
        - error
      description: |
        Legacy shape used ONLY by the shared subscription middleware: a plain
        string `error` field. Seen on `403` when the subscription has lapsed
        (string starts with "subscription_required:") and on `500` when
        subscription verification fails (string starts with "internal_error:").
      properties:
        error:
          type: string
          example: >-
            subscription_required: The SuperX API requires an active
            subscription
  responses:
    InvalidParameter:
      description: A parameter is missing, malformed, or out of range.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_parameter
              message: since must be a UTC ISO-8601 timestamp
    Unauthorized:
      description: >-
        Missing/malformed Authorization header (`unauthorized`) or an
        unknown/revoked key (`invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: invalid_api_key
              message: Unknown or revoked API key
    ContextWriteForbidden:
      description: >-
        Read-only key (`insufficient_scope`), an account shared with you with
        `editor` permission (`editor_restricted` - only the owner can change
        context settings; queue settings stay editable), or a lapsed
        subscription (legacy string envelope). Context writes are per-account
        and never return `writes_main_account_only`.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/LegacyErrorEnvelope'
          example:
            error:
              code: editor_restricted
              message: >-
                This account is shared with you with Editor permission. Only the
                account owner can change these settings.
    AccountNotFound:
      description: account_id is not one of your accounts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: account_not_found
              message: No account with that id belongs to this key
    RateLimited:
      description: Rate limit exceeded (limits vary by plan). Honor Retry-After.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: rate_limited
              message: >-
                Rate limit exceeded for the Pro plan (30 requests/min). Upgrade
                for higher limits.
              retry_after: 42
    InternalError:
      description: >-
        Unexpected server error. May also use the legacy string envelope when
        subscription verification fails.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorEnvelope'
              - $ref: '#/components/schemas/LegacyErrorEnvelope'
          example:
            error:
              code: internal_error
              message: Failed to fetch posts
    UpstreamError:
      description: A dependent SuperX service returned an unexpected response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: upstream_error
              message: Failed to fetch scheduled posts. Try again shortly.
    UpstreamUnavailable:
      description: >-
        The scheduling service is temporarily unreachable. Safe to retry; reuse
        your Idempotency-Key on POST.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: upstream_unavailable
              message: >-
                The scheduling service is temporarily unavailable. Retry with
                the same Idempotency-Key.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A SuperX API key ("sxk_..."), created in the SuperX app under Account >
        API / MCP / CLI. Keys are server-side secrets.

````