Billing Groups API

Billing groups operations API

List all billing groups

SecuritybearerAuth
Request
query Parameters
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

A paginated array of billing groups

Response Schema: application/json
Array of objects (BillingGroup)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/billing_groups
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.BillingGroup.list(page={"number":1,"size":20})
Response samples
application/json
{
  • "data": [
    • {
      • "created_at": "2019-10-15T10:07:15.527Z",
      • "deleted_at": null,
      • "id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
      • "name": "My billing group name",
      • "organization_id": "f1486bae-f067-460c-ad43-73a92848f902",
      • "record_type": "billing_group",
      • "updated_at": "2019-10-15T10:07:15.527Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a billing group

SecuritybearerAuth
Request
Request Body schema: application/json
required

New billing group object

name
string

A name for the billing group

Responses
200

Expected billing group response to a valid request

Response Schema: application/json
object (BillingGroup)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

deleted_at
string <date-time>

ISO 8601 formatted date indicating when the resource was removed.

id
string <uuid>

Identifies the type of resource.

name
string <string>

A user-specified name for the billing group

organization_id
string <uuid>

Identifies the organization that owns the resource.

record_type
string

Identifies the type of the resource.

Value: "billing_group"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/billing_groups
Request samples
application/json
{
  • "name": "string"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-10-15T10:07:15.527Z",
    • "deleted_at": null,
    • "id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "name": "My billing group name",
    • "organization_id": "f1486bae-f067-460c-ad43-73a92848f902",
    • "record_type": "billing_group",
    • "updated_at": "2019-10-15T10:07:15.527Z"
    }
}

Delete a billing group

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the billing group

Responses
200

Expected billing group response to a valid request

Response Schema: application/json
object (BillingGroup)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

deleted_at
string <date-time>

ISO 8601 formatted date indicating when the resource was removed.

id
string <uuid>

Identifies the type of resource.

name
string <string>

A user-specified name for the billing group

organization_id
string <uuid>

Identifies the organization that owns the resource.

record_type
string

Identifies the type of the resource.

Value: "billing_group"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/billing_groups/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

res = telnyx.BillingGroup.retrieve('id')
res.delete()
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-10-15T10:07:15.527Z",
    • "deleted_at": null,
    • "id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "name": "My billing group name",
    • "organization_id": "f1486bae-f067-460c-ad43-73a92848f902",
    • "record_type": "billing_group",
    • "updated_at": "2019-10-15T10:07:15.527Z"
    }
}

Retrieve a billing group

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the billing group

Responses
200

Expected billing group response to a valid request

Response Schema: application/json
object (BillingGroup)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

deleted_at
string <date-time>

ISO 8601 formatted date indicating when the resource was removed.

id
string <uuid>

Identifies the type of resource.

name
string <string>

A user-specified name for the billing group

organization_id
string <uuid>

Identifies the organization that owns the resource.

record_type
string

Identifies the type of the resource.

Value: "billing_group"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/billing_groups/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.BillingGroup.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-10-15T10:07:15.527Z",
    • "deleted_at": null,
    • "id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "name": "My billing group name",
    • "organization_id": "f1486bae-f067-460c-ad43-73a92848f902",
    • "record_type": "billing_group",
    • "updated_at": "2019-10-15T10:07:15.527Z"
    }
}

Update a billing group

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the billing group

Request Body schema: application/json
required

Update billing group object

name
string

A name for the billing group

Responses
200

Expected billing group response to a valid request

Response Schema: application/json
object (BillingGroup)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

deleted_at
string <date-time>

ISO 8601 formatted date indicating when the resource was removed.

id
string <uuid>

Identifies the type of resource.

name
string <string>

A user-specified name for the billing group

organization_id
string <uuid>

Identifies the organization that owns the resource.

record_type
string

Identifies the type of the resource.

Value: "billing_group"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/billing_groups/{id}
Request samples
application/json
{
  • "name": "string"
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-10-15T10:07:15.527Z",
    • "deleted_at": null,
    • "id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "name": "My billing group name",
    • "organization_id": "f1486bae-f067-460c-ad43-73a92848f902",
    • "record_type": "billing_group",
    • "updated_at": "2019-10-15T10:07:15.527Z"
    }
}