Skip to main content
GET
Get Current Batch

Overview

The Get Current Batch endpoint retrieves the currently active flywheel batch for a specified token. This is useful for checking if there’s already an ongoing batch operation before creating a new one, or for getting the status of the current batch without needing to know the specific batch ID. Returns null if no current batch exists for the token.

Authentication

This endpoint requires API key authentication. The API key must have either burn or airdrop scopes. To authenticate, provide your API key in the x-believe-api-key request header. Example:

Rate Limiting

Requests to this endpoint are rate-limited to 10 requests per second per API key.

Request

This endpoint requires no request body. The current batch is determined based on the authenticated API key.

Example Request

Response Body

On success, the API returns either:
  • A JSON object containing the current batch information (same structure as /batch/{batchId})
  • null if no current batch exists for the token

Example Response (Current Batch Exists)

Example Response (No Current Batch)

Batch Status Values

When a current batch exists, it will have one of these status values:

Use Cases

  1. Pre-Creation Check: Verify no active batch exists before creating a new one.
  2. Status Monitoring: Get the current batch status without needing to store batch IDs.
  3. Workflow Management: Determine if your application should wait for current operations to complete.
  4. Error Recovery: Check if a batch is stuck in a particular state and needs intervention.
  5. Dashboard Display: Show users the current state of their token’s flywheel operations.

Integration Patterns

Before Creating New Batch

Status Monitoring Loop

Error Codes

The current batch endpoint can return specific error codes.

Example Error Response

Important Notes

  1. Null Response: A null response is normal and indicates no current batch exists for the token.
  2. Current Definition: A batch is considered “current” if it’s the most recent batch that hasn’t reached a final state.
  3. State Transitions: Once a batch reaches EXECUTED or FAILED status, it may no longer be considered “current” depending on your implementation.
  4. Race Conditions: In high-frequency applications, check for current batch immediately before creating new ones to avoid conflicts.
  5. Token Scoping: This endpoint only returns batches for the specific token ID provided, ensuring proper isolation between different tokens.

Authorizations

x-believe-api-key
string
header
required

Response

object | null

Current batch information or null if no current batch exists.

id
string
required

The unique batch identifier (UUID).

flywheelId
string
required

The flywheel this batch belongs to.

tokenId
string
required

The token ID associated with this batch.

mintAddress
string
required

The Solana mint address for the token.

status
enum<string>
required

Current batch status.

Available options:
AVAILABLE_TO_QUEUE,
FINALIZED,
EXECUTED,
FAILED
batchIndex
string
required

The multisig batch index used for execution.

vaultIndex
string
required

The vault index within the multisig.

multisig
string
required

The multisig wallet address.

vaultAddress
string
required

The vault address for token operations.

dateCreated
string<date-time>
required

ISO 8601 timestamp when the batch was created.

dateUpdated
string<date-time>
required

ISO 8601 timestamp when the batch was last updated.

initResult
object

Results from the batch initialization process (optional).

executeResult
object

Results from the batch execution process (optional).