API Reference
API Reference
The Codelet API is a RESTful API that allows you to manage your Codelet projects and resources.
Authentication
The Codelet API uses API keys for authentication. You can create API keys in the Codelet dashboard.
You can generate different keys for sandbox and live environments. The API URLs are the same for both environments, but the keys are different.
Include the API key in the Authorization header of your requests.
Authorization: Bearer <API_KEY>Base URL
The base URL for the Codelet API is:
https://api.codelet.com/API Reference
Quick start
To get started with Codelet, you only need two API calls.
You should also set up webhooks to receive usage events from Codelet. Use this data to update your local customer data about subscriptions, balances and purchases.
Use the other API endpoints listed below to do more with your account.
Account
Checkout
Credits
List credit packs
Return credit packs ordered by sort order then name.
Create a credit pack
Create a credit pack.
Get a credit pack
Return a single credit pack by ID, including inactive packs.
Update a credit pack
Update name, description, and/or active on a credit pack.
Customers
List customers
Return customers for the project and environment.
Create a customer
Create a customer.
Get a customer
Return a single customer.
Update a customer
Update editable fields on a customer.
Get customer credit balances
Return remaining included and purchased credits per metric.
Plans
List plans
Return plans ordered by name.
Create a plan
Create a plan with draft version 1.
Get a plan
Return a single plan by ID.
Publish a plan
Publish the draft version of a plan so it can be used for checkout.
Metrics
List metrics
Return metrics for the project and environment, ordered by ID.
Create a metric
Create a usage metric.
Get a metric
Return a single metric by its name.
Update metric display name
Update the display name for a metric.
Subscriptions
List subscriptions
Return subscriptions for the project and environment.
Get a subscription
Return a single subscription by Codelet ID.
