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

# Bind an account to a portfolio

> Requires `portfolio:write` and `Idempotency-Key`. `global` cannot be changed.



## OpenAPI

````yaml /openapi/portfobit-openapi.yaml post /portfolios/{portfolio_id}/accounts
openapi: 3.1.0
info:
  title: Portfobit Open API
  version: 0.1.0
  description: >
    Public REST API for direct API clients, CI, scripts, service accounts,
    third-party agents, and developer integrations.

    Public REST requests use scoped Portfobit Open API keys. OAuth access tokens
    issued for the Portfobit MCP resource are not accepted by `/api/v1/*`
    endpoints.

    Portfobit is crypto-CEX-only. Financial values are decimal strings and
    timestamps are RFC 3339 UTC strings.

    The API never supports withdrawals, external-address transfers,
    cross-exchange transfers, or P2P transfers.
servers:
  - url: https://api.portfobit.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Context
  - name: Accounts
  - name: Portfolios
  - name: Valuation
  - name: Activity
  - name: Trading
  - name: Market data
  - name: Support
paths:
  /portfolios/{portfolio_id}/accounts:
    post:
      tags:
        - Portfolios
      summary: Bind an account to a portfolio
      description: >-
        Requires `portfolio:write` and `Idempotency-Key`. `global` cannot be
        changed.
      operationId: bindPortfolioAccount
      parameters:
        - $ref: '#/components/parameters/MutablePortfolioId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        $ref: '#/components/requestBodies/PortfolioAccountRequest'
      responses:
        '200':
          $ref: '#/components/responses/PortfolioMembershipResponse'
        '403':
          $ref: '#/components/responses/ResourcePlanLimitedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    MutablePortfolioId:
      name: portfolio_id
      in: path
      required: true
      schema:
        type: string
        not:
          const: global
      description: User-created portfolio ID; `global` cannot be changed.
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: Opaque retry key, unique to the same user, method, and path.
  requestBodies:
    PortfolioAccountRequest:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - account_id
            properties:
              account_id:
                type: string
            additionalProperties: false
  responses:
    PortfolioMembershipResponse:
      description: Portfolio membership response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PortfolioMembershipResponseSchema'
    ResourcePlanLimitedResponse:
      description: The targeted retained resource is unavailable on the current plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourcePlanLimitedResponseSchema'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    PortfolioMembershipResponseSchema:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - portfolio_id
            - account_id
            - matched_account_count
          properties:
            portfolio_id:
              type: string
            account_id:
              type: string
            matched_account_count:
              type: integer
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        data:
          portfolio_id: pf_01J2K7M9N3
          account_id: acc_01H8XFK9A
          matched_account_count: 1
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-07T08:00:01Z'
    ResourcePlanLimitedResponseSchema:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              required:
                - resource_type
                - resource_id
                - current_plan
                - limit
                - upgrade_path
              properties:
                resource_type:
                  type: string
                resource_id:
                  type: string
                current_plan:
                  type: string
                limit:
                  type: integer
                upgrade_path:
                  type: string
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        error:
          code: resource_plan_limited
          message: This portfolio is retained but unavailable on the Free plan.
          details:
            resource_type: portfolio
            resource_id: pf_01J2K7M9N3
            current_plan: Free
            limit: 3
            upgrade_path: Plus
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-08T08:00:00Z'
    ErrorEnvelope:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Meta:
      type: object
      required:
        - request_id
        - generated_at
      properties:
        request_id:
          type: string
        generated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Portfobit Open API key

````

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