> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# GetAccountPlans

POST https://api.voximplant.com/platform_api/GetAccountPlans

Gets the account plans with packages.

**Example request:** Get all account plans with packages.

Reference: https://docs.voximplant.ai/api-reference/management-api/reference/accounts/get-account-plans

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: management-api
  version: 1.0.0
paths:
  /GetAccountPlans:
    post:
      operationId: get-account-plans
      summary: GetAccountPlans
      description: |-
        Gets the account plans with packages.

        **Example request:** Get all account plans with packages.
      tags:
        - subpackage_accounts
      parameters:
        - name: plan_type
          in: query
          description: >-
            The plan type list separated by semicolons (;). The possible values
            are IM, MAU
          required: false
          schema:
            type: array
            items:
              type: string
        - name: plan_subscription_template_id
          in: query
          description: The plan ID list separated by semicolons (;)
          required: false
          schema:
            type: array
            items:
              type: integer
        - name: Authorization
          in: header
          description: >-
            Voximplant Management API uses signed JWT tokens generated from your
            service-account private key. Pass the token in the `Authorization`
            header as a Bearer value:


            ```

            Authorization: Bearer $VOXIMPLANT_TOKEN

            ```


            See [Authorization](/api-reference/management-api/authorization) for
            ready-to-copy snippets in bash, Python, Node.js and Go that turn
            your `credentials.json` into a token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accounts_GetAccountPlans_Response_200'
servers:
  - url: https://api.voximplant.com/platform_api
components:
  schemas:
    AccountPlanPackageType:
      type: object
      properties:
        price_group_id:
          type: array
          items:
            type: integer
          description: The price group IDs
        package_name:
          type: string
          description: The package name
        may_overrun:
          type: boolean
          description: Whether overrun is enabled
        overrun_price:
          type: number
          format: double
          description: The overrun amount
        overrun_resources:
          type: integer
          description: The number of resources (e.g., messages) per overrun
        resource_left:
          type: integer
          description: The resource left in the package
        package_size:
          type: integer
          description: The current package size (including overrun)
        orig_package_size:
          type: integer
          description: The original package size (excluding overrun)
      description: The account plan package info.
      title: AccountPlanPackageType
    AccountPlanType:
      type: object
      properties:
        plan_subscription_template_id:
          type: integer
          description: The current plan ID
        next_charge:
          type: string
          description: |-
            Date string as returned by the Management API.

            The next charge date, format: YYYY-MM-DD
        plan_type:
          type: string
          description: The plan type. The possible values are IM, MAU
        plan_name:
          type: string
          description: The plan name
        periodic_charge:
          type: number
          format: double
          description: The plan monthly charge
        packages:
          type: array
          items:
            $ref: '#/components/schemas/AccountPlanPackageType'
          description: The account plan package array
      description: The [GetAccountPlans] function result item.
      title: AccountPlanType
    accounts_GetAccountPlans_Response_200:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/AccountPlanType'
      title: accounts_GetAccountPlans_Response_200
  securitySchemes:
    JwtAuth:
      type: http
      scheme: bearer
      description: >-
        Voximplant Management API uses signed JWT tokens generated from your
        service-account private key. Pass the token in the `Authorization`
        header as a Bearer value:


        ```

        Authorization: Bearer $VOXIMPLANT_TOKEN

        ```


        See [Authorization](/api-reference/management-api/authorization) for
        ready-to-copy snippets in bash, Python, Node.js and Go that turn your
        `credentials.json` into a token.

```

## SDK Code Examples

```python Account plans
import requests

url = "https://api.voximplant.com/platform_api/GetAccountPlans"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Account plans
const url = 'https://api.voximplant.com/platform_api/GetAccountPlans';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Account plans
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/GetAccountPlans"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Account plans
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/GetAccountPlans")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Account plans
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/GetAccountPlans")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Account plans
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/GetAccountPlans', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Account plans
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/GetAccountPlans");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Account plans
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetAccountPlans")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```