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

# Check account status

> Check an account's status and capabilities



## OpenAPI

````yaml GET /accounts/{account_id}/status
openapi: 3.1.1
info:
  title: Surge
  version: '1.0'
servers:
  - url: https://api.surge.app
security:
  - authorization: []
paths:
  /accounts/{account_id}/status:
    get:
      tags:
        - Accounts
      summary: Check account status
      description: Check an account's status and capabilities
      operationId: CheckAccountStatus
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            description: ID of the account to check
            example: acct_01jpqjvfg9enpt7pyxd60pcmxj
            type: string
        - explode: false
          in: query
          name: capabilities
          required: false
          schema:
            description: capabilities about which to check the status
            example: local_messaging
            items:
              enum:
                - local_messaging
              type: string
            type: array
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountStatus'
          description: Account status
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Surge from '@surgeapi/node';


            const client = new Surge({
              apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
            });


            const accountStatus = await
            client.accounts.retrieveStatus('acct_01jpqjvfg9enpt7pyxd60pcmxj');


            console.log(accountStatus.capabilities);
        - lang: Python
          source: |-
            import os
            from surge import Surge

            client = Surge(
                api_key=os.environ.get("SURGE_API_KEY"),  # This is the default and can be omitted
            )
            account_status = client.accounts.retrieve_status(
                account_id="acct_01jpqjvfg9enpt7pyxd60pcmxj",
            )
            print(account_status.capabilities)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/surge-go\"\n\t\"github.com/stainless-sdks/surge-go/option\"\n)\n\nfunc main() {\n\tclient := surge.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\taccountStatus, err := client.Accounts.GetStatus(\n\t\tcontext.TODO(),\n\t\t\"acct_01jpqjvfg9enpt7pyxd60pcmxj\",\n\t\tsurge.AccountGetStatusParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", accountStatus.Capabilities)\n}\n"
        - lang: Ruby
          source: >-
            require "surge_api"


            surge = SurgeAPI::Client.new(api_key: "My API Key")


            account_status =
            surge.accounts.retrieve_status("acct_01jpqjvfg9enpt7pyxd60pcmxj")


            puts(account_status)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Surge\Client;

            use Surge\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API
            Key');


            try {
              $accountStatus = $client->accounts->retrieveStatus(
                'acct_01jpqjvfg9enpt7pyxd60pcmxj', capabilities: ['local_messaging']
              );

              var_dump($accountStatus);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
components:
  schemas:
    AccountStatus:
      description: Response containing account status information
      example:
        capabilities:
          local_messaging:
            errors:
              - field: organization.registered_name
                message: >-
                  The provided EIN doesn't match the organization's registered
                  name.
                type: ein_mismatch
            fields_needed: []
            status: error
          phone_calls:
            errors: []
            fields_needed: []
            status: ready
          toll_free_messaging:
            errors: []
            fields_needed:
              - organization.contact.title_other
              - organization.mobile_number
            status: incomplete
      properties:
        capabilities:
          additionalProperties:
            properties:
              errors:
                description: >-
                  A list of errors that will need corrected before capability is
                  available to account.
                items:
                  properties:
                    field:
                      description: >-
                        A dot-delimited string representing the field that has
                        an error, as in `organization.contact.phone_number`.
                      type: string
                    message:
                      description: A human-readable string explaining the error.
                      type: string
                    type:
                      description: A slug for the error type
                      type: string
                  required:
                    - type
                    - field
                    - message
                  type: object
                type: array
              fields_needed:
                description: >-
                  A list of missing fields that are required for the capability.
                  Nested field names are dot-delimited, as in
                  `organization.address.region`.
                items:
                  type: string
                type: array
              status:
                description: >-
                  Whether the account is ready for the capability, has errors
                  that need corrected, or is incomplete and requires missing
                  data. If account has both missing and invalid fields, `error`
                  will be preferred over `incomplete`.
                enum:
                  - error
                  - incomplete
                  - ready
                type: string
            required:
              - status
              - errors
              - fields_needed
            type: object
          description: >-
            An object where the fields are the capabilities passed in the
            `capabilities` query param, as in `local_messaging`.
          type: object
      required:
        - capabilities
      title: AccountStatus
      type: object
    ErrorResponse:
      description: An error response
      example:
        error:
          message: The requested resource could not be found.
          type: not_found
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      title: ErrorResponse
      type: object
    Error:
      description: An error response
      example:
        message: The requested resource was not found.
        type: not_found
      properties:
        detail:
          additionalProperties: true
          description: Additional details about the error.
          type: object
        message:
          description: A human-readable error message.
          example: The requested resource was not found.
          type: string
        type:
          description: A unique error code.
          example: not_found
          type: string
      required:
        - type
        - message
      title: Error
      type: object
  securitySchemes:
    authorization:
      bearerFormat: Surge API token
      scheme: bearer
      type: http

````