API Reference
AcmeClient
Section titled “AcmeClient”The main client class. All API interactions go through this object.
Constructor
Section titled “Constructor”new AcmeClient(options: ClientOptions)| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey | string | Yes* | — | Your API key |
accessToken | string | Yes* | — | OAuth access token |
baseUrl | string | No | API URL | Custom API endpoint |
timeout | number | No | 30000 | Request timeout in ms |
maxRetries | number | No | 3 | Max retry attempts |
retryDelay | number | No | 1000 | Base retry delay in ms |
Resources
Section titled “Resources”client.resources.list()
Section titled “client.resources.list()”Returns a paginated list of resources.
const result = await client.resources.list({ limit: 20, cursor: undefined, filter: { status: "active" },});Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Items per page (max 100) |
cursor | string | No | Pagination cursor |
filter | object | No | Filter criteria |
Returns: PaginatedResponse<Resource>
client.resources.get()
Section titled “client.resources.get()”Retrieves a single resource by ID.
const resource = await client.resources.get("res_abc123");Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Resource ID |
Returns: Resource
client.resources.create()
Section titled “client.resources.create()”Creates a new resource.
const resource = await client.resources.create({ name: "My Resource", type: "standard", metadata: { key: "value" },});Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
type | string | Yes | Resource type |
metadata | object | No | Arbitrary key-value pairs |
Returns: Resource
client.resources.update()
Section titled “client.resources.update()”Updates an existing resource.
const resource = await client.resources.update("res_abc123", { name: "Updated Name",});Returns: Resource
client.resources.delete()
Section titled “client.resources.delete()”Deletes a resource. This action is irreversible.
await client.resources.delete("res_abc123");Returns: void
Resource
Section titled “Resource”interface Resource { id: string; name: string; type: "standard" | "premium" | "enterprise"; status: "active" | "archived" | "deleted"; metadata: Record<string, unknown>; createdAt: string; updatedAt: string;}PaginatedResponse
Section titled “PaginatedResponse”interface PaginatedResponse<T> { data: T[]; nextCursor: string | null; hasMore: boolean; total: number;}AcmeError
Section titled “AcmeError”interface AcmeError { code: string; message: string; status: number; requestId: string;}