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

> ## Agent Instructions
> Base URL: https://api.social-api.ai/v1. Send your API key in the Authorization header: Authorization: Bearer <your API key>.
> Every error response from /v1 is JSON: { "error": { "code", "message", "meta" (optional) }, "request_id" }. Branch on error.code; use error.message only for logs.
> A 429 response carries a Retry-After header, in seconds, when the limit has a known wait.
> Paginated list endpoints return next_cursor, at the top level or inside pagination (see /guides/pagination). Pass it as the cursor query parameter to get the next page. An absent or empty next_cursor means you have the last page.
> Treat every ID as an opaque string: do not parse it or assume a format.
> Support differs by platform and by operation. Check /platforms/overview before assuming an operation works on a platform. An unsupported operation returns 501 with error.code resource.not_supported.

# Update an account's permissions

> Replaces the permissions of a connected account. Send null for every permission, including ones added later. Removing a permission takes effect at once and immediately deletes the comments, messages, analytics and posts not published through SocialAPI that it covers, and adding the permission back does not restore them. Posts published through SocialAPI are kept. Adding a permission takes effect at once when the platform already granted it, otherwise reconnect the account to ask for it. Check effective_permissions in the response.



## OpenAPI

````yaml /api-reference/openapi.json patch /accounts/{id}
openapi: 3.0.0
info:
  description: >-
    Unified social media inbox API. Read and respond to comments, DMs, reviews,
    and mentions across Instagram, Facebook, Threads, Google Business Profile,
    TikTok, LinkedIn, and YouTube through a single REST API. X/Twitter and
    Trustpilot coming soon.
  title: SocialAPI.AI
  contact:
    name: SocialAPI.AI Support
    email: support@social-api.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.social-api.ai/v1
security: []
paths:
  /accounts/{id}:
    patch:
      tags:
        - Accounts
      summary: Update an account's permissions
      description: >-
        Replaces the permissions of a connected account. Send null for every
        permission, including ones added later. Removing a permission takes
        effect at once and immediately deletes the comments, messages, analytics
        and posts not published through SocialAPI that it covers, and adding the
        permission back does not restore them. Posts published through SocialAPI
        are kept. Adding a permission takes effect at once when the platform
        already granted it, otherwise reconnect the account to ask for it. Check
        effective_permissions in the response.
      parameters:
        - example: acc_01HZ9X3Q4R5M6N7P8V2K0W1J
          description: Account ID
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/api_endpoints.UpdateAccountPermissionsRequest
        description: New permissions
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/social-api_ai_core_api_connectors_base.Account
        '400':
          description: >-
            Invalid body, missing permissions field, empty list, or unknown
            permission (validation.body_invalid, validation.field_required,
            validation.permissions_empty, validation.permission_unknown)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '403':
          description: The key's scopes do not include accounts:manage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '404':
          description: Account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api_endpoints.UpdateAccountPermissionsRequest:
      type: object
      properties:
        permissions:
          description: >-
            Permissions replaces the account's permissions and is required. Send
            null to give the account every permission, including ones added
            later. An empty list is rejected. Removing a permission immediately
            deletes the comments, messages, analytics and posts not published
            through SocialAPI that it covers; posts published through SocialAPI
            are kept. Valid values: posts.read, posts.write, comments.read,
            comments.write, messages.read, messages.write, reviews.read,
            reviews.write, analytics.read.
          type: array
          items:
            type: string
          example:
            - comments.read
            - comments.write
          nullable: true
    social-api_ai_core_api_connectors_base.Account:
      type: object
      properties:
        bio:
          description: '[optional] Profile biography or description'
          type: string
        brand_id:
          description: '[always] SocialAPI brand ID this account belongs to'
          type: string
        connection_type:
          description: >-
            [optional] "profile" for a LinkedIn personal profile connected with
            connection_type "profile" (beta). Absent for every other account
          type: string
          enum:
            - profile
          example: profile
        effective_permissions:
          description: >-
            [always] The permissions this account can use right now: the
            requested permissions the platform supports, minus any the platform
            did not grant or has since refused. Uses the same names as
            permissions. An empty list when none apply
          type: array
          items:
            type: string
        id:
          description: '[always]'
          type: string
          example: acc_01HZ9X3Q4R5M6N7P8V2K0W1J
        login_id:
          description: >-
            [optional] Login id shared by accounts connected in the same
            authorization (e.g. facebook)
          type: string
        metadata:
          description: '[optional] Platform-specific keys for this account'
          type: object
          additionalProperties: {}
        name:
          description: '[always] Display name of the account or page'
          type: string
          example: Acme Corp
        page_name:
          description: >-
            [optional] Name of the single active page bound to this account; set
            only when exactly one page is active (e.g. facebook), so clients can
            label the tile with the page instead of the login identity
          type: string
        permissions:
          description: >-
            [always] The permissions requested for this account: one or more of
            posts.read, posts.write, comments.read, comments.write,
            messages.read, messages.write, reviews.read, reviews.write,
            analytics.read. null means every permission, including ones added
            later
          type: array
          items:
            type: string
        platform:
          description: '[always]'
          type: string
          example: instagram
        profile_picture_url:
          description: '[optional] Profile picture URL'
          type: string
        reconnect_reason:
          description: >-
            [optional] Human-readable reason; only set when Status ==
            "reconnect_required"
          type: string
        status:
          description: '[always] One of: active, reconnect_required'
          type: string
          example: active
        username:
          description: '[always] May equal Name on platforms without a distinct handle'
          type: string
          example: acmecorp
    api_endpoints.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/api_endpoints.ErrorBody'
    api_endpoints.ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: resource.not_found
        message:
          type: string
          example: Account not found
        meta:
          type: object
          additionalProperties: {}
  securitySchemes:
    BearerAuth:
      description: >-
        Prefix your API key with "Bearer ". Example: `Authorization: Bearer
        sapi_key_...`
      type: apiKey
      name: Authorization
      in: header

````

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