The Bulk Spell Run endpoint is very similar to the standard Run Spell endpoint with some key differences. Mainly, there is no wait mode, as you will always receive bulkRunId as a return value.
To call a spell, you’ll need to enter the spell ID (found in the URL or on the spell page’s API tab) and the JSON representation of the inputs (found in the spell page’s API tab).
const response =awaitfetch('https://api-v2.respell.ai/spells/bulkStart',{method:'POST',headers:{authorization:'Bearer {{ YOUR API KEY }}',accept:'application/json','content-type':'application/json',},body:JSON.stringify({spellId:'{{ YOUR SPELL ID }}',inputs:[{"search_topic":"{{ YOUR CUSTOM INPUT }}"},{"search_topic":"{{ YOUR SECOND CUSTOM INPUT }}"}]}),})
The bulk run ID will be returned as JSON in the response body:
const response =awaitfetch('https://api-v2.respell.ai/spells/cancelBulk',{method:'POST',headers:{authorization:'Bearer {{ YOUR API KEY }}',accept:'application/json','content-type':'application/json',},body:JSON.stringify({groupId:'{{ YOUR BULK RUN ID }}',}),})
const response =awaitfetch('https://api-v2.respell.ai/spells/getBulkRuns',{method:'POST',headers:{authorization:'Bearer {{ YOUR API KEY }}',accept:'application/json','content-type':'application/json',},body:JSON.stringify({groupId:'{{ YOUR BULK RUN ID }}',}),})