v1

latestOpenAPI 3.1.02026-07-265817860.8 KB
entities

Fetches an entity by its ID.

Use this to read one entity's current state. Pass customerId when you want to scope the lookup to a specific customer.

post/v1/entities.get

Headers

x-api-versionstring required

Request body

customer_idstring

The ID of the customer to create the entity for.

entity_idstring required

The ID of the entity.

Example request

{
  "entity_id": "seat_42"
}

Response

OK

idstring nullable required

The unique identifier of the entity

namestring nullable required

The name of the entity

customer_idstring nullable

The customer ID this entity belongs to

feature_idstring nullable

The feature ID this entity belongs to

created_atnumber required

Unix timestamp when the entity was created

env'sandbox' | 'live' required

The environment (sandbox/live)

balancesobject required
flagsobject required

Example response

{
  "id": "seat_42",
  "name": "Seat 42",
  "customer_id": "cus_123",
  "feature_id": "seats",
  "created_at": 1771409161016,
  "env": "sandbox",
  "subscriptions": [
    {
      "plan_id": "pro_plan",
      "auto_enable": true,
      "add_on": false,
      "status": "active",
      "past_due": false,
      "canceled_at": null,
      "expires_at": null,
      "trial_ends_at": null,
      "started_at": 1771431921437,
      "current_period_start": 1771431921437,
      "current_period_end": 1771999921437,
      "quantity": 1
    }
  ],
  "purchases": [],
  "balances": {
    "messages": {
      "feature_id": "messages",
      "granted": 100,
      "remaining": 72,
      "usage": 28,
      "unlimited": false,
      "overage_allowed": false,
      "max_purchase": null,
      "next_reset_at": 1773851121437,
      "breakdown": [
        {
          "id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
          "plan_id": "pro_plan",
          "included_grant": 100,
          "prepaid_grant": 0,
          "remaining": 72,
          "usage": 28,
          "unlimited": false,
          "reset": {
            "interval": "month",
            "resets_at": 1773851121437
          },
          "price": null,
          "expires_at": null
        }
      ]
    }
  },
  "invoices": []
}