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

# Retrieve an account

> Returns one of your accounts from our records, without asking the broker. Takes no query parameters. For what the broker holds in it, read its balance and positions.



## OpenAPI

````yaml /openapi.json get /v1/accounts/{account}
openapi: 3.1.0
info:
  title: Matamba Gateway
  version: '1'
  contact:
    name: Matamba Gateway partner support
    email: partners@matambaintelligence.com
    url: https://docs.matambaintelligence.com/support
  description: >-
    Open brokerage accounts for your customers, fund them from your wallet,
    place and track orders, and read each account's records at the broker.
    Amounts are integers in kobo, except the two average prices, which are
    decimal strings of kobo. Every error includes a `code` you can use in your
    logic. A list of values, such as an order state or an error `code`, can gain
    values: if you generate a client, have it accept values it doesn't know (in
    OpenAPI Generator, `enumUnknownDefaultCase`).
servers:
  - url: https://{host}
    description: The sandbox and live environments each have their own host and API keys.
    variables:
      host:
        default: sandbox-host.invalid
        description: We send you the host along with your API keys.
security:
  - bearer: []
tags:
  - name: Accounts
    description: The accounts you can trade for, and the broker's records for each one.
  - name: Orders
    description: >-
      Estimate, place, retrieve and cancel orders. We store each order before we
      send it to the exchange, and we send it only once.
  - name: Events
    description: >-
      Each change to your orders, applications and allocations creates an event.
      We send the same event bodies to your webhook endpoint. See
      [Webhooks](/webhooks) for how to verify them.
  - name: Applications
    description: Open a brokerage account for your customer.
  - name: Reference
    description: Code lists from the broker that you use in account applications.
  - name: Wallet
    description: >-
      Your wallet, and the allocations you make from it to your customers'
      accounts.
  - name: Limits
    description: >-
      What you may send: the limits on your requests and your day, and how much
      of each you've used.
  - name: Keys
    description: Revoke a key that has leaked, yourself, at any hour.
paths:
  /v1/accounts/{account}:
    parameters:
      - $ref: '#/components/parameters/Account'
    get:
      tags:
        - Accounts
      summary: Retrieve an account
      description: >-
        Returns one of your accounts from our records, without asking the
        broker. Takes no query parameters. For what the broker holds in it, read
        its balance and positions.
      operationId: getAccount
      responses:
        '200':
          $ref: '#/components/responses/Account'
        '400':
          $ref: '#/components/responses/error.invalid_request'
          description: '`invalid_request`: this endpoint takes no query parameters.'
        '401':
          $ref: '#/components/responses/error.unauthorized'
          description: '`unauthorized`'
        '403':
          $ref: '#/components/responses/error.insufficient_scope'
          description: '`insufficient_scope`: this key doesn''t have the `read` scope.'
        '404':
          $ref: '#/components/responses/error.account_not_found'
          description: >-
            `account_not_found`: you have no account with this code. An account
            of someone else's returns the same.
        '429':
          $ref: '#/components/responses/error.rate_limited'
          description: '`rate_limited`'
        '500':
          $ref: '#/components/responses/error.internal_error'
          description: '`internal_error`'
        '503':
          $ref: '#/components/responses/error.service_unavailable'
          description: '`service_unavailable`'
      security:
        - bearer:
            - read
components:
  parameters:
    Account:
      name: account
      in: path
      required: true
      description: One of your account codes, from GET /v1/accounts.
      schema:
        $ref: '#/components/schemas/AccountCode'
      example: '1000000001'
  responses:
    Account:
      description: One of your accounts.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Account'
          example:
            object: account
            code: '1000000077'
            application: app_5n2c6xq4ld7kz3pw7vby
            created_at: '2026-09-25T07:41:30Z'
    error.invalid_request:
      description: 'An error: `invalid_request`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid_request:
              summary: invalid_request
              value:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: The request could not be read.
                  doc_url: https://docs.matambaintelligence.com/errors#invalid_request
    error.unauthorized:
      description: 'An error: `unauthorized`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        WWW-Authenticate:
          $ref: '#/components/headers/WWWAuthenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                error:
                  type: authentication_error
                  code: unauthorized
                  message: Invalid credentials.
                  doc_url: https://docs.matambaintelligence.com/errors#unauthorized
    error.insufficient_scope:
      description: 'An error: `insufficient_scope`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficient_scope:
              summary: insufficient_scope
              value:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: >-
                    This API key does not have the scope this request requires.
                    Nothing was done.
                  doc_url: >-
                    https://docs.matambaintelligence.com/errors#insufficient_scope
    error.account_not_found:
      description: 'An error: `account_not_found`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            account_not_found:
              summary: account_not_found
              value:
                error:
                  type: invalid_request_error
                  code: account_not_found
                  message: No such account.
                  doc_url: >-
                    https://docs.matambaintelligence.com/errors#account_not_found
    error.rate_limited:
      description: 'An error: `rate_limited`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limited:
              summary: rate_limited
              value:
                error:
                  type: rate_limit_error
                  code: rate_limited
                  message: >-
                    Too many requests. Nothing was done. Send the same request
                    again after the Retry-After interval.
                  doc_url: https://docs.matambaintelligence.com/errors#rate_limited
    error.internal_error:
      description: 'An error: `internal_error`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            internal_error:
              summary: internal_error
              value:
                error:
                  type: api_error
                  code: internal_error
                  message: >-
                    The gateway encountered an internal error. Send the same
                    request again, exactly as you sent it.
                  doc_url: https://docs.matambaintelligence.com/errors#internal_error
    error.service_unavailable:
      description: 'An error: `service_unavailable`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            service_unavailable:
              summary: service_unavailable
              value:
                error:
                  type: api_error
                  code: service_unavailable
                  message: >-
                    The gateway is temporarily unable to process this request.
                    Send the same request again, with the same Idempotency-Key
                    if it has one.
                  doc_url: >-
                    https://docs.matambaintelligence.com/errors#service_unavailable
  schemas:
    AccountCode:
      type: string
      pattern: ^[A-Za-z0-9]{1,64}$
      description: An account code. Case-insensitive on input, and returned in uppercase.
    Account:
      type: object
      required:
        - object
        - code
        - application
        - created_at
      properties:
        object:
          type: string
          const: account
        code:
          type: string
          description: The code to pass as `account` in an order or allocation.
        application:
          type:
            - string
            - 'null'
          description: >-
            The application that opened the account, when you opened it through
            the API. Null when we added the account for you.
          pattern: ^app_[a-z2-7]{20}$
        created_at:
          type: string
          format: date-time
          description: When the account became yours to trade for through the API.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - doc_url
          properties:
            type:
              type: string
              description: >-
                The category of the error. New values can be added: handle an
                unrecognised value with a safe default.
              enum:
                - authentication_error
                - invalid_request_error
                - idempotency_error
                - order_error
                - application_error
                - wallet_error
                - limit_error
                - rate_limit_error
                - permission_error
                - api_error
            code:
              type: string
              description: >-
                The error code. Use it in your logic; it doesn't change. New
                values can be added: handle an unrecognised value with a safe
                default.
              enum:
                - unauthorized
                - not_found
                - method_not_allowed
                - unsupported_media_type
                - request_too_large
                - invalid_request
                - missing_required_field
                - unknown_account
                - duplicate_order
                - order_not_found
                - account_not_found
                - exchange_unavailable
                - order_not_sent
                - order_rejected
                - similar_order_unresolved
                - order_not_cancelable
                - cancel_unconfirmed
                - settlement_lockout
                - account_not_at_broker
                - exchange_error
                - feature_not_enabled
                - insufficient_scope
                - application_rejected
                - duplicate_application
                - application_not_found
                - application_not_sent
                - wallet_too_low
                - allocation_rejected
                - duplicate_allocation
                - allocation_not_found
                - allocation_not_sent
                - similar_allocation_unresolved
                - rate_limited
                - unknown_symbol
                - limit_exceeded
                - service_unavailable
                - internal_error
                - trading_paused
                - outcome_not_recorded
            message:
              type: string
              description: >-
                A human-readable description of the error, for your logs. The
                wording can change.
            param:
              type: string
              description: >-
                The field, parameter or header that caused the error. Absent
                when the error isn't tied to a single field.
            reject_reason:
              type: string
              description: >-
                Why the exchange or broker rejected the request. Included with
                `order_rejected`, `application_rejected` and
                `allocation_rejected`, and takes the same values as the
                `reject_reason` field on the order, application or allocation.
            order:
              type: string
              description: >-
                The order the error is about, when it names one: the order that
                owns the `Idempotency-Key` for `duplicate_order`, the unresolved
                order for `similar_order_unresolved`, the order recorded for
                `order_rejected` and `order_not_sent`, and the order your
                request made for `outcome_not_recorded`.
              pattern: ^ord_[a-z2-7]{20}$
            application:
              type: string
              description: >-
                The application the error is about, when it names one: the one
                that owns the key for `duplicate_application`, the one recorded
                for `application_rejected` and `application_not_sent`, and the
                one your request made for `outcome_not_recorded`.
              pattern: ^app_[a-z2-7]{20}$
            allocation:
              type: string
              description: >-
                The allocation the error is about, when it names one: the one
                that owns the key for `duplicate_allocation`, the unresolved one
                for `similar_allocation_unresolved`, the one recorded for
                `allocation_rejected`, `allocation_not_sent` and
                `feature_not_enabled`, and the one your request made for
                `outcome_not_recorded`.
              pattern: ^alc_[a-z2-7]{20}$
            doc_url:
              type: string
              format: uri
              description: A link to the documentation for this error code.
          description: What went wrong, and the code to act on.
  headers:
    RequestId:
      description: >-
        A unique identifier for this request. Include it when you [contact
        us](/support#report-a-problem).
      schema:
        type: string
    CacheControl:
      description: Always `no-store`.
      schema:
        type: string
        const: no-store
    WWWAuthenticate:
      description: 'Sent with 401: `Bearer realm="Matamba Gateway"`.'
      schema:
        type: string
    RetryAfter:
      description: >-
        The number of seconds to wait before you retry. Sent with `429
        rate_limited` (`1`), `503 settlement_lockout` (`60`) and `503
        trading_paused` (`60`).
      schema:
        type: integer
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        `Authorization: Bearer <key>`. Sandbox keys start with `mgw_test_` and
        live keys start with `mgw_live_`. Each key works only in its own
        environment, and a live key works only from the IP addresses or ranges
        registered for it.

````