POST Execute Task

Run a pre-built Wire action

POSThttps://api.anakin.io/v1/holocron/task

Submit a task to execute a Wire action. Credits are deducted immediately at submission and refunded automatically if the job fails. Poll for results using GET /v1/holocron/jobs/{id}.


Request Body

{
  "action_id": "li_profile_scrape",
  "credential_id": "11111111-2222-3333-4444-555555555555",
  "params": {
    "profile_url": "https://www.linkedin.com/in/example"
  }
}
ParameterTypeDescription
action_id requiredstringThe action to run. Find action IDs in the Wire dashboard
credential_idstring (UUID)Required when the action has auth_mode: "required"; optional when auth_mode: "optional" (supply to run authenticated, omit to run anonymously). Get IDs from GET /v1/holocron/identities
paramsobjectAction-specific input parameters

auth_mode semantics:

  • requiredcredential_id is mandatory; otherwise the request returns 401 AUTH_REQUIRED.
  • optionalcredential_id is honored if provided (authenticated branch). Omit it to run anonymously.
  • nonecredential_id is ignored if provided.

List your credentials with GET /v1/holocron/identities, or manage them in the Identities dashboard.


Response

202 Accepted
{
  "status": "processing",
  "job_id": "7c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
  "poll_url": "/v1/holocron/jobs/7c3f1a2b-4d5e-6f7a-8b9c-0d1e2f3a4b5c"
}
FieldTypeDescription
job_idstringUse this to poll for results
poll_urlstringConvenience path for the polling endpoint

Use the job_id with GET /v1/holocron/jobs/{id} to retrieve your results.


Error Responses

Insufficient credits402 Payment Required

{
  "status": "error",
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "You need 5 credits. Current balance: 2",
    "balance": 2,
    "required": 5
  }
}

Authentication required401 Unauthorized

Returned when the action requires you to connect your account for the target website and you have no credential for it. Visit the connect_url to authenticate.

{
  "status": "error",
  "error": {
    "code": "AUTH_REQUIRED",
    "message": "This action requires a LinkedIn connection.",
    "connect_url": "/products/holocron/linkedin/connect"
  }
}

Credential expired401 Unauthorized

Returned when the credential_id you passed exists but its session is no longer valid (cookies expired, token revoked, password changed, etc.). The user needs to reconnect. List your credentials with GET /v1/holocron/identitiesstatus will show expired.

{
  "status": "error",
  "error": {
    "code": "AUTH_EXPIRED",
    "message": "Credential is no longer active. Please reconnect."
  }
}

Forbidden403 Forbidden

Returned when the credential_id you passed exists but doesn't belong to you, or belongs to a different catalog than the action you're calling. Common cause: copy/pasting a credential_id between accounts, or accidentally passing an Amazon credential to a LinkedIn action.

{
  "status": "error",
  "error": {
    "code": "FORBIDDEN",
    "message": "Credential does not belong to this user or catalog"
  }
}

Submission failed500 Internal Server Error

Transient server-side failure when enqueueing the task. Credits are not deducted. Retry the request; if it persists, contact support with the request timestamp.

{
  "status": "error",
  "error": {
    "code": "EXECUTION_FAILED",
    "message": "Failed to submit task. Please try again."
  }
}

Note: EXECUTION_FAILED can also appear as a final status on a successfully submitted job (see GET /v1/holocron/jobs/{id}). Same code, different meaning — at submission it means the engine couldn't enqueue; at job completion it means the scraper raised an unrecoverable error.


Code Examples

curl -X POST https://api.anakin.io/v1/holocron/task \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "li_profile_scrape",
    "credential_id": "11111111-2222-3333-4444-555555555555",
    "params": {
      "profile_url": "https://www.linkedin.com/in/example"
    }
  }'

credential_id is mandatory for actions with auth_mode: "required" (e.g. li_profile_scrape). It is honored when supplied for auth_mode: "optional" actions and ignored for auth_mode: "none". Get yours from GET /v1/holocron/identities.