Batch Job Status
Get the status of a specific batch job or list batches matching metadata using the Sinch Conversation Batch API.
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--batch-id/-b: Batch ID to get status for - optional (if omitted, list batches)--metadata-key/-k: Metadata key filter when listing - optional--metadata-value/-v: Metadata value filter when listing - optional--format/-f: Output format (table or json) - optional, default table
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask "Do you have a batch ID to check, or list recent batches?" and get batch-id or list preference. Otherwise parse.
Validate: optional --batch-id, --metadata-key, --metadata-value, --format (table|json).
Get CONVERSATION_* env vars. Batch API base: https://{region}.conversationbatch.api.sinch.com. If missing, report "Sinch API is not configured."
If --batch-id provided: GET https://{region}.conversationbatch.api.sinch.com/v1/projects/{projectId}/messages/{batch_id} with OAuth2. Return batch status, counts (sent, delivered, failed), etc.
If listing: GET https://{region}.conversationbatch.api.sinch.com/v1/projects/{projectId}/messages?metadataKey=X&metadataValue=Y with OAuth2. Display list of batches (id, status, created, recipient count).
Format output as table or JSON. On success display "✅ Batch status" or "✅ Batches listed". Handle 404, 401 with clear messages.
Handle all errors gracefully.
Examples
/sinch-api-batch-status --batch-id=BATCH_ID
/sinch-api-batch-status
/sinch-api-batch-status --metadata-key=campaign --metadata-value=welcome --format=json
API Reference
- Base URL: https://{region}.conversationbatch.api.sinch.com
- Get batch: GET /v1/projects/{project_id}/messages/{batch_id}
- List batches: GET /v1/projects/{project_id}/messages?metadataKey=&metadataValue=
- Documentation: https://developers.sinch.com/docs/conversation/batch/